Exemple #1
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        SceneMasterScript         sceneMaster     = GameObject.FindObjectOfType <SceneMasterScript>();
        GameManagerScript         gameManager     = GameObject.FindObjectOfType <GameManagerScript>();
        TornadoRunSoundController soundController = GameObject.FindObjectOfType <TornadoRunSoundController>();

        sceneMaster.SetConditionsState(true);
        gameManager.FinishGameScene();
        soundController.FadeAndStopAllSounds();
    }
Exemple #2
0
    private void Update()
    {
        // Shake effect
        if (buttonsLeft > 0)
        {
            Vector3 newPosition = originalCameraPos + Random.insideUnitSphere * shakeAmount;
            newPosition.z = originalCameraPos.z;
            mainCamera.transform.localPosition = newPosition;
        }
        else
        {
            mainCamera.transform.localPosition = originalCameraPos;

            SceneMasterScript sceneMaster = GameObject.FindObjectOfType <SceneMasterScript>();
            sceneMaster.SetConditionsState(true);
            GameManagerScript gameManager = GameObject.FindObjectOfType <GameManagerScript>();
            gameManager.FinishGameScene();

            Destroy(this);
        }
    }
Exemple #3
0
    // Use this for initialization
    void Start()
    {
        sceneMasterScript = sceneMaster.GetComponent <SceneMasterScript>();

        LoadMainMenuScene();
    }