public static Actor LoadFromTemplate(string template) { Actor actor = new Actor(); string binPath = System.Environment.CurrentDirectory; string filePath = string.Format("{0}\\..\\..\\Asset\\ActorTemplate\\{1}.{2}", binPath, template, "xml"); ActorData data = ConfigParser.ParserScript(filePath); ScriptData scriptData = new ScriptData(); scriptData.m_ScriptClass = "Script_PlayerSelf"; scriptData.m_ScriptLib = "UserDef.dll"; ActorData actorData = new ActorData(); actorData.Name = "PlayerSelf"; actorData.TemplateName = "PlayerSelf"; actorData.AddScriptData(scriptData); actor.Load(actorData); ActorManager.Instance.AddActor(actor); return(null); }
public static Actor LoadFromTemplate(string template) { Actor actor = new Actor(); string binPath = System.Environment.CurrentDirectory; string filePath = string.Format("{0}\\..\\..\\Asset\\ActorTemplate\\{1}.{2}", binPath, template, "xml"); ActorData data = ConfigParser.ParserScript(filePath); ScriptData scriptData = new ScriptData(); scriptData.m_ScriptClass = "Script_PlayerSelf"; scriptData.m_ScriptLib = "UserDef.dll"; ActorData actorData = new ActorData(); actorData.Name = "PlayerSelf"; actorData.TemplateName = "PlayerSelf"; actorData.AddScriptData(scriptData); actor.Load(actorData); ActorManager.Instance.AddActor(actor); return null; }