void SwitchWeapon() { Inventory inv = GetComponent<Inventory> (); this.weapon = inv.nextWeapon (); Debug.Log ("Weapon set to " + weapon.GetName ()); }