Exemplo n.º 1
0
 void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Player1") || other.CompareTag("Player2"))
     {
         if (playerOneDying && other.CompareTag("Player1"))
         {
             return;
         }
         if (playerTwoDying && other.CompareTag("Player2"))
         {
             return;
         }
         WildCatController deadPlayer = other.transform.parent.gameObject.GetComponent <WildCatController>();
         if (deadPlayer)
         {
             Debug.Log("OnTriggerEnter");
             if (other.CompareTag("Player1"))
             {
                 playerOneDying = true;
             }
             if (other.CompareTag("Player2"))
             {
                 playerTwoDying = true;
             }
             StartCoroutine(this.PlayerDeathCoroutine(deadPlayer, other.gameObject.transform.position));
         }
     }
 }
Exemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     rigidBodies = gameObject.GetComponentsInChildren <Rigidbody>();
     wildCat     = GetComponent <WildCatController>();
     inputMngr   = GetComponent <InputManager>();
     colorStart  = RightShieldObject.renderer.material.color;
     colorEnd    = new Color(colorStart.r, colorStart.g, colorStart.b, 0.0f);
     FadeOut(dashingDirection);
 }
Exemplo n.º 3
0
 IEnumerator PlayerDeathCoroutine(WildCatController deadPlayer, Vector3 pos)
 {
     yield return new WaitForSeconds(1.0f);
     GameObject explosionGO = GameObject.Instantiate(this.ExplosionPrefab, pos, Quaternion.identity) as GameObject;
     yield return new WaitForSeconds(1.0f);
     GameObject.Destroy(explosionGO);
     deadPlayer.Die();
     if (deadPlayer.CompareTag("Player1")) playerOneDying = false;
     if (deadPlayer.CompareTag("Player2")) playerTwoDying = false;
 }
Exemplo n.º 4
0
    IEnumerator             PlayerDeathCoroutine(WildCatController deadPlayer, Vector3 pos)
    {
        yield return(new WaitForSeconds(1.0f));

        GameObject explosionGO = GameObject.Instantiate(this.ExplosionPrefab, pos, Quaternion.identity) as GameObject;

        yield return(new WaitForSeconds(1.0f));

        GameObject.Destroy(explosionGO);
        deadPlayer.Die();
        if (deadPlayer.CompareTag("Player1"))
        {
            playerOneDying = false;
        }
        if (deadPlayer.CompareTag("Player2"))
        {
            playerTwoDying = false;
        }
    }
Exemplo n.º 5
0
 // Use this for initialization
 void Start()
 {
     rigidBodies = gameObject.GetComponentsInChildren<Rigidbody>();
     wildCat = GetComponent<WildCatController>();
     inputMngr = GetComponent<InputManager>();
     colorStart = RightShieldObject.renderer.material.color;
     colorEnd = new Color(colorStart.r, colorStart.g, colorStart.b, 0.0f);
     FadeOut (dashingDirection);
 }
Exemplo n.º 6
0
 // Use this for initialization
 void Start()
 {
     ParticleComp = this.gameObject.GetComponent <ParticleSystem>();
     ParticleComp.emissionRate = 0;
     wildCat = transform.root.gameObject.GetComponent <WildCatController>();
 }
Exemplo n.º 7
0
 // Use this for initialization
 void Start()
 {
     ParticleComp = this.gameObject.GetComponent<ParticleSystem>();
     ParticleComp.emissionRate = 0;
     wildCat = transform.root.gameObject.GetComponent<WildCatController>();
 }