Esempio n. 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);
        }
Esempio n. 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);
 }
Esempio n. 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);
        }