Example #1
0
        private void Awake()
        {
            UnityEngine.Assertions.Assert.IsNotNull(Resources.Load <TextAsset>(GAME_DATA_PATH), "Can't find game data file at path : " + GAME_DATA_PATH);

            TextAsset data = Resources.Load <TextAsset>(GAME_DATA_PATH);
            JSON      json = JSON.CreateFromText(data.text);

            GameManager.instance.vegetableIdToConfig = FoodParser.ParseVegetables(json);
            GameManager.instance.incidentIdToConfig  = ChildrenParser.ParseIncidents(json);
            GameManager.instance.responseIdToConfig  = AdultParser.ParseResponses(json);
            GameManager.instance.levelIdToConfig     = LevelParser.ParseLevels(json);
            GameManager.instance.levelIds            = LevelParser.ComputeLevelIds(GameManager.instance.levelIdToConfig);

            GameManager.instance.TimerEnded += OnTimerEnded;

            GameManager.instance.SetReady(_settings);
        }