示例#1
0
    public bool Contains(CellObjects o)
    {
        foreach (ILogicObject l in LogicObjects)
        {
            if (l.ObjectType == o)
            {
                return(true);
            }
        }

        return(false);
    }
示例#2
0
    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);
        }
    }
示例#3
0
文件: Cell.cs 项目: Nomex13/Labyrinth
	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;
		}
	}
示例#4
0
文件: Cell.cs 项目: Nomex13/Labyrinth
 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;
     }
 }
示例#5
0
文件: Cell.cs 项目: Nomex13/Labyrinth
	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;
		}
	}
示例#6
0
文件: Cell.cs 项目: Nomex13/Labyrinth
 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;
     }
 }
示例#7
0
文件: Cell.cs 项目: Nomex13/Labyrinth
    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);
    }
示例#8
0
	public RoomWithout(RoomType room, CellObjects type, int a) : base(a) {
		Room = room;
		ObjectType = type;
	}
示例#9
0
	public ILogicObject(CellObjects objectType, MapRect objectRect, int cost)
	{
		ObjectType = objectType;
		ObjectRect = objectRect;
		Cost = cost;
	}
示例#10
0
 public ILogicObject(CellObjects objectType, MapRect objectRect, int cost)
 {
     ObjectType = objectType;
     ObjectRect = objectRect;
     Cost       = cost;
 }
示例#11
0
 public RoomWithout(RoomType room, CellObjects type, int a) : base(a)
 {
     Room       = room;
     ObjectType = type;
 }