Example #1
0
        public void BuildRoom()
        {
            // Game Objects
            this.objects = new Dictionary <byte, Dictionary <int, GameObject> > {
                [(byte)LoadOrder.Platform]     = new Dictionary <int, GameObject>(),
                [(byte)LoadOrder.Enemy]        = new Dictionary <int, GameObject>(),
                [(byte)LoadOrder.Item]         = new Dictionary <int, GameObject>(),
                [(byte)LoadOrder.TrailingItem] = new Dictionary <int, GameObject>(),
                [(byte)LoadOrder.Character]    = new Dictionary <int, GameObject>(),
                [(byte)LoadOrder.Projectile]   = new Dictionary <int, GameObject>()
            };

            // Object Coordination and Cleanup
            this.markedForAddition = new List <GameObject>();
            this.markedForRemoval  = new List <GameObject>();

            // Build Tilemap with Correct Dimensions
            short xCount, yCount;

            RoomGenerate.DetectRoomSize(Systems.handler.levelContent.data.rooms[roomID], out xCount, out yCount);

            this.tilemap = new TilemapLevel(xCount, yCount);

            // Additional Components
            this.colors      = new ColorToggles();
            this.trackSys    = new TrackSystem();
            this.roomExits   = new RoomExits();
            this.queueEvents = new QueueEvent(this);

            // Generate Room Content (Tiles, Objects)
            RoomGenerate.GenerateRoom(this, Systems.handler.levelContent, roomID);

            // Prepare the Full Track System
            this.trackSys.SetupTrackSystem();
        }
    int FindDirection(CreateDir dir)
    {
        switch (dir)
        {
        case CreateDir.North:

            break;

        case CreateDir.West:

            break;

        case CreateDir.South:

            break;

        case CreateDir.East:

            break;

        default:

            break;
        }

        roomProp = room.GetComponent <RoomGenerate>();
        int num = 0;

        return(num);
    }
    // Use this for initialization
    void Start()
    {
        //BuildingController.AddRoom(room);
        dir = CreateDir.North;
        //roomBox = gameObject.GetComponent<Collider>();
        roomProp   = room.GetComponent <RoomGenerate>();
        roomLength = roomProp.roomLength;
        roomWidth  = roomProp.roomWidth;

        if (gameObject.name == "WalkerAI_No")
        {
            dir        = CreateDir.North;
            direction  = new Vector3(0, 0, 0.1f);
            multiplier = -roomLength;
            xMod       = transform.parent.position.x;
            zMod       = transform.parent.position.z;
        }
        if (gameObject.name == "WalkerAI_So")
        {
            dir        = CreateDir.South;
            direction  = new Vector3(0, 0, -0.1f);
            xMod       = transform.parent.position.x;
            zMod       = transform.parent.position.z;
            multiplier = roomLength;
            yOffset    = true;
        }
        if (gameObject.name == "WalkerAI_We")
        {
            dir        = CreateDir.West;
            direction  = new Vector3(-0.1f, 0, 0);
            xMod       = transform.parent.position.x + -14;
            zMod       = transform.parent.position.z;
            multiplier = 1;
            xOffset    = true;
            //xMod = (-10 * roomWidth);
            //zMod = transform.root.position.z;
        }
        if (gameObject.name == "WalkerAI_Ea")
        {
            dir        = CreateDir.East;
            direction  = new Vector3(0.1f, 0, 0);
            xMod       = transform.parent.position.x;
            zMod       = transform.parent.position.z;
            multiplier = roomWidth;
            //xMod = -7 + (transform.root.position.x * 10);
            //zMod = transform.root.position.z;
        }
    }
Example #4
0
        public EditorRoomScene(EditorScene scene, byte roomID) : base()
        {
            // References
            this.scene        = scene;
            this.levelContent = this.scene.levelContent;
            this.roomID       = roomID;

            // Build Tilemap with Correct Dimensions
            short xCount, yCount;

            RoomGenerate.DetectRoomSize(this.levelContent.data.rooms[roomID], out xCount, out yCount);

            // Initialize Object Limiter Count
            this.scene.limiter.RunRoomCount(roomID, this.levelContent.data.rooms[roomID]);

            // Sizing
            this.xCount    = xCount;
            this.yCount    = yCount;
            this.mapWidth  = xCount * (byte)TilemapEnum.TileWidth;
            this.mapHeight = yCount * (byte)TilemapEnum.TileHeight;

            // Initial Setup
            EditorUI.currentSlotGroup = 1;
        }