示例#1
0
        public EquipedWeapon Equip(Transform carrier, Transform rightHand, Transform leftHand, Animator animator)
        {
            AnimationHandler.OverrideAnimations(animator, animationClip, "Attack");
            EquipedWeapon spawnedWeapon = Spawn(carrier, SelectTransform(rightHand, leftHand));

            return(spawnedWeapon);
        }
示例#2
0
 public virtual EquipedWeapon Spawn(Transform carrier, Transform position)
 {
     if (itemObject != null)
     {
         GameObject    newWeapon     = MonoBehaviour.Instantiate(itemObject, position);
         EquipedWeapon equipedWeapon = newWeapon.AddComponent <EquipedWeapon>();
         equipedWeapon.Initialize(carrier, position, hitArea, this);
         return(equipedWeapon);
     }
     return(null);
 }
示例#3
0
        protected override void Initialize()
        {
            if (!defaultWeapon)
            {
                defaultWeapon = Resources.Load("Prefabs/Unarmed") as GenericWeapon;
            }

            Animator animator = GetComponent <Animator>();
            Weapon   weapon   = defaultWeapon.GenerateItem() as Weapon;

            equipedWeapon = weapon.Equip(transform, rightWeaponHolder, leftWeaponHolder, animator);

            CalculateInitialStats(weapon);
        }