Beispiel #1
0
        private void Start()
        {
            playerMonoBehaviour = playerMonoBehaviour ?? GameObject.FindObjectOfType <PlayerMonoBehaviour>();
            obstacleManager     = GetComponent <ObstacleManager>();
            // TODO
            Vector3 destinationPosition = FindDestinationPoint();

            directionTransform = uiDirection.transform as RectTransform;

            var directionArrowUi = new UiDirectionArrow(
                directionTransform,
                destinationObj.transform,
                playerMonoBehaviour.PlayerModel,
                Screen.width,
                Screen.height / 5);
            var textUiManager = new UiTextManager(playerMonoBehaviour.PlayerModel, uiTimeText, uiHappinessText);

            uiManager     = new UiManager(textUiManager, directionArrowUi);
            ScreenManager = new ScreenManager(screens);

            saver       = new BinarySaver();
            SavedScores = saver.Load <Scores>() ?? new Scores();

            FillStates();
            SetGameState(gameStateType);

            //TODO: Assert game states - to have all value implemented
            Debug.Log("End of Start method");
        }
        private void Awake()
        {
            if (_instance == null)
            {
                _instance = this;
            }
            else if (_instance != this)
            {
                Destroy(gameObject);
            }

            DontDestroyOnLoad(gameObject);
        }