Ejemplo n.º 1
0
    private void bufferSwitch(string roomDir, string heroDir)
    {
        // Move Player Icon First
        if (mm != null)
        {
            // Swap Method
            mm.moveMMCasper(heroDir);

            // Base Case
            if (fromRoom.gameObject.name == "Swap_1")
            {
                nextRoom = GameObject.Find("Swap_2");
            }
            if (fromRoom.gameObject.name == "Swap_2")
            {
                nextRoom = GameObject.Find("Swap_1");
            }

            //Player Icon ON Entry Room
            if (mm.casperIcon.position == mm.allRooms[0].transform.position)
            {
                nextRoom = GameObject.Find("Welcome");
            }

            // Player Icon On Boss Icon
            float dist = Vector2.Distance(mm.casperIcon.position, mm.bossIcon.position);
            if (dist <= 1f)
            {
                nextRoom = GameObject.Find("Boss Pool");
            }
        }

        // Re-locate real player location
        RoomSwap(nextRoom, roomDir);
        fromRoom.LockAll();
    }