Beispiel #1
0
        private UIManager()
        {
            _gameController = GameObject.FindWithTag("GameController").GetComponent <GameController>();
            var characteristicsController = _gameController.Player.GetComponent <CharacteristicsController>();

            _canvas = GameObject.FindWithTag("UICanvas").GetComponent <UICanvas>();

            _canvas.EatButton.onClick.AddListener(characteristicsController.OnEatButtonClicked);
            _canvas.SleepButton.onClick.AddListener(characteristicsController.OnSleepButtonClicked);
            _canvas.WorkButton.onClick.AddListener(characteristicsController.OnWorkButtonClicked);
            _canvas.RelaxButton.onClick.AddListener(characteristicsController.OnRelaxButtonClicked);
            _canvas.CheckEmailButton.onClick.AddListener(characteristicsController.OnCheckEmailButtonClicked);

            var clock = _canvas.Clock;

            clock.UpdateTime(GameTime.ClockToString());
            GameTime.OnTimeChanged += clock.UpdateTime;
        }