Example #1
0
 public virtual void Attack()
 {
     if (canAttack)
     {
         commandManager.InsertCommand(Cmd_AttackSwing.New(transform.gameObject, attackDuration, attackTriggerPoint, this));
         canAttack = false;
     }
 }
Example #2
0
    /// <summary>
    /// this command gets inserted at the front of the command queue to complete an attack animation and time out other events this is command is here to make sure is only doing an attack action
    /// and nothing else it also allows for animation cancelling minigame.
    /// </summary>

    public static Cmd_AttackSwing New(GameObject prGameObject, float prDuration, float prAttackTriggerPoint, Weapon prAttackingWeapon)
    {
        Cmd_AttackSwing newcommand = prGameObject.AddComponent <Cmd_AttackSwing>();

        newcommand.Duration     = prDuration;
        newcommand.triggerPoint = prAttackTriggerPoint;
        newcommand.weapon       = prAttackingWeapon;
        newcommand.triggered    = false;
        newcommand.timeEleapsed = 0;

        return(newcommand);
    }