public static List <Vector2> ConvertVector2DList(string vec) { List <Vector2> list = new List <Vector2>(); try { string strPos = vec; string[] resut = strPos.Split(_split, StringSplitOptions.RemoveEmptyEntries); if (resut != null && resut.Length > 0 && resut[0] != "") { for (int index = 0; index < resut.Length;) { list.Add(new Vector2(Convert.ToSingle(resut[index]), Convert.ToSingle(resut[index + 1]))); index += 2; } } } catch (System.Exception ex) { list.Clear(); GameLog.Error("ConvertVector2DList {0} Exception:{1}/{2}", vec, ex.Message, ex.StackTrace); throw; } return(list); }
public static List <T> ConvertNumericList <T>(string vec) { List <T> list = new List <T>(); try { string strPos = vec; string[] resut = strPos.Split(_split, StringSplitOptions.RemoveEmptyEntries); if (resut != null && resut.Length > 0 && resut[0] != "") { for (int index = 0; index < resut.Length; index++) { list.Add((T)Convert.ChangeType(resut[index], typeof(T))); } } } catch (System.Exception ex) { list.Clear(); GameLog.Error("ConvertNumericList {0} Exception:{1}/{2}", vec, ex.Message, ex.StackTrace); throw; } return(list); }
// 加载场景UI public void LoadUI() { GameLog.Debug("LoadUI for Level {0}", _scenObj.sceneResName); }
// 增加npc public void AddNpcObj(NpcObj npc) { GameLog.Debug("AddNpcObj for Level {0}", _scenObj.sceneResName); }
// 增加UserOther public void AddUserOther(UserObj user) { GameLog.Debug("AddUserOther for Level {0}", _scenObj.sceneResName); }
// 加载地图阻挡信息 public void LoadMapInfo() { GameLog.Debug("LoadMapInfo for Level {0}", _scenObj.sceneResName); }
// 加载地图资源 public void LoadMapRes() { GameLog.Debug("load game scene({0})", _scenObj.sceneResName); SceneManager.LoadScene(_scenObj.sceneResName, LoadSceneMode.Additive); }