public CActionSound(ZWActionEvent host, string path) : base(host, path) { }
public void Initialize(RoleObject parent) { for (int i = 0; i < config.ActionEvents.Length; ++i) { Action.ActionEvent actionevent = config.ActionEvents[i]; if (actionevent.EventPart != eventpart) { continue; } List <ZWActionEvent> eventlist = null; float time = 0; float Duration = 0; int fireballNum = 0; switch (actionevent.EventType) { case ActionEventType.ANIMATION: eventlist = ZWActionEvent.CreateEffect <ActionEventPlayAnimation>(parent, this, actionevent, out Duration); break; case ActionEventType.EFFECT: eventlist = ZWActionEvent.CreateEffect <ActionEventStartEffectOnSelf>(parent, this, actionevent, out Duration); break; case ActionEventType.FIREBALL: eventlist = ZWActionEvent.CreateEffect <ActionEventStartEffectFireBall>(parent, this, actionevent, out Duration, this.context, fireballNum); fireballNum++; break; case ActionEventType.AUDIO: eventlist = ZWActionEvent.CreateEffect <ActionEventPlaySound>(parent, this, actionevent, out Duration); break; case ActionEventType.CAMERA_SHACK: eventlist = ZWActionEvent.CreateEffect <ActionEventCameraShakeEffect>(parent, this, actionevent, out Duration); break; case ActionEventType.SCREEN_BLACK: eventlist = ZWActionEvent.CreateEffect <ActionEventScreenEffect>(parent, this, actionevent, out Duration); break; case ActionEventType.RADIALBLUR: eventlist = ZWActionEvent.CreateEffect <ActionEventRadialBlur>(parent, this, actionevent, out Duration); break; case ActionEventType.DEAD: eventlist = ZWActionEvent.CreateEffect <ActionEventDead>(parent, this, actionevent, out Duration); break; case ActionEventType.SLOW: eventlist = ZWActionEvent.CreateEffect <ActionEventSlow>(parent, this, actionevent, out Duration); break; case ActionEventType.HEATDISTORT: eventlist = ZWActionEvent.CreateEffect <ActionEventStartEffectOnSelf>(parent, this, actionevent, out Duration); break; case ActionEventType.HIDING: eventlist = ZWActionEvent.CreateEffect <ActionEventHiding>(parent, this, actionevent, out Duration); break; case ActionEventType.TRANSFORM: eventlist = ZWActionEvent.CreateEffect <ActionEventTransform>(parent, this, actionevent, out Duration); break; case ActionEventType.XPBODYCHANGE: eventlist = ZWActionEvent.CreateEffect <ActionEventXPBodyChange>(parent, this, actionevent, out Duration); break; } time = Mathf.Max(Duration, time); for (int j = 0; j < eventlist.Count; j++) { this.actionEvents.AddTail(eventlist[j]); } this.LifeTime += time; } }