public void ObjectRemove(S.ObjectRemove p) { if (ObjectList.TryGetValue(p.ObjectID, out MapObject ob)) { if (ob is ItemObject) { ObjectList.Remove(p.ObjectID); Destroy(ob.gameObject); } else if (ob is MonsterObject monster) { switch (monster.Class) { case MonsterClass.Boss: GameScene.BossUi.SetActive(false); ob.gameObject.SetActive(false); CurrentScene.Cells[ob.CurrentLocation.x, ob.CurrentLocation.y].RemoveObject(ob); return; } } else { ob.gameObject.SetActive(false); } CurrentScene.Cells[ob.CurrentLocation.x, ob.CurrentLocation.y].RemoveObject(ob); } }
public void ObjectRemove(S.ObjectRemove p) { if (ObjectList.TryGetValue(p.ObjectID, out MapObject ob)) { if (ob is ItemObject) { ObjectList.Remove(p.ObjectID); Destroy(ob.gameObject); } else { ob.gameObject.SetActive(false); } CurrentScene.Cells[(int)ob.CurrentLocation.x, (int)ob.CurrentLocation.y].RemoveObject(ob); } }
private void ObjectRemove(S.ObjectRemove p) { if (p.ObjectID == User.ObjectID) { return; } for (int i = MapControl.Objects.Count - 1; i >= 0; i--) { MapObject ob = MapControl.Objects[i]; if (ob.ObjectID != p.ObjectID) { continue; } ob.Remove(); } }
public static void ObjectRemove(S.ObjectRemove p) { gameManager.ObjectRemove(p); }