示例#1
0
 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);
         }
     }
 }
示例#2
0
 // Start is called before the first frame update
 void Start()
 {
     if (InGameHUD.instance == null)
     {
         InGameHUD.instance = this;
     }
     StartCoroutine(Countdown());
 }
示例#3
0
 protected override void Start()
 {
     base.Start();
     controller          = gameObject.GetComponent <CharacterController>();
     currentState        = PlayerState.Neutral;
     gm                  = FindObjectOfType <GameManager>();
     _isForcedInvincible = _isInvincible;
     inGameHUD           = FindObjectOfType <InGameHUD>();
 }
示例#4
0
        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));
            }
        }
示例#5
0
 private void Awake()
 {
     if (!instance)
     {
         instance = this;
     }
     else
     {
         Destroy(this.gameObject);
     }
 }
示例#6
0
    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>();
    }
示例#7
0
    void Start()
    {
        Time.timeScale = timeScale;

        GameCanvas = InGameHUD.Instance;

        if (pS == null)
        {
            pS = PoolingSystem.Instance;
        }

        Debug.Log(pS);
    }
示例#8
0
    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);
    }
示例#9
0
 public void SetInstance()
 {
     inst = this;
 }
示例#10
0
 private void Awake()
 {
     instance = this;
 }
示例#11
0
 void Awake()
 {
     instance = this;
 }
示例#12
0
        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();
        }
示例#13
0
 private void Awake()
 {
     thirdPersonMovement = GetComponentInParent <ThirdPersonMovement>();
     inGameHUD           = FindObjectOfType <InGameHUD>();
 }
示例#14
0
 void Awake()
 {
     Instance = this;
 }
示例#15
0
 public void SetupPlayer()
 {
     InGameHUD.Show(Player);
     Player.SetSittingNode(_boardManager.CurrentBoard.StartCellCoord, Side.Top);
 }