public override void Update() { base.Update(); if (isFinish) { return; } if (!actionMove.IsFinish()) { actionMove.Update(); } KeepActionPlay(); if (ticker.IsActiveOneTime()) { try { CheckShendPos(hero.Position); DestroyFx(); hero.DispatchEvent(ControllerCommand.CrossFadeAnimation, hero.CharacterStateName(CharacterState.IDLE1)); } catch (System.Exception e) { Debug.Log(e.ToString()); } PlayEndFx(5f); isFinish = true; } }
/// <summary> /// Update this instance. /// </summary> public override void Update() { if (null != hero.AnimCmp && !hero.AnimCmp.IsFighting() ) { hero.property.fightHp = hero.property.hp; } action.speed = hero.Speed; action.isLock = isLock; action.deltaSpace = deltaSpace; action.Update(); EventRet ret = hero.DispatchEvent(ControllerCommand.IsPlayingActionFinish, hero.CharacterStateName(CharacterState.MOVE1)); float _time = action.speed / commonSpeed; if( hero.AnimCmp.IsSpeedStackEmpty() ) hero.AnimCmp.SetSpeed(_time); bool b = (bool)ret.GetReturn<AnimationComponent>(); if(b) { hero.DispatchEvent(ControllerCommand.CrossFadeAnimation,hero.CharacterStateName(CharacterState.MOVE1)); } if(action.IsFinish()) { hero.DispatchEvent(ControllerCommand.CrossFadeAnimation, hero.CharacterStateName(CharacterState.IDLE1)); return; } }
/// <summary> /// Update this instance. /// </summary> public override void Update() { if (hasTarget && null == target) { isFinish = true; return; } if (hasTarget || ticker.IsEnable()) { if (Vector3.Distance(endPosition, target.Position) > 0.3f) { Active(); } } if (action.IsFinish()) { if (!isFinish) { SceneEntity _hero = hero as SceneEntity; if (null == target) { _hero.Action.SendSkill(skillId, endPosition); } else { SceneEntity _target = target as SceneEntity; _hero.Action.SendSkill(skillId, _target); } isFinish = true; } return; } action.speed = hero.Speed; action.deltaSpace = deltaSpace; action.Update(); EventRet ret = hero.DispatchEvent(ControllerCommand.IsPlayingActionFinish, hero.CharacterStateName(CharacterState.MOVE1)); bool bRet = (bool)ret.GetReturn <AnimationComponent>(); if (bRet) { hero.DispatchEvent(ControllerCommand.CrossFadeAnimation, hero.CharacterStateName(CharacterState.MOVE1)); } }
/// <summary> /// Update this instance. /// </summary> public override void Update() { if (ticker.IsEnable()) { if (Vector3.Distance(endPosition, targetHero.Position) > 0.3f) { Active(); } } if (action.IsFinish()) { if (!isFinish) { if (null != targetHero) { hero.DispatchEvent(ControllerCommand.REACH_NPC); if (null != del) { hero.DispatchEvent(ControllerCommand.CrossFadeAnimation, hero.CharacterStateName(CharacterState.IDLE1)); del(targetHero); } } isFinish = true; } return; } action.speed = speed; action.isLock = isLock; action.deltaSpace = deltaSpace; action.Update(); EventRet ret = hero.DispatchEvent(ControllerCommand.IsPlayingActionFinish, hero.CharacterStateName(CharacterState.MOVE1)); bool bRet = (bool)ret.GetReturn <AnimationComponent>(); if (bRet) { hero.DispatchEvent(ControllerCommand.CrossFadeAnimation, hero.CharacterStateName(CharacterState.MOVE1)); } }