Exemplo n.º 1
0
 public void Associate(DoorNode otherDoor)
 {
     associateDoor           = otherDoor;
     otherDoor.associateDoor = this;
     if (otherDoor.grid.owner.roomType == RoomType.Boss)
     {
         doorType = DoorType.Boss;
     }
 }
Exemplo n.º 2
0
        void LoadDoor(DoorNode door, Transform parent)
        {
            if (door.associateDoor == null)
            {
                return;
            }
            switch (door.doorType)
            {
            case DoorType.None:
                break;

            default:
                GameObject go = RogueLike.ResLoader.LoadGameObject(RogueLike.Data.doorRes[door.doorType]);
                door.transform = go.transform;
                go.transform.SetParent(parent);
                go.transform.position = door.position;
                go.name = "door";
                go.AddComponent <DoorInspector>().doorData = door;
                break;
            }
        }
        bool CanAssociate(Grid grid1, DoorNode door1, Grid grid2, DoorNode door2)
        {
            if (door1.doorType == DoorType.None || door2.doorType == DoorType.None)
            {
                return(false);
            }

            if (grid1.owner == grid2.owner)
            {
                return(false);
            }

            if (grid1.owner == null || grid2.owner == null)
            {
                return(false);
            }

            if (door1.associateDoor != null || door2.associateDoor != null)
            {
                return(false);
            }

            return(true);
        }