public UIInventoryState(UIHandler uiHandler, GameObject parentNode) : base(uiHandler, parentNode) { this.tabGroup = parentNode.GetComponentInChildren <TabGroup>(); this.viewGroup = parentNode.transform.Find("Views").GetComponent <ViewGroup>(); Transform description = parentNode.transform.Find("Description"); title = description.Find("Title").GetComponent <PFontText>(); content = description.Find("Content").GetComponent <PFontText>(); }
public UIEquipmentState(UIHandler uiHandler, GameObject parentNode) : base(uiHandler, parentNode) { slotViews = parentNode.transform.Find("Slot_Views").GetComponent <ViewGroup>(); selectionViews = parentNode.transform.Find("Views").GetComponent <ViewGroup>(); title = parentNode.transform.Find("Description/Title").GetComponent <PFontText>(); content = parentNode.transform.Find("Description/Content").GetComponent <PFontText>(); currentSelectionLayer = SelectionLayer.SlotSelection; itemsPerPage = selectionViews.Row * selectionViews.Column; }
public override void Enter() { base.Enter(); for (int i = 0; i < (int)GameSaver.SaveSlot.SlotNum; ++i) { GameSaver gameSaver = uiHandler.GM.gameSaver; PFontText pFontText = null; if (positions[i] == null) { pFontText = buttonGroup.buttons[i].GetComponentInChildren <PFontText>(); positions[i] = pFontText.transform; } else { positions[i].gameObject.SetActive(true); pFontText = buttonGroup.buttons[i].GetComponentInChildren <PFontText>(); } if (emptys[i] == null) { emptys[i] = positions[i].parent.Find("Empty"); emptys[i].gameObject.SetActive(true); } else { emptys[i].gameObject.SetActive(true); } if (gameSaver.HasValidSaving((GameSaver.SaveSlot)i)) { GameSaver.SaveSlotMeta meta = gameSaver.GetSaveSlotMeta((GameSaver.SaveSlot)i); // string sceneCodeName = ((SceneCode)(meta.SceneCode)).ToString(); // string[] words = sceneCodeName.Split('_'); // string res = words[0] + " " + words[1]; // string res = sceneCodeName.Split('_')[0]; string res = SceneCodeDisplayName.names[(int)meta.SceneCode]; float hours = meta.elapsedSeconds / 3600; float minutes = meta.elapsedSeconds / 60 % 60; res += " " + (int)hours + "H " + (int)minutes + "M"; emptys[i].gameObject.SetActive(false); pFontText.SetText(res); } else { pFontText.gameObject.SetActive(false); } } }
void Start() { text = GetComponentInChildren <PFontText>(); }
void Awake() { pFontText = GetComponentInChildren <PFontText>(); }