private void Awake() { instance = this; Program = codeUIElement.Program; codeButton.onClick.AddListener(() => SetState(UIState.Code)); pauseButton.onClick.AddListener(() => SetState(UIState.Pause)); resumeButton.onClick.AddListener(() => SetState(UIState.Game)); closeCodeButton.onClick.AddListener(() => SetState(UIState.Game)); restartButton.onClick.AddListener(() => { Time.timeScale = 1; Restart(); }); exitButton.onClick.AddListener(() => { Time.timeScale = 1; ToStageSelection(); }); player = FindObjectOfType <PlayerCtrl>(); aimButton.onClick.AddListener(() => AimingButton.inst.CheckExprSlots()); grimoireImage = grimoire.GetComponent <Image>(); transparencySlider = FindObjectOfType <Slider>(); if (transparencySlider != null) { transparencySlider.onValueChanged.AddListener(ChangeCodeWindowTransparncy); } }
void Awake() { Inst = this; prefabDB = GetComponent <PrefabDB>(); program = codeUIElement.Program; }