Inheritance: MonoBehaviour
Example #1
0
    void Start()
    {
        endLevelMenu = FindObjectOfType <EndLevelMenu>();
        wagon        = playersWagon.gameObject.GetComponent <Wagon>();

        crowSpawner.enabled      = false;
        playersWagon.destination = currentSpawnPoint.transform.position;
        timeLeft = currentSpawnPoint.CompletionTime;

        currentSpawnPoint.EnableStage();
        SetGunsCrosshairsParameters();

        if (showTutorial && GameManager.Instance.TutorialEnabled)
        {
            playersWagon.gameObject.GetComponentInChildren <WeaponHolder>().EquippedGun.OnEmptyGun.AddListener(FirstEmptyGunNotice);
            tutorialUI.SetActive(true);
            if (showIntroText)
            {
                introTextUI.SetActive(true);
                introTextUI.GetComponent <IntroText>().OnPresentationFinished.AddListener(StartPlayingEnvironmentSounds);
            }
        }
        if (!showIntroText || !showTutorial || !GameManager.Instance.TutorialEnabled)
        {
            onStartPlayingEnvironmentSounds.Invoke();
            wagon.Move();
        }
    }
Example #2
0
 public void EndLevel()
 {
     flag.SetTrigger("FlagUp");
     EndLevelMenu.SetTrigger("EndLevel");
     PlayerMovement.Instance.isAlive = false;
     Score.Instance.countTime        = false;
 }