public void Attack(Vector3 targetDirectiom)
 {
     if (Time.time > attackTemp + AttackDelay)
     {
         character.DoDamage();
         character.AttackAnimation();
         attackTemp = Time.time;
     }
 }
Exemplo n.º 2
0
    public void Shoot()
    {
        if (animator)
        {
            animator.speed = AnimationSpeed;
        }

        if (Ammo <= 0 && !InfinityAmmo)
        {
            return;
        }

        if (!OnAnimationEvent)
        {
            OnAction();
        }
        if (character != null)
        {
            character.AttackAnimation(UsingType);
        }
        if (animator)
        {
            animator.SetTrigger("shoot");
        }
    }
Exemplo n.º 3
0
    void Use()
    {
        if (ItemUsed != null)
        {
            if (!InfinityAmmo)
            {
                if (character != null && character.inventory != null && !character.inventory.CheckItem(ItemUsed, 1))
                {
                    return;
                }
            }
        }

        if (!OnAnimationEvent)
        {
            OnAction();
        }

        if (animator)
        {
            animator.SetInteger("shoot_type", UsingType);
            animator.SetTrigger("shoot");
        }
        if (character != null)
        {
            character.AttackAnimation(UsingType);
        }
    }
Exemplo n.º 4
0
 public void Attack(Vector3 targetDirectiom)
 {
     if (Time.time > attackTemp + AttackDelay)
     {
         Vector3[] dirs = new Vector3[1];
         dirs [0] = targetDirectiom.normalized;
         character.DoDamage(this.transform.position, dirs, character.Damage, character.DamageLength, character.Penetrate, "", character.Team);
         character.AttackAnimation();
         attackTemp = Time.time;
     }
 }