Beispiel #1
0
    public void Flash(PlayerCharacter player, Color color, float time)
    {
        List <CharacterSlot> characterSlots = characterWindow.characterSlots;
        CharacterSlot        characterSlot  = characterSlots.First(x => x.playerCharacter == player);
        Flash flash = characterSlot.GetComponent <Flash>();

        flash.FlashStart(color, time);
    }
Beispiel #2
0
    public void Switch()
    {
        music.SwapMusic();

        last_change_time = Time.timeSinceLevelLoad;

        if (dimension == Dimension.Blue)
        {
            dimension = Dimension.Orange;

            GetComponent <AudioSource>().clip = future_to_past;
            GetComponent <AudioSource>().Play();
        }
        else
        {
            dimension = Dimension.Blue;

            GetComponent <AudioSource>().clip = past_to_future;
            GetComponent <AudioSource>().Play();
        }

        flash.FlashStart();

        foreach (Enemy enemy in enemies)
        {
            if (enemy.health > 0)
            {
                enemy.SwitchDimensions();
            }
            else
            {
                dead_enemies.Add(enemy);
            }
        }

        foreach (Bullet bullet in bullets)
        {
            if (bullet.gameObject.activeSelf)
            {
                bullet.SwitchDimensions();
            }
        }

        foreach (Wall wall in walls)
        {
            wall.SwitchDimensions();
        }

        Cleanup();
    }