public void ReleaseText(HpText hpText) { hpText.Init(); hpText.gameObject.SetActive(false); hpTextQueue.Enqueue(hpText); useHpTextList.Remove(hpText); }
void GameStart() //遊戲狀態UI設定 { IsTutoring = false; TutorialText.SetActive(false); TutorialStart.SetActive(false); IsPlaying = true; Player.SetActive(true); HpPic0.SetActive(true); HpText.SetActive(true); ScoreTextObject.SetActive(true); }
public void SetHp(int value) { float hpValue = (goapAgent.Hp * 1.0f) / goapAgent.NpcData.hp; hpSlider.SetValue(hpValue); HpText hpText = GetText(); if (hpText != null) { hpText.gameObject.SetActive(true); hpText.SetValue(value); useHpTextList.Add(hpText); } }
public void GameOver() //遊戲失敗函式,以ShipController呼叫 { Instantiate(BoomSound); IsPlaying = false; HpText.SetActive(false); ReButtonSmall.SetActive(false); ReTextSmall.SetActive(false); ExitButtonSmall.SetActive(false); ExitTextSmall.SetActive(false); OverTitle.SetActive(true); ReButton.SetActive(true); ReText.SetActive(true); ExitButton.SetActive(true); ExitText.SetActive(true); }
private HpText GetText() { if (hpTextQueue.Count > 0) { return(hpTextQueue.Dequeue()); } if (textItem == null) { return(null); } Transform item = ToolsComponent.CloneItem(transform, textItem); HpText hpText = item.GetComponent <HpText>(); hpText.SetHp(this); return(hpText); }