public void LoadChapterDef(int id) { if (ChapterDef != null && Event.gameObject != null) { GameObject.DestroyImmediate(Event.gameObject); } ChapterDef = ResourceManager.GetChapterDef(id); ChapterDef.Event = GameObject.Instantiate(ChapterDef.Event); ChapterId = id; }
public void NewGameData(int slot) { Clear(); ChapterRecordCollection collect = new ChapterRecordCollection(); collect.Slot = slot; ChapterDef = ResourceManager.GetChapterDef(0); SaveChapterData(slot); LoadChapterData(slot); }
public static ChapterSettingDef GetChapterDef(int ChapterIndex) { ChapterSettingDef def = Resources.Load <ChapterSettingDef>(Path.Combine(ASSET_CHAPTERSETTING, ChapterIndex.ToString())); ChapterSettingDef r = GameObject.Instantiate <ChapterSettingDef>(def); if (r.Event == null) { Debug.LogError("你需要在ChapterDef" + r.CommonProperty.ID + "中指定Event"); } r.Event.SetChapterDef(r); return(r); }
public void OnEnable() { chapter = target as ChapterSettingDef; forceInvolveCount = chapter.ForceInvolve.Count; weaponRoomCount = chapter.WeaponRoom.Count; propRoomCount = chapter.PropRoom.Count; if (chapter.BGMSetting.Count != bgmType.Length) { chapter.BGMSetting.Clear(); chapter.BGMSetting.AddRange(new int[bgmType.Length]); } }
public static ChapterSettingDef CreateWeapon() { int count = ScriptableObjectUtility.GetFoldFileCount(DIRECTORY_PATH); ChapterSettingDef chap = ScriptableObjectUtility.CreateAsset <ChapterSettingDef>( count.ToString(), DIRECTORY_PATH, true ); chap.CommonProperty.ID = count; return(chap); }
/// <summary> /// 载入事件数据,加载我方和敌方数据,并加载单位到战场上。 /// </summary> /// <param name="slot"></param> public void LoadBattleData(int slot) { Clear(); BattleInfoCollection data = record.LoadBattleFromDisk(slot); //Debug.Log(collect.Event.TurnEvent[0].SequenceName); ChapterDef = ResourceManager.GetChapterDef(data.CurrentTeam.Chapter); gameMode.LoadTileMap(data.MapID); players.PlayersLogic.Clear(); foreach (var v in data.CurrentTeamPlayerInfo) { RPGPlayer p = RPGPlayer.Create(v); players.PlayersLogic.Add(p.Logic); gameMode.BattlePlayer.AddUnitToMap(p, v.tileCoords); } }
public static string GetChapterName(int ChapterIndex) { ChapterSettingDef def = GetChapterDef(ChapterIndex); return(def.CommonProperty.Name); }
public void SetChapterDef(ChapterSettingDef def) { chapterDef = def; }