// Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.UpArrow) && (AmmoManager.GetAmmoCount() > 0))
     {
         Instantiate(Projectile, FirePoint.position, FirePoint.rotation);
         AmmoManager.AddAmmo(-1);
     }
 }
Ejemplo n.º 2
0
    void OnTriggerEnter2D(Collider2D Other)
    {
        if (Other.GetComponent <Rigidbody2D> () == null)
        {
            return;
        }
        AmmoManager.AddAmmo(AmmoToAdd);

        Destroy(gameObject);
    }
Ejemplo n.º 3
0
    void OnTriggerEnter2D(Collider2D Other)
    {
        if (Other.GetComponent <CharacterMove> () == null)
        {
            return;
        }
        print("Ammo Value:" + AmmoValue);
        AmmoManager.AddAmmo(AmmoValue);

        Destroy(gameObject);
    }
Ejemplo n.º 4
0
    void OnTriggerEnter2D(Collider2D other)
    {
        Debug.Log("entering collision");

        other.gameObject.GetComponent <MoneyManager> ();
        other.gameObject.GetComponent <PlayerHealthManager> ();
        other.gameObject.GetComponent <AmmoManager> ();

        if (Money > PointsToTake)
        {
            Debug.Log("Money = " + Money);

            if (Input.GetKeyDown("G"))
            {
                Debug.Log("taking points for health");

                MoneyManager.TakePointsforHealth(PointsToTake);

                PlayerHealthManager.Me.AddHealth(healthToGive);
            }

            if (Input.GetKeyDown("H"))
            {
                MoneyManager.TakePointsforHealth(PointsToTake);

                AmmoManager.AddAmmo(ammoToGive);
            }

            if (Input.GetButtonDown("Interact1"))
            {
                Debug.Log("taking points for health");

                MoneyManager.TakePointsforHealth(PointsToTake);

                PlayerHealthManager.Me.AddHealth(healthToGive);
            }

            if (Input.GetButtonDown("Interact2"))
            {
                MoneyManager.TakePointsforHealth(PointsToTake);

                AmmoManager.AddAmmo(ammoToGive);
            }
        }
    }
Ejemplo n.º 5
0
 private void pickupAssaultRifleAmmo()
 {
     ammo.AddAmmo(Constants.AssaultRifle, 50);
 }