// 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);
     }
 }
Пример #2
0
    void OnTriggerEnter2D(Collider2D Other)
    {
        if (Other.GetComponent <Rigidbody2D> () == null)
        {
            return;
        }
        AmmoManager.AddAmmo(AmmoToAdd);

        Destroy(gameObject);
    }
Пример #3
0
    void OnTriggerEnter2D(Collider2D Other)
    {
        if (Other.GetComponent <CharacterMove> () == null)
        {
            return;
        }
        print("Ammo Value:" + AmmoValue);
        AmmoManager.AddAmmo(AmmoValue);

        Destroy(gameObject);
    }
Пример #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);
            }
        }
    }
Пример #5
0
 private void pickupAssaultRifleAmmo()
 {
     ammo.AddAmmo(Constants.AssaultRifle, 50);
 }