コード例 #1
0
    public void PickUpWeapon(Transform weaponT)
    {
        if (ActiveWeapon == null)
        {
            CarriedWeapons.Add(weaponT);
            ActiveWeapon = weaponT.root.GetComponent <IWeapon>();

            ActiveWeapon.WeaponOwner     = this.transform;
            ActiveWeapon.WeaponTransform = weaponT;

            weaponT.parent   = this.transform;
            weaponT.position = transform.position + new Vector3(0, 2, 0);
            weaponT.rotation = Quaternion.identity;
        }
    }
コード例 #2
0
ファイル: PlayerDefunct.cs プロジェクト: ShinobiSpartan/T2xN
 void DropWeapon()       //Drops the current weapon
 {
     CarriedWeapons.Remove(currentWeapon);
 }
コード例 #3
0
ファイル: PlayerDefunct.cs プロジェクト: ShinobiSpartan/T2xN
 void PickupWeapon(Weapon weaponPickedUp)
 {
     CarriedWeapons.Add(weaponPickedUp);                     //Add the new weapon
     SwitchWeapon(CarriedWeapons[CarriedWeapons.Count - 1]); //... and switch to the new weapon
 }