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");
        }
Exemple #2
0
 void Start()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(instance);
     }
 }