private void draw()
    {
        applyOverrides();

        Mannequin mannequin = character.GetComponent <Mannequin>();

        if (mannequin != null)
        {
            mannequin.ShowItemInHandsView(null);
        }

        Animator animator = character.animator;

        character.activeCombatItem = combatItem;

        if (combatItem.animationOverrides.equip == null)
        {
            animator.SetTrigger("ToCombatStance");
            ExitAlertBehaviour.AlertExitState(animator, "Grounded", this);
        }
        else
        {
            ExitAlertBehaviour.AlertExitState(animator, "DrawWeapon", this);
            animator.SetTrigger("DrawWeapon");
        }
    }
Exemplo n.º 2
0
    protected override void OnCharacterActionStart(Character character)
    {
        Animator animator = character.animator;


        ExitAlertBehaviour.AlertExitState(animator, "Hurt", this);

        animator.SetTrigger("Hurt");
    }
Exemplo n.º 3
0
    protected override void OnCharacterActionStart(Character actor)
    {
        animator = actor.animator;

        ExitAlertBehaviour.AlertExitState(animator, "Attack", this);

        animator.SetTrigger("Attack");

        timer = 0.0f;
    }
Exemplo n.º 4
0
    // OnStateMove is called right after Animator.OnAnimatorMove(). Code that processes and affects root motion should be implemented here
    //override public void OnStateMove(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
    //
    //}

    // OnStateIK is called right after Animator.OnAnimatorIK(). Code that sets up animation IK (inverse kinematics) should be implemented here.
    //override public void OnStateIK(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
    //
    //}

    internal static void AlertExitState(Animator animator, string p, IExitStateListener stateListener)
    {
        ExitAlertBehaviour exitAlerter = animator.GetBehaviours <ExitAlertBehaviour>()
                                         .FirstOrDefault(a => a.triggerName == p);

        if (exitAlerter.exitStateListeners == null)
        {
            exitAlerter.exitStateListeners = new List <IExitStateListener>();
        }

        exitAlerter.exitStateListeners.Add(stateListener);
    }