1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- using System;
- using MaidStatus;
- using UnityEngine;
- using UnityEngine.UI;
- public class uGUIMaidPlate : MonoBehaviour
- {
- public Maid maid
- {
- get
- {
- return this.m_maid;
- }
- }
- private void Awake()
- {
- this.m_status.main = UTY.GetChildObject(base.gameObject, "Plate", false);
- this.m_status.leaderPlate = UTY.GetChildObject(base.gameObject, "Status/Leader", false).GetComponent<Image>();
- this.m_status.icon = UTY.GetChildObject(base.gameObject, "Figure/Icon", false).GetComponent<Image>();
- this.m_status.firstName = UTY.GetChildObject(base.gameObject, "Status/Name/FirstName", false).GetComponent<Text>();
- this.m_status.lastName = UTY.GetChildObject(base.gameObject, "Status/Name/LastName", false).GetComponent<Text>();
- this.m_status.contractType = UTY.GetChildObject(base.gameObject, "Status/ContractType/Value", false).GetComponent<Text>();
- this.SetMaidData(GameMain.Instance.CharacterMgr.GetMaid(0));
- }
- public void SetMaidData(Maid maid)
- {
- this.m_maid = maid;
- if (this.m_maid == null)
- {
- return;
- }
- MaidStatus.Status status = this.m_maid.status;
- this.m_status.leaderPlate.gameObject.SetActive(status.leader);
- NamePair charaName = status.charaName;
- this.m_status.lastName.text = charaName.name1;
- this.m_status.firstName.text = charaName.name2;
- if (status.heroineType != HeroineType.Sub)
- {
- this.m_status.contractType.text = EnumConvert.GetString(status.contract);
- }
- else
- {
- this.m_status.contractType.text = status.subCharaStatus.contractText;
- }
- Texture2D thumIcon = this.m_maid.GetThumIcon();
- if (thumIcon != null)
- {
- Sprite sprite = Sprite.Create(thumIcon, new Rect(0f, 0f, (float)thumIcon.width, (float)thumIcon.height), default(Vector2));
- this.m_status.icon.sprite = sprite;
- }
- else
- {
- this.m_status.icon.sprite = null;
- }
- }
- private Maid m_maid;
- private uGUIMaidPlate.Status m_status;
- private struct Status
- {
- public GameObject main;
- public Text firstName;
- public Text lastName;
- public Text contractType;
- public Image leaderPlate;
- public Image icon;
- }
- }
|