Exemple #1
0
    void OnTriggerEnter(Collider other)
    {
        if (other.gameObject == PlayerManager.GetMainPlayer().gameObject&& !PlayerManager.GetMainPlayer().inButtonCutscene&& PlayerPrefs.GetInt(vasetofind, 0) == 0)
        {
            this.GetComponent <AudioSource>().Play();

            this.gameObject.GetComponentInChildren <VibrateInRange>(true).CollectedTear();

            DeactivateTear();

            WaterTearManager.ShowCutscene(this);
        }
    }
Exemple #2
0
    void Awake()
    {
        if (singleton != null)
        {
            enabled = false;
            Destroy(this);
            return;
        }
        singleton = this;

        tearAppearEM         = tearAppearPFX.GetComponent <ParticleSystem>().emission;
        tearAppearEM.enabled = false;

        if (PlayerPrefs.GetInt("First3Tears", 0) == 1 && bordersParent != null)
        {
            bordersParent.SetActive(false);
        }

        mainCharacter.ps.CheckTears();
        if (mainCharacter.ps.tearCount == 24)
        {
            elevator.SetActive(false);
        }
    }
Exemple #3
0
    // Update is called once per frame
    void Update()
    {
        if (ps == null)
        {
            ps = PlayerManager.GetMainPlayer().ps;
            ps.CheckTears();
        }

        if (!levelcomplete)
        {
            if ((watertear1.activeSelf && watertear2.activeSelf && watertear3.activeSelf) || PlayerPrefs.GetInt("IntroWatched", 0) == 0)
            {
                levelcomplete = true;
                if (PlayerPrefs.GetInt("IntroWatched", 0) == 1)
                {
                    if (PlayerPrefs.GetInt("Played" + levelID.ToString() + "TreeCompletion", 0) == 0)
                    {
                        PlayerPrefs.SetInt("Played" + levelID.ToString() + "TreeCompletion", 1);

                        ps.CheckTears();

                        if (ps.tearCount == 24)
                        {
                            WaterTearManager.AllTearsCutscene();
                            //    GameObject.FindWithTag("Pause").transform.Find("Event Text").gameObject.GetComponent<TextTriggerMain>().SetText(5);
#if UNITY_PS4
                            //
                            // check trophy
                            PS4Manager.ps4TrophyManager.UnlockTrophy((int)PS4_TROPHIES.FIND_ALL_WATER_TEARS);
#endif

#if UNITY_XBOXONE
                            //
                            // check trophy : items >= 3 and items = all
                            //
                            XONEAchievements.SubmitAchievement((int)XONEACHIEVS.ALL_TREE_SAGE_RESTORED);
#endif
                        }
                        else
                        {
                            if (levelID != 3 && ps.tearCount > 3)
                            {
                                GameObject.FindWithTag("Pause").transform.Find("Event Text").gameObject.GetComponent <TextTriggerMain>().SetText(4);
                            }
                        }
                    }
                }
            }
        }
        else
        {
            if (PlayerPrefs.GetInt("IntroWatched", 0) == 1 && (!watertear1.activeSelf || !watertear2.activeSelf || !watertear3.activeSelf))
            {
                levelcomplete = false;
            }
        }

        if (levelcomplete)
        {
            if (treesage != null)
            {
                treesage.SetActive(true);
                treesagegrey.SetActive(false);
            }

            if (!wateractive1.activeInHierarchy)
            {
                wateractive1.SetActive(true);
            }

            if (!wateractive2.activeInHierarchy)
            {
                if (ps.tearCount == 24 || PlayerPrefs.GetInt("IntroWatched", 0) == 0)
                {
                    wateractive2.SetActive(true);

                    if (watermain1 != null)
                    {
                        watermain1.SetActive(true);
                        watermain2.SetActive(true);
                    }
                }
            }
        }
        else
        {
            if (treesage != null)
            {
                treesage.SetActive(false);
                treesagegrey.SetActive(true);
            }

            if (wateractive1.activeInHierarchy)
            {
                wateractive1.SetActive(false);
            }

            if (wateractive2.activeInHierarchy)
            {
                if (ps.tearCount != 24 && PlayerPrefs.GetInt("IntroWatched", 0) == 1)
                {
                    wateractive2.SetActive(false);

                    if (watermain1 != null)
                    {
                        watermain1.SetActive(false);
                        watermain2.SetActive(false);
                    }
                }
            }
        }
    }
    IEnumerator KilledFinalBoss()
    {
        PlayerPrefs.SetInt("FinalBossDefeated", 1);

#if UNITY_PS4
        //
        // check trophy
        if (!finishgameAchieved)
        {
            finishgameAchieved = true;
            PS4Manager.ps4TrophyManager.UnlockTrophy((int)PS4_TROPHIES.FINISH_THE_GAME);
        }
#endif

#if UNITY_XBOXONE
        //
        // check trophy : items >= 3 and items = all
        //
        if (!finishgameAchieved)
        {
            finishgameAchieved = true;
            XONEAchievements.SubmitAchievement((int)XONEACHIEVS.WOODLE_SAVIOR);
        }
#endif

        if (tpc == null)
        {
            tpc = PlayerManager.GetMainPlayer();
        }

        tpc.disableControl = true;
        tpc.rb.velocity    = Vector3.zero;
        tpc.rb.isKinematic = true;
        yield return(null);

        tpc.anim.SetFloat("Speed", 0f);
        if (tpc.onGround)
        {
            tpc.anim.Play("Idle", 0);
        }

        yield return(new WaitForSeconds(3f));


        finished = true;
        PlayerManager.GetMainPlayer().cam.SetActive(false);
        darkboss.gameObject.SetActive(false);
        GameObject.FindWithTag("Pause").GetComponent <PauseScreen>().cantPause = true;
        finalsequence.gameObject.SetActive(true);
        darkbossdefeated.gameObject.SetActive(true);
        //StartCoroutine(FinalSequenceStart());

        soundtrackstopped.gameObject.SetActive(false);
        this.enabled = false;


        yield return(new WaitForSeconds(5.0f));


        WaterTearManager.FinalCutscene();


        yield return(new WaitForSeconds(0.1f));

        finalsequence.gameObject.SetActive(false);
        GameObject.FindWithTag("Pause").GetComponent <PauseScreen>().cantPause = false;
    }