public StoryDefine GetStoryByID(int ID, StoryDefine def = default(StoryDefine)) { StoryDefine ret; if (_StoryByID.TryGetValue(ID, out ret)) { return(ret); } if (def == default(StoryDefine)) { TableLogger.ErrorLine("GetStoryByID failed, ID: {0}", ID); } return(def); }
// 添加action public void AddAction(table.StoryDefine kDefineStruct) { string str = kDefineStruct.ActionType; var actiontype = TabtoyConfigManager.GetConfig().GetActionByName(str); if (actiontype == null) { Debug.LogError("action " + str + "does not exist!!!"); return; } Type type = Type.GetType(actiontype.ScriptName, true, true); var temp = Activator.CreateInstance(type); ActionBase actionInstance = temp as ActionBase; actionInstance.Init(kDefineStruct); m_arrActionList.Add(actionInstance); }
public static void Deserialize(StoryDefine ins, tabtoy.DataReader reader) { int tag = -1; while (-1 != (tag = reader.ReadTag())) { switch (tag) { case 0x10000: { ins.ID = reader.ReadInt32(); } break; case 0x60001: { ins.Name = reader.ReadString(); } break; case 0x60002: { ins.ActionType = reader.ReadString(); } break; case 0x60003: { ins.Args1 = reader.ReadString(); } break; case 0x60004: { ins.Args2 = reader.ReadString(); } break; case 0x60005: { ins.Args3 = reader.ReadString(); } break; case 0x60006: { ins.Args4 = reader.ReadString(); } break; case 0x60007: { ins.Args5 = reader.ReadString(); } break; case 0x60008: { ins.Args6 = reader.ReadString(); } break; case 0x60009: { ins.Args7 = reader.ReadString(); } break; case 0x6000a: { ins.Args8 = reader.ReadString(); } break; case 0x7000b: { ins.InitOpen = reader.ReadBool(); } break; } } }
private int m_iMapID = 0; // 进入地图的ID // Use this for initialization public override void Init(table.StoryDefine kStruct) { m_iMapID = Convert.ToInt32(kStruct.Args1); }
// Use this for initialization public override void Init(table.StoryDefine kStruct) { }
public ActionState m_eState = ActionState.AS_Waiting; // 当前action的状态,处于等待/进行中/结束 // Use this for initialization public virtual void Init(table.StoryDefine kStruct) { }
private int m_roleid = 0; // 对话者的立绘ID,目前只有一个,未来支持立绘方案的形式 // Use this for initialization public override void Init(table.StoryDefine kStruct) { m_dialogcontent = kStruct.Args1; m_roleid = Convert.ToInt32(kStruct.Args2); }