Exemple #1
0
    void OnTriggerExit2D(Collider2D collider)
    {
        AccelControl script = collider.gameObject.GetComponent <AccelControl>();

        if (script != null)
        {
            script.timeLava = 0;
        }
    }
Exemple #2
0
    public void OnTriggerExit2D(Collider2D other)
    {
        animator.SetBool("isFilling", false);
        isFilling = false;
        other.gameObject.GetComponent <Rigidbody2D>().drag = startDrag;
        AccelControl script = other.GetComponent <AccelControl>();

        script.maxVelocity = startVelocity;
        GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CameraControl>().startShakingCamera(.01f);
        audioSource.Stop();
    }
Exemple #3
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (!isFilled)
     {
         animator.SetBool("isFilling", true);
         audioSource.Play();
         isFilling = true;
         other.gameObject.GetComponent <Rigidbody2D>().drag = lakeDrag;
         AccelControl script = other.GetComponent <AccelControl>();
         startVelocity      = script.maxVelocity;
         script.maxVelocity = startVelocity / 2;
         GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CameraControl>().startShakingCamera(.01f);
     }
 }