Ejemplo n.º 1
0
    void OnTriggerEnter2D(Collider2D Other)
    {
        if (Other.GetComponent <Rigidbody2D> () == null)
        {
            return;
        }

        EggCount.AddAmmo(AmmoToAdd);

        Destroy(gameObject);
    }
Ejemplo n.º 2
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.RightControl) && EggCount.Ammo > 0)
     {
         Instantiate(Projectile, FirePoint.position, FirePoint.rotation);
         EggCount.AddAmmo(-AmmoUse);
         animator.SetBool("isAttacking", true);
     }
     else if (Input.GetKeyUp(KeyCode.RightControl))
     {
         animator.SetBool("isAttacking", false);
     }
 }