Пример #1
0
    void Awake()
    {
        EventManager.Add2(EventEnum.TEST1, OnTestHandler);
        GameObject gameUITxt = GameObject.Find("GameUI/Txt_PlayerHp");

        Debug.Log(gameUITxt);
        Txt_PlayerHp      = gameUITxt.GetComponent <Text>();
        Txt_PlayerHp.text = "HP:" + MaxHP;
    }
Пример #2
0
    void Awake()
    {
        Debug.Log("Awake");
        EventManager.Add2(EventEnum.GameOver, OnGameOver);
        EventManager.Add2(EventEnum.RemoveEnemyGroup, OnGameOver);
        EventManager.Add2(EventEnum.TEST1, OnTestHandler);
        GameOverSp = GameObject.Find("GameOverSp");
        GameOverSp.SetActive(false);

        BtnObj = GameOverSp.GetComponentInChildren <Button>();
        Debug.Log(BtnObj);
        BtnObj.onClick.AddListener(OnClick);
    }