void Start() { Instance = this; // 加载配置文件 XmlDocument config = new XmlDocument(); if (File.Exists("config.xml")) { // 发布环境 config.Load("config.xml"); } else { // 开发环境 config.Load(@"E:\proj\ProjectS\ProjectS\tools\SpineAttachEditor\config.xml"); } XmlNode docNode = (XmlNode)config.DocumentElement; if (Application.isEditor) { virtualWorkDir = docNode.SelectSingleNode("WorkingDir").InnerText; } else { virtualWorkDir = Directory.GetCurrentDirectory(); } SpineFolder = docNode.SelectSingleNode("SpineFolder").InnerText; HeroExcel = docNode.SelectSingleNode("HeroExcel").InnerText; JsonConvertor = docNode.SelectSingleNode("JsonConvertor").InnerText; HeroJson = docNode.SelectSingleNode("HeroJson").InnerText; HeroJsonInClient = docNode.SelectSingleNode("HeroJsonInClient").InnerText; DefaultAnim = docNode.SelectSingleNode("DefaultAnim").InnerText; ResWidth = int.Parse(docNode.SelectSingleNode("ResWidth").InnerText); ResHeight = int.Parse(docNode.SelectSingleNode("ResHeight").InnerText); DebugMode = bool.Parse(docNode.SelectSingleNode("DebugMode").InnerText); // NOTE 禁用了分辨率配置窗口,可在配置文件中修改 Screen.SetResolution(ResWidth, ResHeight, false); SpineRoot = GameObject.Find("SpineRoot").transform; PanelOpenSpine = GameObject.Find("PanelOpenSpine").GetComponent <PanelOpenSpine>(); PanelEditAttach = GameObject.Find("PanelEditAttach").GetComponent <PanelEditAttach>(); SceneMode = EScreenMode.OpenSpine; PanelEditAttach.Initlaize(); PanelOpenSpine.gameObject.SetActive(true); PanelEditAttach.gameObject.SetActive(false); }
void Start () { Instance = this; // 加载配置文件 XmlDocument config = new XmlDocument(); if(File.Exists("config.xml")) // 发布环境 config.Load("config.xml"); else // 开发环境 config.Load(@"E:\proj\ProjectS\ProjectS\tools\SpineAttachEditor\config.xml"); XmlNode docNode = (XmlNode)config.DocumentElement; if (Application.isEditor) virtualWorkDir = docNode.SelectSingleNode("WorkingDir").InnerText; else virtualWorkDir = Directory.GetCurrentDirectory(); SpineFolder = docNode.SelectSingleNode("SpineFolder").InnerText; HeroExcel = docNode.SelectSingleNode("HeroExcel").InnerText; JsonConvertor = docNode.SelectSingleNode("JsonConvertor").InnerText; HeroJson = docNode.SelectSingleNode("HeroJson").InnerText; HeroJsonInClient = docNode.SelectSingleNode("HeroJsonInClient").InnerText; DefaultAnim = docNode.SelectSingleNode("DefaultAnim").InnerText; ResWidth = int.Parse(docNode.SelectSingleNode("ResWidth").InnerText); ResHeight = int.Parse(docNode.SelectSingleNode("ResHeight").InnerText); DebugMode = bool.Parse(docNode.SelectSingleNode("DebugMode").InnerText); // NOTE 禁用了分辨率配置窗口,可在配置文件中修改 Screen.SetResolution(ResWidth, ResHeight, false); SpineRoot = GameObject.Find("SpineRoot").transform; PanelOpenSpine = GameObject.Find("PanelOpenSpine").GetComponent<PanelOpenSpine>(); PanelEditAttach = GameObject.Find("PanelEditAttach").GetComponent<PanelEditAttach>(); SceneMode = EScreenMode.OpenSpine; PanelEditAttach.Initlaize(); PanelOpenSpine.gameObject.SetActive(true); PanelEditAttach.gameObject.SetActive(false); }
void Start () { Instance = this; LoadedSpines = new Dictionary<string, SkeletonAnimation>(); // 加载配置文件 XmlDocument config = new XmlDocument(); if(File.Exists("config.xml")) // 发布环境 config.Load("config.xml"); else // 开发环境 config.Load(@"E:\proj\ProjectS\ProjectS\tools\SpineAttachEditor\config.xml"); XmlNode docNode = (XmlNode)config.DocumentElement; if (Application.isEditor) virtualWorkDir = docNode.SelectSingleNode("WorkingDir").InnerText; else virtualWorkDir = Directory.GetCurrentDirectory(); SpineFolder = docNode.SelectSingleNode("SpineFolder").InnerText; HeroExcel = docNode.SelectSingleNode("HeroExcel").InnerText; JsonConvertor = docNode.SelectSingleNode("JsonConvertor").InnerText; HeroJson = docNode.SelectSingleNode("HeroJson").InnerText; HeroJsonInClient = docNode.SelectSingleNode("HeroJsonInClient").InnerText; DefaultAnim = docNode.SelectSingleNode("DefaultAnim").InnerText; ResWidth = int.Parse(docNode.SelectSingleNode("ResWidth").InnerText); ResHeight = int.Parse(docNode.SelectSingleNode("ResHeight").InnerText); DebugMode = bool.Parse(docNode.SelectSingleNode("DebugMode").InnerText); // NOTE 禁用了分辨率配置窗口,可在配置文件中修改 Screen.SetResolution(ResWidth, ResHeight, false); SpineRoot = GameObject.Find("SpineRoot").transform; LoadedRoot = GameObject.Find("LoadedRoot").transform; PanelOpenSpine = GameObject.Find("PanelOpenSpine").GetComponent<PanelOpenSpine>(); PanelEditAttach = GameObject.Find("PanelEditAttach").GetComponent<PanelEditAttach>(); LoadedRoot.gameObject.SetActive(false); SceneMode = EScreenMode.OpenSpine; PanelEditAttach.Initlaize(); PanelOpenSpine.gameObject.SetActive(false); PanelEditAttach.gameObject.SetActive(true); //Stopwatch watch = new Stopwatch(); //watch.Start(); //LoadSpine("spine001", @"E:\proj\ProjectS\ProjectS\client\trunk\projects\res\spine\spine001.zip"); //watch.Stop(); //Debug.Log("Spine 加载时间: " + watch.ElapsedMilliseconds.ToString()); // NeedLoadSpine = true; // SpineName = "spine001"; // SpineZipPath = @"E:\proj\ProjectS\ProjectS\client\trunk\projects\res\spine\spine001.zip"; // NeedPreloadSpine = true; // SpineDir = @"E:\proj\ProjectS\ProjectS\client\trunk\projects\res\spine\"; ThreadStart threadStart = new ThreadStart(testLoad); Thread thread = new Thread(threadStart); thread.Start(); }
void Start() { Instance = this; LoadedSpines = new Dictionary <string, SkeletonAnimation>(); // 加载配置文件 XmlDocument config = new XmlDocument(); if (File.Exists("config.xml")) { // 发布环境 config.Load("config.xml"); } else { // 开发环境 config.Load(@"E:\proj\ProjectS\ProjectS\tools\SpineAttachEditor\config.xml"); } XmlNode docNode = (XmlNode)config.DocumentElement; if (Application.isEditor) { virtualWorkDir = docNode.SelectSingleNode("WorkingDir").InnerText; } else { virtualWorkDir = Directory.GetCurrentDirectory(); } SpineFolder = docNode.SelectSingleNode("SpineFolder").InnerText; HeroExcel = docNode.SelectSingleNode("HeroExcel").InnerText; JsonConvertor = docNode.SelectSingleNode("JsonConvertor").InnerText; HeroJson = docNode.SelectSingleNode("HeroJson").InnerText; HeroJsonInClient = docNode.SelectSingleNode("HeroJsonInClient").InnerText; DefaultAnim = docNode.SelectSingleNode("DefaultAnim").InnerText; ResWidth = int.Parse(docNode.SelectSingleNode("ResWidth").InnerText); ResHeight = int.Parse(docNode.SelectSingleNode("ResHeight").InnerText); DebugMode = bool.Parse(docNode.SelectSingleNode("DebugMode").InnerText); // NOTE 禁用了分辨率配置窗口,可在配置文件中修改 Screen.SetResolution(ResWidth, ResHeight, false); SpineRoot = GameObject.Find("SpineRoot").transform; LoadedRoot = GameObject.Find("LoadedRoot").transform; PanelOpenSpine = GameObject.Find("PanelOpenSpine").GetComponent <PanelOpenSpine>(); PanelEditAttach = GameObject.Find("PanelEditAttach").GetComponent <PanelEditAttach>(); LoadedRoot.gameObject.SetActive(false); SceneMode = EScreenMode.OpenSpine; PanelEditAttach.Initlaize(); PanelOpenSpine.gameObject.SetActive(false); PanelEditAttach.gameObject.SetActive(true); //Stopwatch watch = new Stopwatch(); //watch.Start(); //LoadSpine("spine001", @"E:\proj\ProjectS\ProjectS\client\trunk\projects\res\spine\spine001.zip"); //watch.Stop(); //Debug.Log("Spine 加载时间: " + watch.ElapsedMilliseconds.ToString()); // NeedLoadSpine = true; // SpineName = "spine001"; // SpineZipPath = @"E:\proj\ProjectS\ProjectS\client\trunk\projects\res\spine\spine001.zip"; // NeedPreloadSpine = true; // SpineDir = @"E:\proj\ProjectS\ProjectS\client\trunk\projects\res\spine\"; ThreadStart threadStart = new ThreadStart(testLoad); Thread thread = new Thread(threadStart); thread.Start(); }