Пример #1
0
    IEnumerator OnEnemyAppear()
    {
        if (zombunny)
        {
            CustomUtilities.SetPosRot(zombunny.gameObject, Vector3.zero, Vector3.zero);
            zombunny.gameObject.SetActive(true);
        }

        yield return(new WaitForSeconds(1));

        GameObject player = GameObject.FindWithTag("Player");

        if (player && zombunny)
        {
            zombunny.Target = player;
        }
        //zombunny.followTarget = true;

        if (zombunny)
        {
            yield return(StartCoroutine(CustomUtilities.MovLocRot(zombunny.gameObject, Vector3.zero, new Vector3(0, 90, 0), 0.5f)));
        }

        yield return(new WaitForSeconds(0.75f));

        StartCoroutine(OnZombunnyAppear());
    }
Пример #2
0
    IEnumerator OnEnemyRushOver()
    {
        // Wait until all enemies are dead.
        while (enemyNumber > 0)
        {
            yield return(null);
        }

        NotificationCentre.PostNotification(this, "OnBGMFadeOut");

        yield return(new WaitForSeconds(1));

        NotificationCentre.PostNotification(this, "OnMissionClear");
        MissionManager.UpdateMission("None.");

        yield return(new WaitForSeconds(1));

        NotificationCentre.PostNotification(this, "OnEventEnter");
        NotificationCentre.PostNotification(this, "OnEnemyRushOver");
        NotificationCentre.PostNotification(this, "OnFadeOut");
        PlayerPrefs.SetString(PlayerPrefsKeys.CHECKPOINT, "PuzzleSolving");

        yield return(new WaitForSeconds(1));

        // Move ZombunnyEvent next to the cannon.
        if (zombunny)
        {
            CustomUtilities.SetPosRot(zombunny.gameObject, new Vector3(4.3f, 13.7f, 28), new Vector3(0, 180, 0));
            zombunny.gameObject.SetActive(true);
            zombunny.followTarget = false;
        }
    }
Пример #3
0
    void Awake()
    {
        player = GameObject.FindWithTag("Player");
        cam    = GameObject.FindWithTag("MainCamera").GetComponent <CameraMovement> ();

        CustomUtilities.SetPosRot(cam.gameObject, new Vector3(0, 6, -47), new Vector3(20, 0, 0));

        CameraDefault();
    }
Пример #4
0
    IEnumerator OnZoomInCannon()
    {
        if (cam)
        {
            cam.SetCameraFollow(false);
            CustomUtilities.SetPosRot(cam.gameObject, new Vector3(0, 1, -3), Vector3.zero);
        }

        NotificationCentre.PostNotification(this, "OnFadeIn");
        NotificationCentre.PostNotification(this, "OnBGMFadeIn");

        yield return(new WaitForSeconds(3));

        // Final Pos (3,16,24) Rot (25,30,0)
        if (cam)
        {
            yield return(StartCoroutine(CustomUtilities.MovLocRot(cam.gameObject, new Vector3(3, 15, 27), new Vector3(25, 30, 0), 2)));
        }

        yield return(new WaitForSeconds(1));

        NotificationCentre.PostNotification(this, "OnZombunnyLaugh");

        yield return(new WaitForSeconds(0.5f));

        NotificationCentre.PostNotification(this, "OnIgniteCannon");

        yield return(new WaitForSeconds(0.5f));

        if (cam)
        {
            // Final Pos (3,16,24) Rot (35,45,0)
            yield return(StartCoroutine(CustomUtilities.MovLocRot(cam.gameObject, Vector3.zero, new Vector3(10, 15, 0), 0.7f)));

            // Final Pos (4.2,16.8,22) Rot (35,5,0)
            yield return(StartCoroutine(CustomUtilities.MovLocRot(cam.gameObject, new Vector3(1.2f, 0.8f, -2), new Vector3(0, -40, 0), 0.8f)));
        }

        NotificationCentre.PostNotification(this, "OnFadeOut");

        yield return(new WaitForSeconds(1));

        OnCameraNormalize();
        NotificationCentre.PostNotification(this, "OnEventExit");
        NotificationCentre.PostNotification(this, "OnEnemyRushOverExit");
        NotificationCentre.PostNotification(this, "OnNaturalSpawn");
        NotificationCentre.PostNotification(this, "OnFadeIn");
        MissionManager.UpdateMission("This  room  is  a  nightmare!  Find  the  way  out.");

        yield return(new WaitForSeconds(3));

        NotificationCentre.PostNotification(this, "ActivateCannon");
    }
Пример #5
0
    IEnumerator OnEnemyRushOver()
    {
        if (gun)
        {
            gun.EnableGun(false);
        }
        yield return(new WaitForSeconds(1));

        if (player)
        {
            CustomUtilities.SetPosRot(player, Vector3.zero, new Vector3(0, 180, 0));
        }

        NotificationCentre.PostNotification(this, "OnZoomInCannon");
    }
Пример #6
0
    IEnumerator OnEnemyAppear()
    {
        if (vfxcam)
        {
            splashEffect.SetActive(false);;
            vfxcam.SetActive(true);

            CustomUtilities.SetPosRot(vfxcam, new Vector3(22, 2, -2), new Vector3(20, -70, 0));

            NotificationCentre.PostNotification(this, "OnSFXSwift");

            yield return(new WaitForSeconds(0.5f));

            yield return(StartCoroutine(CustomUtilities.MovLocRot(vfxcam, new Vector3(-18.5f, 0, 0), Vector3.zero, 0.7f)));
        }
    }
Пример #7
0
    void OnUpdatePlayer()
    {
        player = GameObject.FindWithTag("Player");

        // Glide camera in.
        if (player && cam)
        {
            cam.SetCameraOffset(new Vector3(0, 5, -7));
            cam.SetCameraTarget(player);
            cam.SetCameraFollow(true);

            //OnCameraNormalize ();

            CustomUtilities.SetPosRot(cam.gameObject, player.transform.position + new Vector3(-2, 6, -6), new Vector3(40, 0, 0));
        }
    }
Пример #8
0
    IEnumerator OnZombearAppear()
    {
        if (zombunny)
        {
            zombunny.Resume();
        }

        GameObject player = GameObject.FindWithTag("Player");

        if (zombear & player)
        {
            zombear.gameObject.SetActive(true);
            zombear.Target = player;

            yield return(new WaitForSeconds(0.3f));

            CustomUtilities.SetPosRot(zombear.gameObject, new Vector3(5, 0, 7), Vector3.zero);
            yield return(StartCoroutine(CustomUtilities.MovLocRot(zombear.gameObject, Vector3.zero, new Vector3(0, -160, 0), 0.5f)));

            zombear.Pause();
        }

        yield return(null);
    }
Пример #9
0
    IEnumerator OnZombunnyAppear()
    {
        if (vfxcam)
        {
            CustomUtilities.SetPosRot(vfxcam, new Vector3(3.5f, 2, -2), new Vector3(20, -70, 0));
            yield return(StartCoroutine(CustomUtilities.MovLocRot(vfxcam, new Vector3(-1.5f, -1.5f, 2), new Vector3(-20, -20, 0), 0.5f)));

            //NotificationCentre.PostNotification (this, "OnSFXVFX1");
            NotificationCentre.PostNotification(this, "OnGooey1");

            if (splashEffect)
            {
                CustomUtilities.SetPosRotLocal(splashEffect, new Vector3(0.15f, 0.55f, 8), Vector3.zero);
                splashEffect.SetActive(true);
            }

            yield return(new WaitForSeconds(0.1f));

            NotificationCentre.PostNotification(this, "OnGooey1");

            if (splashEffect2)
            {
                CustomUtilities.SetPosRotLocal(splashEffect2, new Vector3(-8, -3.5f, 8), Vector3.zero);
                splashEffect2.SetActive(true);
            }

            yield return(new WaitForSeconds(0.1f));

            NotificationCentre.PostNotification(this, "OnGooey2");

            if (splashEffect3)
            {
                CustomUtilities.SetPosRotLocal(splashEffect3, new Vector3(-4, -2, 6), Vector3.zero);
                splashEffect3.SetActive(true);
            }

            if (textZombunny)
            {
                textZombunny.SetActive(true);
            }

            yield return(StartCoroutine(CustomUtilities.MovLocRot(vfxcam, new Vector3(0, 0.2f, -0.1f), Vector3.zero, 4)));

            if (splashEffect)
            {
                splashEffect.SetActive(false);
            }
            if (splashEffect2)
            {
                splashEffect2.SetActive(false);
            }
            if (splashEffect3)
            {
                splashEffect3.SetActive(false);
            }
            if (textZombunny)
            {
                textZombunny.SetActive(false);
            }

            StartCoroutine(OnZombearAppear());
        }
    }
Пример #10
0
    IEnumerator OnZombearAppear()
    {
        NotificationCentre.PostNotification(this, "OnZombearAppear");
        NotificationCentre.PostNotification(this, "OnMonsterCry");

        if (vfxcam)
        {
            CustomUtilities.SetPosRot(vfxcam, new Vector3(2, 0.5f, 0), new Vector3(0, -90, 0));
            yield return(StartCoroutine(CustomUtilities.MovLocRot(vfxcam, Vector3.zero, new Vector3(0, 90, 0), 0.3f)));
        }

        yield return(new WaitForSeconds(0.45f));

        //NotificationCentre.PostNotification (this, "OnSFXVFX2");

        if (vfxcam)
        {
            yield return(StartCoroutine(CustomUtilities.MovLocRot(vfxcam, new Vector3(3, 0.5f, 5), Vector3.zero, 0.2f)));
        }

        NotificationCentre.PostNotification(this, "OnGooey2");

        if (splashEffect)
        {
            CustomUtilities.SetPosRotLocal(splashEffect, new Vector3(6, 1.5f, 7), new Vector3(0, 0, 60));
            splashEffect.SetActive(true);
        }

        yield return(new WaitForSeconds(0.1f));

        NotificationCentre.PostNotification(this, "OnGooey1");

        if (splashEffect2)
        {
            CustomUtilities.SetPosRotLocal(splashEffect2, new Vector3(0, -3.5f, 8), new Vector3(0, 0, 90));
            splashEffect2.SetActive(true);
        }

        yield return(new WaitForSeconds(0.1f));

        NotificationCentre.PostNotification(this, "OnGooey1");

        if (splashEffect3)
        {
            CustomUtilities.SetPosRotLocal(splashEffect3, new Vector3(-1, 1, 4), new Vector3(0, 0, 180));
            splashEffect3.SetActive(true);
        }

        if (textZombear)
        {
            textZombear.SetActive(true);
        }

        if (vfxcam)
        {
            yield return(StartCoroutine(CustomUtilities.MovLocRot(vfxcam, Vector3.zero, new Vector3(-1, -5, 0), 4f)));
            //yield return StartCoroutine (CustomUtilities.MovLocRot (vfxcam, new Vector3(-0.2f,0.1f,0), Vector3.zero, 4f));
        }

        if (splashEffect)
        {
            splashEffect.SetActive(false);
        }
        if (splashEffect2)
        {
            splashEffect2.SetActive(false);
        }
        if (splashEffect3)
        {
            splashEffect3.SetActive(false);
        }
        if (textZombear)
        {
            textZombear.SetActive(false);
        }

        StartCoroutine(OnPanOut());
    }