protected void SetUpHUDAndScores() { if (PD.gameType == PersistData.GT.Challenge) { GameObject g = new GameObject("PuzzleHUD"); hud = g.AddComponent <PuzzleHUD>(); hud.Setup(1, PD.GetPuzzleLevel()); } else if (PD.gameType == PersistData.GT.Campaign) { GameObject g = new GameObject("CampaignHUD"); hud = g.AddComponent <CampaignHUD>(); hud.Setup(1); } else { GameObject g = new GameObject("InGameHUD"); hud = g.AddComponent <InGameHUD>(); if (player2Human || (PD.isDemo && PD.demoPlayers == 2)) { hud.Setup(2); } else if (PD.isTutorial) { hud.Setup(1, 1); tutorialAssist = hud.tutorialAssist; tutorialAssist.SetBoards(board1, board2); tutorialAssist.MoveHighlightToPosition(board1.GetScreenPosFromXY(4, 5)); } else { hud.Setup(1); } } }
// Start is called before the first frame update void Start() { if (InGameHUD.instance == null) { InGameHUD.instance = this; } StartCoroutine(Countdown()); }
protected override void Start() { base.Start(); controller = gameObject.GetComponent <CharacterController>(); currentState = PlayerState.Neutral; gm = FindObjectOfType <GameManager>(); _isForcedInvincible = _isInvincible; inGameHUD = FindObjectOfType <InGameHUD>(); }
private void ModsButtonOnClick(object sender, EventArgs eventArgs) { InGameHUD inGameHud = GnomanEmpire.Instance.GuiManager.HUD; bool isOtherWindow = !(inGameHud.ActiveWindow is ModDialogUI); inGameHud.CloseWindow(); if (isOtherWindow) { inGameHud.ShowWindow(new ModDialogUI(_hud.Manager, ModManager)); } }
private void Awake() { if (!instance) { instance = this; } else { Destroy(this.gameObject); } }
private void Start() { //_animator = GetComponent<Animator>(); //_animator.SetInteger("stage", _uses); foreach (GameObject obj in _orePrefabSizes) { obj.SetActive(false); } _orePrefabSizes[Mathf.Clamp(_uses, 0, _orePrefabSizes.Length - 1)].SetActive(true); inGameHUD = FindObjectOfType <InGameHUD>(); }
void Start() { Time.timeScale = timeScale; GameCanvas = InGameHUD.Instance; if (pS == null) { pS = PoolingSystem.Instance; } Debug.Log(pS); }
private void Awake( ) { if (Instance == null) { Instance = this; } else { Destroy(gameObject); } WaveIndicatorGrid = GameObject.Find("Wave Indicators").GetComponent <HorizontalLayoutGroup>( ); UpdateGoldText( ); PauseText.SetActive(false); GameManager.OnCastleHit.AddListener(UpdateCastleHealth); GameManager.OnWaveStarted.AddListener(SpawnWaveIndicator); }
public void SetInstance() { inst = this; }
private void Awake() { instance = this; }
void Awake() { instance = this; }
private new void RefreshDynamicContent() { Container containerComponent = this.Target.GetComponent <Container>(); this.RefreshBackgroundColor(); if (this.m_Health != null) { this.HealthLabel.alpha = (!this.TargetIsParty && this.m_Health.Uninjured) ? 0f : 1f; if (this.HealthLabel.gameObject.activeInHierarchy) { if (this.TargetIsParty) { s_stringBuilder.Append(GUIUtils.GetText(1498, CharacterStats.GetGender(this.SelectedCharacter))); s_stringBuilder.Append(": "); s_stringBuilder.Append(InGameHUD.GetHealthColorString(this.m_Health.CurrentStamina, this.m_Health.MaxStamina)); s_stringBuilder.Append(this.m_Health.CurrentStaminaString()); s_stringBuilder.Append("[-]/"); s_stringBuilder.Append(Mathf.CeilToInt(this.m_Health.MaxStamina).ToString("#0")); if (this.ShowHealth) { s_stringBuilder.AppendLine(); s_stringBuilder.Append(GUIUtils.GetText(1469, CharacterStats.GetGender(this.SelectedCharacter))); s_stringBuilder.Append(": "); s_stringBuilder.Append(InGameHUD.GetHealthColorString(this.m_Health.CurrentHealth, this.m_Health.MaxHealth)); s_stringBuilder.Append(this.m_Health.CurrentHealthString()); s_stringBuilder.Append("[-]/"); s_stringBuilder.Append(Mathf.CeilToInt(this.m_Health.MaxHealth).ToString("#0")); } } else if (!this.m_Health.HealthVisible) { s_stringBuilder.Append("[888888]"); s_stringBuilder.Append(GUIUtils.GetText(1980)); s_stringBuilder.Append("[-]"); } else { s_stringBuilder.Append(InGameHUD.GetHealthString(this.m_Health.CurrentStamina, this.m_Health.BaseMaxStamina, CharacterStats.GetGender(this.SelectedCharacter))); s_stringBuilder.Append("[-]"); } // injection point if (add_InjectActionInfo()) { this.HealthLabel.alpha = 1f; } this.HealthLabel.text = s_stringBuilder.ToString(); s_stringBuilder.Remove(0, s_stringBuilder.Length); } } else if (containerComponent == null || !containerComponent.IsEmpty) { this.HealthLabel.text = string.Empty; this.HealthLabel.alpha = 0f; } else { this.HealthLabel.alpha = 1f; s_stringBuilder.Append("[888888]"); s_stringBuilder.Append(GUIUtils.GetText(262)); s_stringBuilder.Append("[-]"); this.HealthLabel.text = s_stringBuilder.ToString(); s_stringBuilder.Remove(0, s_stringBuilder.Length); } if (this.DtParent) { this.DtParent.SetActive(this.ShowDefenses); } if (this.DefenseParent) { this.DefenseParent.SetActive(this.ShowDefenses); } if (this.ImmunitiesParent) { this.ImmunitiesParent.ExternalActivation = this.ShowDefenses; } if (this.ResistancesParent) { this.ResistancesParent.ExternalActivation = this.ShowDefenses; } if (this.SubTop) { this.SubTop.widgetContainer = (!this.RaceLabel || string.IsNullOrEmpty(this.RaceLabel.text) ? this.NameLabel : this.RaceLabel); } this.Divider.alpha = (this.HealthLabel.alpha > 0f || this.ShowDefenses) ? 1f : 0f; if (this.Table) { this.Table.Reposition(); add_FixUpTableDrift(); } this.Panel.Refresh(); }
private void Awake() { thirdPersonMovement = GetComponentInParent <ThirdPersonMovement>(); inGameHUD = FindObjectOfType <InGameHUD>(); }
void Awake() { Instance = this; }
public void SetupPlayer() { InGameHUD.Show(Player); Player.SetSittingNode(_boardManager.CurrentBoard.StartCellCoord, Side.Top); }