//Seperated as may want to order loading.
 //May want to be another class
 public void Load()
 {
     if (loadable.data == null)
     {
         loadable.Load();
     }
 }
Пример #2
0
    public void LoadData()
    {
        if (transData == null)
        {
            GameObject obj = GameObject.FindGameObjectWithTag("TransitionData");
            transData = obj.GetComponentInChildren <DataTransition>();
        }

        if (levelConfig == null)
        {
            levelConfig = SingletonJsonLoadable <ConfigurationLevelDataPair> .Instance;
        }

        levelConfig.Configure("LevelData/" + transData.nextLevelPath, "LevelData/" + transData.nextLevelPath);
        levelConfig.Load();

        startingMoment = levelConfig.data.startingMoment;
        startingMoment.BuildLevel(levelConfig.data.levelAsString);

        moments = new List <List <LevelMoment> >();

        List <LevelMoment> startingTimeline = new List <LevelMoment>
        {
            startingMoment.DeepCopyLevelMoment()
        };

        moments.Add(startingTimeline);
    }