public void OnStart() { SkillLog.Log("Time:{0}-----------------------------序列开始[{1}]-----------------------------", TimeModule.FrameCount, des); _reset_sequence(); DoActionNext(); ReceiveWithInEvent(E_SkillTransition.START); }
public void OnFinish() { _cur_node = null; _next_index = _childnodes.Count; _skill_container.OnFinish(); SkillLog.Log("Time:{0}-----------------------------序列结束[{1}]-----------------------------", TimeModule.FrameCount, des); }
protected virtual void OnEnter() { if (_runing_state != RUNING_START) { SkillLog.Log("OnEnter当前节点状态{0}错误,必须等级1", _runing_state); return; } _runing_state = RUNING_ENTER; SkillLog.LogEnter(this); // 1.遍历当前节点下的所有叶子节点 int length = _actions.Count; // 所有动作执行的总结果 只有总结过为true的时候才会过度到下一个状态 bool all_action_result = true; for (int i = 0; i < length; i++) { _actions[i].OnEnter(GetBlackboard()); if (!_actions[i].IsFinish()) { all_action_result = false; } } // 如果所有叶子节点都已经执行完毕。那么发送结束事件 if (all_action_result) { _on_finish_node(); } }
public bool CastSkill(int id) { if (!_map.ContainsKey(id)) { return(false); } SkillLog.Log("======================释放技能:[{0}]======================", id); _currSequece = _map[id]; _currSequece.Start(_entity); /* //if (!CanCastSkill()) return false; * EntityEventFactory.ChangeInEntityState(_entity, E_StateId.attack); * //SkillLog.Assert(!_test, "释放技能bug:[{0}]", id); * SkillLog.Log("======================释放技能:[{0}]======================", id); * //_test = true; * _canCastSkill = false; * * _currSequece = SkillFactory.Create(); * _currSequece.GetBlackBorad().SetValue(SequenceSelfConst.TARGET_POSITION1, new Vector3(1.87f, 0.1f, 3.76f)); * * _currSequece.GetBlackBorad().SetValue(SequenceSelfConst.TARGET_POSITION2, _entity.EntityController.WroldPosition); * * _currSequece.GetBlackBorad().SetValue(SequenceSelfConst.TARGET_SELF_ENTITY, _entity); * _currSequece.Start();*/ return(true); }
// 改变当前玩家状态 public void ChangeState(EventSetData param) { ChangeEntityStateEventData data = param as ChangeEntityStateEventData; if (data == null) { return; } if (GetState() == data.state_id && !data.force) { return; } SkillLog.Log("之前状态:{0},改变之后状态:{1}", GetState(), data.state_id); PerformTransition(data.state_id); }
protected virtual void OnExit() { if (_runing_state < RUNING_ENTER) { SkillLog.Log("OnExit当前节点状态{0}错误,必须大于2", _runing_state); return; } _runing_state = RUNING_EXIT; int length = _actions.Count; for (int i = 0; i < length; i++) { _actions[i].OnExit(GetBlackboard()); } SkillLog.LogExit(this); }
public bool CastSkill(int id) { if (!CanCastSkill()) { return(false); } EntityEventFactory.ChangeInEntityState(_entity, E_StateId.attack); SkillLog.Assert(!_test, "释放技能bug:[{0}]", id); SkillLog.Log("======================释放技能:[{0}]======================", id); _test = true; _can_cast_skill = false; // TODO QAQ:有bug的可能性很大,例如技能释放到一半的时候,释放了另外一个技能,这样就需要破坏掉原来的技能 _curr_sequece = _sequence_map[id]; //_curr_sequece.OnStart(); _last_time = TimeModule.RealtimeSinceStartup; return(true); }
// 接受内部事件 public void ReceiveWithInEvent(E_SkillTransition node_event) { SkillLog.Log("Time: {0} -----------------触发内部:[{1}]事件-----------------", TimeModule.FrameCount, node_event); _receive_event(node_event); }
public void SkillStart() { //AnimatorStateInfo anim_info = animator.GetCurrentAnimatorStateInfo(0); SkillLog.Log("=================Animation触发事件:[{0}]", E_SkillTransition.ANIM_START); SkillEvent(E_SkillTransition.START); }
public void SkillFinish() { SkillLog.Log("=================Animation触发事件:[{0}]", E_SkillTransition.ANIM_FINISH); SkillEvent(E_SkillTransition.ANIM_FINISH); }
public void SkillHit() { SkillLog.Log("=================Animation触发事件:[{0}]", E_SkillTransition.ANIM_HIT); SkillEvent(E_SkillTransition.ANIM_HIT); }
public void SkillEvent02() { SkillLog.Log("=================Animation触发事件:[{0}]", E_SkillTransition.ANIM_EVENT02); SkillEvent(E_SkillTransition.ANIM_EVENT02); }
// 释放技能普攻 public void ReleaseSkill() { SkillLog.Log("======================释放技能控制======================"); _test = false; _can_cast_skill = true; }