Beispiel #1
0
        // Use this for initialization
        void Start()
        {
            _receivedPayload = GameObject.FindGameObjectWithTag("DreamPayload").GetComponent <DreamPayload>();
            if (_receivedPayload == null)
            {
                return;
            }

            if (!_receivedPayload.DreamEnded)
            {
                return;
            }

            MainMenu.ChangeMenuState(UIMainMenu.MenuState.GRAPH);

            DreamDirector.AddPayloadToPriorDreams(_receivedPayload);

            DreamDirector.CurrentDay++;

            SaveGameManager.SaveCurrentGame();

            // TODO: save game data to file

            // TODO: load from save file and populate graph

            _receivedPayload.ClearPayload();

            Fader.FadeOut(0.5F);
        }
Beispiel #2
0
        public static void BeginDream(string level)
        {
            if (CurrentlyInDream)
            {
                return;
            }

            CurrentlyInDream = true;

            RandUtil.RefreshSeed();

            StaticityAccumulator = 0;
            HappinessAccumulator = 0;

            string levelToLoad = level;

            RefreshTextureSet(true);

            // populate payload with textureset info and level to load
            Payload                    = GameObject.FindGameObjectWithTag("DreamPayload").GetComponent <DreamPayload>();
            Payload.DreamSeed          = RandUtil.CurrentSeed;
            Payload.InitialLevelToLoad = levelToLoad;

            ResourceManager.ClearLifespan(ResourceLifespan.MENU);

            // load dream scene
            Fader.FadeIn(Color.black, 1.5F, () => { SceneManager.LoadScene("dream"); });
        }
Beispiel #3
0
 /// <summary>
 /// Used to remember prior dreams. Converts payload values to Dream struct and adds to list.
 /// </summary>
 public static void AddPayloadToPriorDreams(DreamPayload p)
 {
     //Types.Dream d;
     //d.LevelsVisited = p.LevelsVisited.ToArray();
     //d.TimeInDream = p.TimeInDream;
     //d.Seed = p.DreamSeed;
     //PriorDreams.Add(d);
 }
Beispiel #4
0
        // Use this for initialization
        void Start()
        {
            _receivedPayload = GameObject.FindGameObjectWithTag("DreamPayload").GetComponent <DreamPayload>();

            DreamDirector.Player = GameObject.FindGameObjectWithTag("Player");

            if (_receivedPayload == null)
            {
                Debug.LogError("Could not find dream payload! Did you come from the title screen?");
                return;
            }

            DreamDirector.SwitchDreamLevel(_receivedPayload.InitialLevelToLoad);

            GameSettings.SetCursorViewState(false);

            GameSettings.CanControlPlayer = true;

            Fader.FadeOut(1F);
        }