public bool Contains(CellObjects o) { foreach (ILogicObject l in LogicObjects) { if (l.ObjectType == o) { return(true); } } return(false); }
public static string GetLocalizedName(this CellObjects src, Strings str) { string name = "Object." + Enum.GetName(typeof(CellObjects), src); if (str.HasString(name)) { return(str[name]); } else { Debug.LogError("No name for object " + name); return(name); } }
public void RemoveObjects(CellObjects param_objects) { if ((param_objects & CellObjects.FLOOR) == CellObjects.FLOOR && field_floor != null) { Destroy(field_floor); field_floor = null; } if ((param_objects & CellObjects.WALL) == CellObjects.WALL && field_wall != null) { field_wall.GetComponent<Wall>().Dissolve(delegate { Destroy(field_wall); }); field_wall = null; } if ((param_objects & CellObjects.ENEMY) == CellObjects.ENEMY && field_enemy != null) { Destroy(field_enemy); field_enemy = null; } }
public void RemoveObjects(CellObjects param_objects) { if ((param_objects & CellObjects.FLOOR) == CellObjects.FLOOR && field_floor != null) { Destroy(field_floor); field_floor = null; } if ((param_objects & CellObjects.WALL) == CellObjects.WALL && field_wall != null) { field_wall.GetComponent <Wall>().Dissolve(delegate { Destroy(field_wall); }); field_wall = null; } if ((param_objects & CellObjects.ENEMY) == CellObjects.ENEMY && field_enemy != null) { Destroy(field_enemy); field_enemy = null; } }
public void AddObjects(CellObjects param_objects) { if ((param_objects & CellObjects.FLOOR) == CellObjects.FLOOR && field_floor == null) { field_floor = Instantiate(PrefabFloor, PrefabFloor.transform.position + transform.position, Quaternion.identity) as GameObject; field_floor.transform.parent = transform; } if ((param_objects & CellObjects.WALL) == CellObjects.WALL && field_wall == null && field_enemy == null) { field_wall = Instantiate(PrefabWall, PrefabWall.transform.position + transform.position, Quaternion.identity) as GameObject; field_wall.transform.parent = transform; field_wall.GetComponent<Wall>().Appear(delegate { }); } if ((param_objects & CellObjects.ENEMY) == CellObjects.ENEMY && field_enemy == null && field_wall == null) { field_enemy = Instantiate(PrefabEnemy, PrefabEnemy.transform.position + transform.position, Quaternion.identity) as GameObject; field_enemy.transform.parent = transform; } }
public void AddObjects(CellObjects param_objects) { if ((param_objects & CellObjects.FLOOR) == CellObjects.FLOOR && field_floor == null) { field_floor = Instantiate(PrefabFloor, PrefabFloor.transform.position + transform.position, Quaternion.identity) as GameObject; field_floor.transform.parent = transform; } if ((param_objects & CellObjects.WALL) == CellObjects.WALL && field_wall == null && field_enemy == null) { field_wall = Instantiate(PrefabWall, PrefabWall.transform.position + transform.position, Quaternion.identity) as GameObject; field_wall.transform.parent = transform; field_wall.GetComponent <Wall>().Appear(delegate { }); } if ((param_objects & CellObjects.ENEMY) == CellObjects.ENEMY && field_enemy == null && field_wall == null) { field_enemy = Instantiate(PrefabEnemy, PrefabEnemy.transform.position + transform.position, Quaternion.identity) as GameObject; field_enemy.transform.parent = transform; } }
public CellObjects GetObjects() { CellObjects cellObjects = CellObjects.NONE; if (field_floor != null) { cellObjects ^= CellObjects.FLOOR; } if (field_wall != null) { cellObjects ^= CellObjects.WALL; } if (field_enemy != null) { cellObjects ^= CellObjects.ENEMY; } return(cellObjects); }
public RoomWithout(RoomType room, CellObjects type, int a) : base(a) { Room = room; ObjectType = type; }
public ILogicObject(CellObjects objectType, MapRect objectRect, int cost) { ObjectType = objectType; ObjectRect = objectRect; Cost = cost; }