123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- using System;
- using System.Collections.Generic;
- using MaidStatus;
- using UnityEngine;
- public class AttributeViewer : MonoBehaviour
- {
- public void Awake()
- {
- if (this.seiheki_table_ != null)
- {
- return;
- }
- this.updateStatusInfo = false;
- this.seiheki_table_ = UTY.GetChildObject(base.gameObject, "Contents/Attribute/AttributeUnitParent", false).GetComponent<UITable>();
- List<Transform> childList = this.seiheki_table_.GetChildList();
- for (int i = 0; i < childList.Count; i++)
- {
- childList[i].gameObject.SetActive(false);
- }
- this.seiheki_table_.Reposition();
- }
- public void OnEnable()
- {
- this.UpdateStatusInfo();
- }
- public void UpdateStatusInfo()
- {
- this.Awake();
- if (this.updateStatusInfo || this.targetMaid == null)
- {
- return;
- }
- this.updateStatusInfo = true;
- Status status = this.targetMaid.status;
- List<Transform> childList = this.seiheki_table_.GetChildList();
- for (int i = 0; i < childList.Count; i++)
- {
- childList[i].gameObject.SetActive(false);
- }
- int num = 0;
- foreach (Propensity.Data data in status.propensitys.GetValueArray())
- {
- if (childList.Count <= num)
- {
- break;
- }
- childList[num].gameObject.SetActive(true);
- UILabel componentInChildren = childList[num].gameObject.GetComponentInChildren<UILabel>();
- if (!(componentInChildren == null))
- {
- componentInChildren.text = data.drawName;
- num++;
- }
- }
- }
- [SerializeField]
- public Maid targetMaid;
- private UITable seiheki_table_;
- private bool updateStatusInfo;
- }
|