Exemple #1
0
    // Load actorA saved game
    public void Load()
    {
        print("Loading...");
        StorageHandler sh = new StorageHandler();
        PlayerData     dp = (PlayerData)sh.LoadData("player") as PlayerData;

        _pd = dp;
        PlayerDataTracker pdt = PlayerDataTracker.GetInstance();

        pdt.Dt       = _pd;
        PlayerPrefab = Instantiate(PlayerPrefab, new Vector3(pdt.GetPlayerX(), pdt.GetPlayerY(), pdt.GetPlayerZ()), Quaternion.identity);

        PlayerPrefab.gameObject.name = "Player";
        this.gameObject.GetComponent <EnvironmentColours>().Player = PlayerPrefab;

        C.transform.position = new Vector3(pdt.GetPlayerX(), pdt.GetPlayerY() + 10, pdt.GetPlayerZ());
        C.transform.parent   = PlayerPrefab.transform;

        _dta                   = TempDataTracker.GetInstance();
        _settingsReader        = SettingsReader.GetInstance();
        _cam                   = GameObject.Find("Main Camera");
        _environmentController = EnvironmentController.GetInstance();
        _gm = GeneticsManager.GetInstance();
        _co = CollisionMediator.GetInstance();
        _am = AudioManager.GetInstance();
    }
Exemple #2
0
    void Awake()
    {
        _fadeScr = GameObject.FindObjectOfType <ScreenFader>();
        // Create actorA temporary reference to the current scene.
        Scene currentScene = SceneManager.GetActiveScene();

        _sceneName = currentScene.name;
        _sc        = GameObject.Find("UI Controller").GetComponent <GameStatusManager>();
        print("-------- " + _sc.GameStatus.ToString());

        _dta                   = TempDataTracker.GetInstance();
        _settingsReader        = SettingsReader.GetInstance();
        _cam                   = GameObject.Find("Main Camera");
        _environmentController = EnvironmentController.GetInstance();
        _gm = GeneticsManager.GetInstance();
        _co = CollisionMediator.GetInstance();
    }
    private void Start()
    {
        _food = (GameObject)Resources.Load("Prefabs/Foodbit");
        string name = this.name.ToLower();

        _settingsReader = SettingsReader.GetInstance();
        TempDataTracker.GetInstance();
        UiDepthHandler          = UIDepthHandler.GetInstance();
        SpawnerOrganiser        = SpawnerOrganiser.GetInstance();
        CreatureCounterObservor = CreatureCounterObservor.GetInstance();

        SetupVariables();

        Energy = TotalEnergy;

        Creatures = new ArrayList();
        Foods     = new ArrayList();
    }
Exemple #4
0
    private void Awake()
    {
        _fadeScr = GameObject.FindObjectOfType <ScreenFader>();
        // Create actorA temporary reference to the current scene.
        Scene currentScene = SceneManager.GetActiveScene();

        _sceneName = currentScene.name;
        _sc        = GameObject.Find("UI Controller").GetComponent <GameStatusManager>();
        print("-------- " + _sc.GameStatus.ToString());

        if (_sc.GameStatus == 4)
        {
            print("First start...");
            _dta                   = TempDataTracker.GetInstance();
            _settingsReader        = SettingsReader.GetInstance();
            _cam                   = GameObject.Find("Main Camera");
            _environmentController = EnvironmentController.GetInstance();
            _gm = GeneticsManager.GetInstance();
            _co = CollisionMediator.GetInstance();
            _am = AudioManager.GetInstance();
            PlayerDataTracker pdt = PlayerDataTracker.GetInstance();
            _pd = pdt.Dt;

            var s = _settingsReader.FoodWideSpreadY;
            _defaultN = s;

            PlayerPrefab = Instantiate(PlayerPrefab, new Vector3(0, s, 0), Quaternion.identity);
            PlayerPrefab.gameObject.name = "Player";

            pdt.SetEnergy(_settingsReader.PlayerStartEnergy);

            this.gameObject.GetComponent <EnvironmentColours>().Player = PlayerPrefab;
        }
        else if (_sc.GameStatus == 3)
        {
            Load();
        }

        C = Camera.main;
        C.transform.position = new Vector3(PlayerPrefab.transform.position.x, PlayerPrefab.transform.position.y + 10, PlayerPrefab.transform.position.z);
        C.transform.parent   = PlayerPrefab.transform;
    }
    private void Awake()
    {
        _fadeScr = GameObject.FindObjectOfType <ScreenFader>();

        // Create actorA temporary reference to the current scene.
        Scene currentScene = SceneManager.GetActiveScene();

        _sceneName = currentScene.name;

        _d = TempDataTracker.GetInstance();
        _settingsReader        = SettingsReader.GetInstance();
        _cam                   = GameObject.Find("Main Camera");
        _environmentController = EnvironmentController.GetInstance();
        _gm = GeneticsManager.GetInstance();
        _co = CollisionMediator.GetInstance();
        _am = AudioManager.GetInstance();

        C = Camera.main;
        C.transform.parent = PlayerPrefab.transform;
    }
Exemple #6
0
 private void Start()
 {
     TempDataTracker.GetInstance();
     EnvironmentController.GetInstance();
     CrtCounterObservor = CreatureCounterObservor.GetInstance();
 }