public void Apply(SkEntity entity, SkRuntimeInfo info) { if (_seId > 0) { entity.ApplySe(_seId, info); } if (_repelEff) { entity.ApplyRepelEff(info); } if (_emitId > 0) { entity.ApplyEmission(_emitId, info); } if (_anms.Length > 0) { entity.ApplyAnim(PickAnim(entity, info), info); } foreach (int eid in _effId) { if (eid > 0) { entity.ApplyEff(eid, info); } } if (_camEffId > 0) { entity.ApplyCamEff(_camEffId, info); } if (_procEffId > 0) { SkEffExFunc.Apply(_procEffId, entity, info); } }
internal void TryApplyEachEffOfMain(int idx, SkEntity tar, SkRuntimeInfo skrt) { SkEffect eff = idx < _effMainEachTime.Length ? _effMainEachTime [idx] : _effMainEachTime [_effMainEachTime.Length - 1]; if (eff != null) { eff.Apply(tar, skrt); } }
static void DoEff2(SkEntity entity, SkRuntimeInfo info) { // Add code SkBuffInst buff = info as SkBuffInst; if (null != buff) { entity.OnBuffRemove(buff._buff._id); } }
internal static void Apply(int procEffId, SkEntity entity, SkRuntimeInfo info) { switch (procEffId) { case 1: DoEff1(entity, info); break; case 2: DoEff2(entity, info); break; default: break; } }
private string PickAnim(SkEntity entity, SkRuntimeInfo info) { SkInst inst = info as SkInst; if (inst != null) { switch (_anms [0].ToLower()) { case "rnd": return(_anms [SkInst.s_rand.Next(1, _anms.Length)]); case "inc": { int idx = inst.GuideCnt - 1; idx %= (_anms.Length - 1); return(_anms [idx + 1]); //1+(GuideCnt-1) } case "dir": return(_anms [1 + inst.GetAtkDir()]); } } return(_anms[0]); }
public virtual void ApplyRepelEff(SkRuntimeInfo info) { }
public virtual void ApplyCamEff(int effId, SkRuntimeInfo info) { }
public virtual void ApplyEmission(int emitId, SkRuntimeInfo info) { }
public virtual void ApplyAnim(string anim, SkRuntimeInfo info) { }
// Virtuals Methods public virtual void ApplySe(int seId, SkRuntimeInfo info) { }