예제 #1
0
    // Start is called before the first frame update
    void Awake()
    {
        //get the ui elements
        mana_bar_length   = mana_bar.rectTransform.sizeDelta.x;
        health_bar_length = hp_bar.rectTransform.sizeDelta.x;

        //get the player script
        player_script = GetComponentInParent <player_controller_script>();

        //instantly hide the ability description
        hideAbilityCard();


        //get the normal heights of all of the tints
        for (int i = 0; i < AbilityIcons.Length; i++)
        {
            normal_tint_heights[i] = AbilityIconTints[i].rectTransform.sizeDelta.y;
        }
        //set the leveling mode to fgalse
        leveling_mode = false;

        GiveGoldButton.onClick.AddListener(GiveGoldBtnClicked);
        LevelUpButton.onClick.AddListener(LevelUpBtnClicked);
        ResetButton.onClick.AddListener(ResetBtnClicked);
        RespawnButton.onClick.AddListener(RespawnBtnClicked);
        ToggleSpawners.onClick.AddListener(ToggleSpawnersBtnClicked);
        CanDieButton.onClick.AddListener(CanDieButtonClicked);
        AddLifeButton.onClick.AddListener(AddLifeBtnClicked);
        ExtraStatsToggleBtn.onClick.AddListener(ExtraStatsToggleBtnClicked);
        //toggle the extra stats
        ToggleExtraStats();
    }
예제 #2
0
 private GlobalManager()
 {
     player_controller = GameObject.Find("PlayerController").GetComponent <player_controller_script>();
     camera            = GameObject.FindObjectOfType <Camera>();
     //_game_manager = GameObject.Find("GameManager").GetComponent<game_manager>();
     canvas = GameObject.FindObjectOfType <Canvas>();
 }