public override void start() { //效果的东西 后端不用抄写。 if (this._data.ContainsKey("preEffect")) { this._player.dispatchEventWith(EventConstant.START, this); } if (this._data.ContainsKey("preTime")) { this.preTimeAction = new TimeAction(this._map).init((int)(this._data["preTime"])); this.addAction(this.preTimeAction); } this.addAction(new HandlerAction(this._map).init(this.onAliveHandler, 1)); //—————————————————————live——————————————————————— if (this._data.ContainsKey("time")) { int totalTime = (int)this._data["time"]; if (this._data.ContainsKey("live")) { Dictionary <string, object> live = (Dictionary <string, object>) this._data["live"]; //buff if (live.ContainsKey("buff")) { this.addAction(new HandlerAction(this._map).init(this.createBuff, 2)); } //triggers if (live.ContainsKey("triggers")) { //给当前并行的触发器 加到装备里面。 object[] triggers = (object[])live["triggers"]; for (int i = 0, len = triggers.Length; i < len; i++) { Dictionary <string, object> triggerData = (Dictionary <string, object>)triggers[i]; TriggerAction action = null; int interval = (int)(triggerData["time"]); if (triggerData.ContainsKey("skill")) { action = new TriggerAction(this._map).initTrigger(interval, totalTime, triggerData, this._player, this.lockTarget); action.breakAction = this; action.breakGroup = Utils.equal(triggerData, "break", 1); } else if (triggerData.ContainsKey("beam")) { action = new BeamAction(this._map).initTrigger(interval, totalTime, triggerData, this._player, this.lockTarget); action.breakAction = this; } this._triggers.addAction(action); } } } this.addAction(new TimeAction(this._map).init(totalTime)); } base.start(); }
public override void specialAction(ActionBase action) { if (action is BeamAction) { BeamAction beamAction = (BeamAction)action; GameObject go = ((Player)beamAction.player.view).addEffect(beamAction.skillData["resId"].ToString(), false); go.GetComponent <BeamView>().beamAction = beamAction; } }
/// <summary> /// 绘制梁信息 /// </summary> public BeamAction BeamAction(Color?penColor = null, int lineWidth = 1, double thickness = 10, Color?fill = null, dynamic Element = null) { if (penColor == null) { penColor = Colors.Black; } var a = new BeamAction(); a.Geometry.PenColor = penColor.Value; a.Geometry.LineWidth = lineWidth; a.Geometry.Element = Element; (a.Geometry as BeamGeometry).Thickness = thickness; if (fill != null) { a.Geometry.FillColor = fill.Value; } DrawingControl.SetAction(a); LastAction = a; return(a); }
private void SetAction(BeamAction a) { tip = new SubBeamTip(DrawingControl, textTip); tip.Attention(a); }
public BeamCandidate(T state, BeamAction action, float score) { State = state; Action = action; Score = score; }
public BeamCandidate(BeamState <T> state) { State = state.State; Action = null; Score = state.Score; }