public void SetWarning(Unit unit) { if (unit.IsProtect()) return; bool enable = unit.IsEnable(); if (enable && !unit.IsProtect()) { unit.SetEnable(false); } foreach (Room other in this.level.GetRooms()) { if (!this.level.IsReachFromStart(other, true)) { this.SetUnitColor(other, FloorColor.Warning); } } foreach (Route other in this.level.GetRoutes()) { if (!this.level.IsReachFromStart(other, true)) { this.SetUnitColor(other, FloorColor.Warning); } } if (enable) { unit.SetEnable(true); } }