protected override void Awake()
        {
            base.Awake();

            if (ColorScheme == null)
            {
                ColorScheme = (DataColorScheme)Resources.Load(ManagerCGridGame.I.CGridDataPath + "/" + DefaultNameColorScheme, typeof(ScriptableObject));
            }
            if (ColorScheme == null)
            {
                Debug.LogError("Set DataColorScheme", this);
            }

            if (DataCellsStates == null)
            {
                DataCellsStates = (DataCellStates)Resources.Load(ManagerCGridGame.I.CGridDataPath + "/" + DefaultNameCellStates, typeof(ScriptableObject));
            }
            if (DataCellsStates == null)
            {
                Debug.LogError("Set DataCellsStates", this);
            }

            if (CampaignData == null)
            {
                Debug.LogError("No CampaignData set", this);
                CampaignData = Resources.FindObjectsOfTypeAll <DataCampaign>().FirstOrDefault();
            }
            LevelData = CampaignData.LevelsData[CampaignData.CurrentLevel];
            //if (LevelData == null) {
            //    Debug.LogError("No DataLevel set. Creating new one", this);
            //    LevelData = DataLevel.CreateInstance<DataLevel>();
            //}
        }
Exemplo n.º 2
0
        //public override void VisualizeOpeningDetails() {
        //    base.VisualizeOpeningDetails();
        //}



        public void CreateItems(DataCampaign campaignData)
        {
            int number = 0;

            foreach (var levelData in campaignData.LevelsData)
            {
                CreateItem(number++, levelData);
            }
        }
Exemplo n.º 3
0
 public static void Show(DataCampaign campaignData)
 {
     Open();
     Instance.CreateItems(campaignData);
 }