/// <summary> /// 添加动作实体 /// </summary> /// <param name="actionEntity"></param> public void AddActionEntity(SkillActionEntity actionEntity) { actionEntity.startCallback = OnActionStart; actionEntity.endCallback = OnActionEnd; currentActionEntities.Add(actionEntity); actionEntity.Start(); }
/// <summary> /// 创建技能动作实体 /// </summary> /// <param name="action"></param> /// <returns></returns> public static SkillActionEntity CreateSkillActionEntity(SkillAction action) { SkillActionEntity entity = new SkillActionEntity(); entity.action = action; return(entity); }
/// <summary> /// 检查动作开始 /// </summary> protected void CheckActionsStart() { foreach (SkillAction action in actions) { if (currentTime >= action.startTime) { startActions.Add(action); } } if (startActions.Count > 0) { foreach (SkillAction action in startActions) { actions.Remove(action); SkillActionEntity actionEntity = SkillHelper.CreateSkillActionEntity(action); if (actionEntity != null) { AddActionEntity(actionEntity); } } startActions.Clear(); } }
public virtual void Reset(SkillActionEntity entity) { }
public virtual void End(SkillActionEntity entity) { }
public virtual void Update(SkillActionEntity entity, float delatTime) { }
public virtual void Start(SkillActionEntity entity) { }
/// <summary> /// 动作结束回调 /// </summary> /// <param name="action"></param> protected void OnActionEnd(SkillActionEntity actionEntity) { actionEntity.startCallback = null; actionEntity.endCallback = null; }
/// <summary> /// 动作开始回调 /// </summary> /// <param name="action"></param> protected void OnActionStart(SkillActionEntity actionEntity) { }
/// <summary> /// 移除动作实体 /// </summary> /// <param name="actionEntity"></param> public void RemoveActionEntity(SkillActionEntity actionEntity) { currentActionEntities.Remove(actionEntity); }
public override void Start(SkillActionEntity entity) { UnityEngine.Debug.Log("SA_Camera Start"); }
public override void End(SkillActionEntity entity) { UnityEngine.Debug.Log("SA_Camera End"); }
public override void Update(SkillActionEntity entity, float delatTime) { UnityEngine.Debug.Log("SA_Camera Update:" + entity.currentTime); }
public override void Start(SkillActionEntity entity) { UnityEngine.Debug.Log("SA_PlayEffect Start"); }
public override void End(SkillActionEntity entity) { UnityEngine.Debug.Log("SA_PlayEffect End"); }