// 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); } }
void OnTriggerEnter2D(Collider2D Other) { if (Other.GetComponent <Rigidbody2D> () == null) { return; } AmmoManager.AddAmmo(AmmoToAdd); Destroy(gameObject); }
void OnTriggerEnter2D(Collider2D Other) { if (Other.GetComponent <CharacterMove> () == null) { return; } print("Ammo Value:" + AmmoValue); AmmoManager.AddAmmo(AmmoValue); Destroy(gameObject); }
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); } } }
private void pickupAssaultRifleAmmo() { ammo.AddAmmo(Constants.AssaultRifle, 50); }