Esempio n. 1
0
    public void OnSceneLoad()
    {
        bool isFirstLoad = !runtime.save.firstLoadHappened;

        if (isFirstLoad)
        {
            runtime.save.Initialize();

            List <Item>      allStartingItems  = gameCheckpoints.SelectMany(x => x.items).Union(startingItems).ToList();
            List <GameState> allStartingStates = gameCheckpoints.SelectMany(x => x.states).Union(startingGameStates).ToList();

            foreach (Item i in allStartingItems)
            {
                GlobalController.AddItem(new StoredItem(i), quiet: true);
            }
            GlobalController.AddStates(allStartingStates);
            runtime.save.firstLoadHappened = true;
        }
        runtime.loadedOnce = true;
    }