123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- using System;
- using MaidStatus;
- using UnityEngine;
- public class SimpleMaidPlate : MonoBehaviour
- {
- public void Awake()
- {
- this.thumbnail_sprite_ = UTY.GetChildObject(base.gameObject, "Plate/FrameThumbnail/Thum", false).GetComponent<UI2DSprite>();
- this.last_name_label_ = UTY.GetChildObject(base.gameObject, "Plate/FrameBaseData/TextLastName", false).GetComponent<UILabel>();
- this.first_name_label_ = UTY.GetChildObject(base.gameObject, "Plate/FrameBaseData/TextFirstName", false).GetComponent<UILabel>();
- this.leader_plate_ = UTY.GetChildObject(base.gameObject, "Plate/FrameBaseData/LeaderPlate", false);
- if (UTY.GetChildObject(base.gameObject, "Plate/FrameThumbnail/Engage", true) != null)
- {
- this.engage_heart_ = UTY.GetChildObject(base.gameObject, "Plate/FrameThumbnail/Engage", false).GetComponent<UILabel>();
- }
- }
- public void SetMaidData(Maid maid)
- {
- if (maid == null)
- {
- return;
- }
- Status status = maid.status;
- this.last_name_label_.text = status.lastName;
- this.first_name_label_.text = status.firstName;
- if (maid.boMAN)
- {
- this.last_name_label_.text = string.Empty;
- if (maid.ActiveSlotNo == 0)
- {
- this.first_name_label_.text = "主人公";
- }
- else
- {
- this.first_name_label_.text = "男" + maid.ActiveSlotNo.ToString();
- }
- }
- if (this.engage_heart_ != null)
- {
- this.engage_heart_.enabled = false;
- }
- this.leader_plate_.SetActive(status.leader);
- Texture2D thumIcon = maid.GetThumIcon();
- if (thumIcon != null)
- {
- Sprite sprite2D = Sprite.Create(thumIcon, new Rect(0f, 0f, (float)thumIcon.width, (float)thumIcon.height), default(Vector2));
- this.thumbnail_sprite_.sprite2D = sprite2D;
- }
- else
- {
- this.thumbnail_sprite_.sprite2D = null;
- }
- }
- private UI2DSprite thumbnail_sprite_;
- private UILabel last_name_label_;
- private UILabel first_name_label_;
- private UILabel engage_heart_;
- private GameObject leader_plate_;
- }
|