private void TryPickupItem(int slot) { if (ground.Count != 0) { inventory[slot] = (InanimateEntity)ground[0]; inventory[slot].Equip(this); UI.ChangeWeapon(this, slot); inventory[slot].GetComponent <Weapon>().enabled = true; SoundManager.playSound("pickUpItem"); inventory[slot].GetComponentInChildren <SpriteRenderer>(); } }
void Update() { if (Input.GetButton("Fire1")) { CmdPlayerShot(FireRate, FireDamage); } if (Input.GetKey("1")) { CmdChangeWeapon(FireColors.blue); PUI.ChangeWeapon(FireColors.blue); } if (Input.GetKey("2")) { CmdChangeWeapon(FireColors.red); PUI.ChangeWeapon(FireColors.red); } if (Input.GetKey("3")) { CmdChangeWeapon(FireColors.yellow); PUI.ChangeWeapon(FireColors.yellow); } if (Input.GetKey("4")) { CmdChangeWeapon(FireColors.green); PUI.ChangeWeapon(FireColors.green); } if (Input.GetKey("5")) { CmdChangeWeapon(FireColors.white); PUI.ChangeWeapon(FireColors.white); } }