Esempio n. 1
0
    void HandleRoomChange()
    {
        var roomCenter = TilemapHelper.GetRoomCenter(
            this.cameraFocus.transform.position,
            roomManager.dimensions);

        if (lastRoomCenter != roomCenter)
        {
            var roomDistance = RoomManager.RoomDistance(lastRoomCenter, roomCenter, roomManager.dimensions);

            float dur = roomDistance == 1 ? transitionDuration : 0f;

            this.transform.DOMove(roomCenter + offset, dur);
            letterboxTilemap.transform.DOMove(roomCenter, dur);
            lastRoomCenter = roomCenter;

            roomManager.RegisterChange(roomCenter);
        }
    }