コード例 #1
0
    public void SetWallTypeForDirection(DungeonRoomInfo.WallDirection direction, DungeonRoomInfo.WallType type)
    {
        Info.SetWallTypeForDirection(direction, type);

        // Now we update the wall's Material
        GameObject wall = GetWallForDirection(direction);

        wall.GetComponent <Renderer>().material = CommonObjects.CurrentDungeonFactory.GetWallMaterial(direction, type);
        wall.GetComponent <LightsOnOffMaterial>().OnMaterialChanged();
    }
コード例 #2
0
    public Material GetWallMaterial(DungeonRoomInfo.WallDirection direction, DungeonRoomInfo.WallType wallType)
    {
        bool     northSouthWall = DungeonRoomInfo.IsNorthOrSouth(direction);
        Material mat            = null;

        switch (wallType)
        {
        case DungeonRoomInfo.WallType.Closed:
            mat = northSouthWall ? wall : wall_EW;
            break;

        case DungeonRoomInfo.WallType.DoorOpen:
            mat = northSouthWall ? wallOpen : wallOpen_EW;
            break;

        case DungeonRoomInfo.WallType.DoorSealed:
            mat = northSouthWall ? wallSealed : wallSealed_EW;
            break;

        case DungeonRoomInfo.WallType.DoorLocked:
            mat = northSouthWall ? wallLocked : wallLocked_EW;
            break;

        case DungeonRoomInfo.WallType.Bombed:
            mat = northSouthWall ? wallBombed : wallBombed_EW;
            break;

        case DungeonRoomInfo.WallType.Top:
            mat = northSouthWall ? wallTop : wallTop_EW;
            break;

        default:
            break;
        }

        return(mat);
    }