Exemple #1
0
    public override void EnterState()
    {
        base.EnterState();
        cmd               = aiCharacter.lastCmd;
        activeSkill       = GetAttr().GetComponent <SkillInfoComponent>().GetActiveSkill();
        skillStateMachine = SkillLogic.CreateSkillStateMachine(GetAttr().gameObject, activeSkill.skillData, GetAttr().transform.position);
        var time    = Util.FrameToFloat(aiCharacter.lastCmd.skillAction.RunFrame);
        var dir     = cmd.skillAction.Dir;
        var physics = aiCharacter.GetAttr().GetComponent <IPhysicCom>();

        physics.TurnToDir(dir);
        holdTime = time;
        aiCharacter.PlayAniInTime("creep_attack1", time);
    }
Exemple #2
0
    public override void EnterState()
    {
        base.EnterState();
        cmd         = aiCharacter.lastCmd;
        activeSkill = GetAttr().GetComponent <SkillInfoComponent>().GetActiveSkill();
        var target       = cmd.skillAction.Target;
        var targetPlayer = ObjectManager.objectManager.GetPlayer(target);

        skillStateMachine = SkillLogic.CreateSkillStateMachine(GetAttr().gameObject, activeSkill.skillData, GetAttr().transform.position, targetPlayer);
        var time    = Util.FrameToFloat(aiCharacter.lastCmd.skillAction.RunFrame);
        var dir     = cmd.skillAction.Dir;
        var physics = aiCharacter.GetAttr().GetComponent <IPhysicCom>();

        physics.TurnToDir(dir);
        holdTime = time;

        var config = aiCharacter.GetAttr().npcConfig;
        var atype  = config.GetAction(ActionType.Attack);

        aiCharacter.PlayAniInTime(atype.aniName, time);
    }