/// <summary> /// 获取门 /// </summary> /// <param name="id"></param> /// <returns></returns> public DoorObject GetDoorObject(int id) { DoorObject o = null; if (DoorObjects.TryGetValue(id, out o)) { return(o); } return(o); }
/// <summary> /// 移除门 /// </summary> /// <param name="id"></param> public void RemoveDoorObject(int id) { DoorObject o = GetDoorObject(id); if (o != null) { o.CleanUp(); } DoorObjects.Remove(id); }
/// <summary> /// 创建门 /// </summary> /// <param name="data"></param> /// <returns></returns> public DoorObject CreateDoorObject(Neptune.Door data) { if (DoorObjects.ContainsKey(data.Id) == true) { GameDebug.LogError("Create collider object error, id " + data.Id + " has already exist!!!"); return(null); } DoorObject o = new DoorObject(data); if (o != null) { if (DoorObjects.ContainsKey(o.Id) == false) { DoorObjects.Add(o.Id, o); } else { GameDebug.LogError("Create collider object error, id " + o.Id + " has already exist!!!"); } } return(o); }