Ejemplo n.º 1
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.name == "SharkSwitch")
        {
            autoMoveShark.enabled = true;
        }
        if (other.name == "SharkSwitch1")
        {
            autoMoveShark2.enabled = true;
            autoMoveShark3.enabled = true;
            autoMoveShark4.enabled = true;
        }
        if (other.name == "waterArea")
        {
            movement.AutomaticForce = 800f;
            movement.SlideWayForce  = 25f;
        }
        if (other.name == "boom")
        {
            Canonball1.SetActive(true);
            Canonball2.SetActive(true);
            Canonball3.SetActive(true);

            CanonBall.AddForce(-2000 * Time.deltaTime, 0, 0, ForceMode.VelocityChange);
            CanonBall1.AddForce(-2000 * Time.deltaTime, 0, 0, ForceMode.VelocityChange);
            CanonBall2.AddForce(-2000 * Time.deltaTime, 0, 0, ForceMode.VelocityChange);
        }
    }
Ejemplo n.º 2
0
 void Start()
 {
     animator  = GetComponent <Animator>();
     rigidbody = GetComponent <Rigidbody>();
     Canonball1.SetActive(false);
     Canonball2.SetActive(false);
     Canonball3.SetActive(false);
     smoke1.SetActive(false);
     smoke2.SetActive(false);
     smoke3.SetActive(false);
 }