Example #1
0
 public void OnRespawnClick()
 {
     //Spawn Player
     gameControllerScript.RespawnPlayer();
     //Grab new players stats
     grabPlayerStats.NewPlayer();
     //Deactivate the dead menu
     Child.SetActive(false);
 }
    // Use this for initialization
    void Start()
    {
        cameraController = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CameraController>();
        cameraController.NewPlayer();
        Flash       = Gun.transform.GetComponentInChildren <ParticleSystem>();
        NewPosition = transform.position;
        shootScript = GetComponent <PlayerShootScript>();
        GameObject player = GameObject.FindGameObjectWithTag("Player");

        playerStats     = player.GetComponent <PlayerStats>();
        healthScript    = player.GetComponent <HealthScript>();
        grabPlayerStats = GameObject.FindGameObjectWithTag("PlayerStats").GetComponent <GrabPlayerStats>();
        grabPlayerStats.NewPlayer();
        Flash.Stop();
        //Grabbing Necassary Components
        MyAnimator   = GetComponent <Animator>();
        NavMeshAgent = GetComponent <NavMeshAgent>();

        //Setting state to Idle
        EPlayerState = PlayerState.Idle;

        StartCoroutine(Alive());
    }