public void RaiseEvent(E_EntityEvent key, EventSetData objInfo) { if (_outEventSet == null) { return; } _outEventSet.RaiseEvent(key, objInfo); }
// 改变动画的速率 public void OnChangeAnimationSpeed(EventSetData param) { AnimationSpeedEventData data = param as AnimationSpeedEventData; if (data == null) { return; } ChangeAnimationSpeed(data.animation_speed); }
// Entity播放动画 public void OnPlayAnimation(EventSetData param) { PlayAnimationEventData data = param as PlayAnimationEventData; if (data == null) { return; } PlayAnimation(data.animation_name); }
public bool RaiseEvent(TKey key, EventSetData param) { I_Condition condition; _conditionSet.TryGetValue(key, out condition); if (condition != null && !condition.IsTrue(param)) { return(false); } return(_eventSet.RaiseEvent(key, param)); }
// 改变当前玩家状态 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); }
public static void Push(EventSetData t) //where T : EventSetData { if (t == null) { return; } Type type = t.GetType(); if (!_data.ContainsKey(type)) { UnityEngine.Debug.LogFormat("Event Set Data .Push Error,type:[{0}]", type.ToString()); return; } _data[type].Add(t); t.Reset(); }
public void OnAction(BaseEntity entity, EventSetData param) { /*MoveToTargetPositionData data = param as MoveToTargetPositionData; * if (data == null) return; * * Vector3 entity_position = entity.WroldPosition; * int length = entity._targets.Count; * for (int i = 0; i < length; i++) * { * BaseEntity target = entity._targets[i]; * * Vector3 target_postion = target.WroldPosition; * Vector3 direction = target_postion - entity_position; * * direction.y = 0; * Vector3 distance = direction.normalized * data.distance; * target._movement.MoveToTargetPostion(target_postion + distance, data.speed); * }*/ }
private void OnBeHurt(EventSetData param) { EntityEventFactory.ChangeInEntityState(this, E_StateId.hurt); }
// 目标死亡 private void EntityDie(EventSetData param) { EntityEventFactory.ChangeInEntityState(this, E_StateId.die); }
// 被内部调用,由内部触发 public void RaiseEvent(E_EntityInTrigger key, EventSetData param) { _inEventSet.RaiseEvent(key, param); }
public void RaiseEvent(E_BuffEvent key, EventSetData data) { _buffEventSet.RaiseEvent(key, data); }
public void RaiseEvent(E_EntityInTrigger key, EventSetData obj_info) { // 父节点-->流程-->容器-->触发器 _parent_node._skill_container._entity.RaiseEvent(key, obj_info); EventDataFactory.Push(obj_info); }
// 播放特效 public void OnPlayEffect(EventSetData param) { EntityActionFactory.OnAction <EntityPlayEffectAction>(_baseEntity, param); }
public virtual void ReverseEffect(EventSetData data) { }
public virtual void ExcuteEffect(EventSetData data) { }