protected virtual void Callback_UnitRemoved(GameLogic.Map map, GameLogic.Unit unit) { if (unit == Target) { Destroy(gameObject); } }
private void Callback_UnitRemoved(GameLogic.Map map, GameLogic.Unit unit) { if (idToContent.ContainsKey(unit.ID)) { Callback_RemoveSleeper(Target.SleepingUnitsByID, unit.ID); } }
/// <summary> /// Creates the correct window for editing the given unit. /// Returns the window's GameObject. /// </summary> public GameObject CreateUnitWindow(GameLogic.Unit unit) { switch (unit.MyType) { case GameLogic.Unit.Types.PlayerChar: return(CreateWindow(Window_PlayerChar, (GameLogic.Units.PlayerChar)unit).gameObject); case GameLogic.Unit.Types.Bed: return(CreateWindow(Window_Bed, (GameLogic.Units.Bed)unit).gameObject); default: throw new NotImplementedException(unit.MyType.ToString()); } }
protected virtual void Callback_UnitMoved(GameLogic.Unit u, Vector2i oldPos, Vector2i newPos) { UnityEngine.Assertions.Assert.IsTrue(u == Target); MyTr.position = new Vector3(newPos.x + 0.5f, newPos.y + 0.5f, MyTr.position.z); }