public void AddMoveAni(Func <Variant, double, double> tweenFun, Vec2 b, Vec2 e, float tm) { bool flag = b.x != e.x; if (flag) { Variant aniAtt = GameTools.createGroup(new Variant[] { "begin", b.x, "change", e.x - b.x, "duration", tm }); this._attAni.AddAni(tweenFun, "x", aniAtt, 1, 0f); } bool flag2 = b.y != e.y; if (flag2) { Variant aniAtt = GameTools.createGroup(new Variant[] { "begin", b.y, "change", e.y - b.y, "duration", tm }); this._attAni.AddAni(tweenFun, "y", aniAtt, 1, 0f); } }
public void AddSizeAni(Func <Variant, double, double> tweenFun, float b, float e, float tm, int cnt = 1) { bool flag = b != e; if (flag) { Variant aniAtt = GameTools.createGroup(new Variant[] { "begin", b, "change", e - b, "duration", tm }); this._attAni.AddAni(tweenFun, "scaleX", aniAtt, cnt, 0f); aniAtt = GameTools.createGroup(new Variant[] { "begin", b, "change", e - b, "duration", tm }); this._attAni.AddAni(tweenFun, "scaleY", aniAtt, cnt, 0f); } }
public void AddAttAni(Func <Variant, double, double> tweenFun, String attnm, float b, float e, float tm, int cnt = 1) { if (b != e) { Variant aniAtt = GameTools.createGroup("begin", b, "change", (e - b), "duration", tm); _attAni.AddAni(tweenFun, attnm, aniAtt, cnt); } }
public static Variant CreateSwitchData(string caseStr, Variant data) { return(GameTools.createGroup(new Variant[] { "case", caseStr, "data", data })); }
public AttAni(Variant obj) { if (obj != null && obj._val is IUIBaseControl) { _obj = GameTools.createGroup("ctrl", obj._val); } else { _obj = obj; } }
//---------------------------------------------------------------------------------------------- public void AddMoveAni(Func <Variant, double, double> tweenFun, Vec2 b, Vec2 e, float tm) { Variant aniAtt; if (b.x != e.x) { aniAtt = GameTools.createGroup("begin", b.x, "change", (e.x - b.x), "duration", tm); _attAni.AddAni(tweenFun, "x", aniAtt); } if (b.y != e.y) { aniAtt = GameTools.createGroup("begin", b.y, "change", (e.y - b.y), "duration", tm); _attAni.AddAni(tweenFun, "y", aniAtt); } }
public AttAni(Variant obj) { bool flag = obj != null && obj._val is IUIBaseControl; if (flag) { this._obj = GameTools.createGroup(new object[] { "ctrl", obj._val }); } else { this._obj = obj; } }
public void AddAni(Func <Variant, double, double> tweenFun, string attnm, Variant aniAtt, int plycnt = 1, float delay = 0f) { bool flag = false; bool flag2 = this.m_data.ContainsKey("ctrl"); if (flag2) { flag = true; Type type = this.m_data["ctrl"]._val.GetType(); object[] properties = type.GetProperties(); PropertyInfo property = type.GetProperty(attnm); bool flag3 = property != null && property.Name != attnm; if (flag3) { return; } } bool flag4 = !flag && !this.m_data.ContainsKey(attnm); if (!flag4) { this._anis[attnm] = GameTools.createGroup(new object[] { "nm", attnm, "tweenFun", tweenFun, "plycnt", plycnt, "ccnt", 0, "delay", delay }); this._anis[attnm]["aniAtt"] = aniAtt; this._aniAttChanged = true; } }
//----------------------------------------------------------------------------------- // attnm: 属性名字 --- obj中的属性 //tweenFun:插值算法 //aniAtt: 插值算法的参数 必须有下列参数 其他视具体算法需求 // { begin:属性开始值, // change:属性变化范围, // duration:播放一次的时间, // } //plycnt: 播放次数 -1为无限循环 //delay:延迟播放 时间 public void AddAni(Func <Variant, double, double> tweenFun, String attnm, Variant aniAtt, int plycnt = 1, float delay = 0) { bool isCtrl = false; if (m_data.ContainsKey("ctrl")) { isCtrl = true; Type t = m_data["ctrl"]._val.GetType(); object[] mm = t.GetProperties(); PropertyInfo at = t.GetProperty(attnm); if (at != null && at.Name != attnm) { return; } } if (!isCtrl && !m_data.ContainsKey(attnm)) { return; } _anis[attnm] = GameTools.createGroup("nm", attnm, "tweenFun", tweenFun, "plycnt", plycnt, "ccnt", 0, "delay", delay); _anis[attnm]["aniAtt"] = aniAtt; _aniAttChanged = true; }