Example #1
0
 void OnTriggerEnter2D(Collider2D coll)
 {
     if (coll.gameObject.tag == "ModifyingZone")
     {
         coll.GetComponent <ModifyingZone> ().Modified();
         DropManagerComponent.RemoveDrop(this);
     }
 }
Example #2
0
 private void OnTriggerEnter(Collider coll)
 {
     if (coll.gameObject.layer == 9)
     {
         DropManagerComponent.RemoveDrop(this);
         DropManagerComponent.RemoveEnemy(coll.gameObject.GetComponent <Enemy_Moving_Component>());
     }
 }
Example #3
0
 void Shoot()
 {
     projectileBody.AddForce(transform.forward.normalized * shootSpeed, ForceMode.Impulse);
     if (Vector3.Distance(transform.position, launchPlace.transform.position) > 20)
     {
         DropManagerComponent.RemoveDrop(this);
     }
 }
Example #4
0
 void Shoot()
 {
     projectileBody.velocity = transform.forward.normalized * shootSpeed * Time.fixedDeltaTime;
     if (Vector3.Distance(transform.position, launchPlace.transform.position) > 20)
     {
         DropManagerComponent.RemoveDrop(this);
     }
 }
Example #5
0
 void Shoot()
 {
     /*if (Input.GetMouseButtonDown (1) && GetComponent<PlayerBehavior> ().isAiming == true)
      * {
      * dirToTarget = Camera.main.ScreenToWorldPoint (Input.mousePosition) - playerBody.transform.position;
      *      gameObject.SetActive (true);
      *      eauLancee.AddForce (dirToTarget.normalized * shootSpeed, ForceMode2D.Impulse);
      * }*/
     body.velocity = transform.right * shootSpeed * Time.fixedDeltaTime;
     if (Vector3.Distance(transform.position, playerBody.transform.position) > dirToEauPos.magnitude)
     {
         DropManagerComponent.RemoveDrop(this);
     }
 }
Example #6
0
 private void OnTriggerEnter(Collider coll)
 {
     if (coll.gameObject.layer == 8)
     {
         if (numberOfBoing == 0)
         {
             DropManagerComponent.RemoveDrop(this);
         }
         else
         {
             numberOfBoing--;
         }
     }
 }