public position ( Vector3 endValue, bool isRelative = false ) : GoTweenConfig, | ||
endValue | Vector3 | |
isRelative | bool | |
Результат | GoTweenConfig, |
static public int position(IntPtr l) { try { GoTweenConfig self = (GoTweenConfig)checkSelf(l); UnityEngine.Vector3 a1; checkType(l, 2, out a1); System.Boolean a2; checkType(l, 3, out a2); var ret = self.position(a1, a2); pushValue(l, ret); return(1); } catch (Exception e) { return(error(l, e)); } }
void applyJumpSkillMove(List <Dictionary <string, string> > boxDataDict) { var rigidBody = gameObject.GetComponent <Rigidbody>(); //rigidBody.velocity = testVelocity; gtc = new GoTweenChain(); gtc.autoRemoveOnComplete = true; List <Dictionary <string, float> > atkOffsets = new List <Dictionary <string, float> >(); int bi = 0; foreach (var boxData in boxDataDict) { if (boxData["self_aff"] != "跳跃") { break; } char[] delimiterChars = { ',' }; string[] sdata = boxData["self_param"].Split(delimiterChars); if (sdata.Length < 3) { break; } List <float> fdata = new List <float>(); foreach (string s in sdata) { fdata.Add(Convert.ToSingle(s)); } float startTime = fdata[0]; float angle = fdata[1]; float speed = fdata[2]; float vx = speed * Mathf.Cos(Mathf.Deg2Rad * angle); float vy = speed * Mathf.Sin(Mathf.Deg2Rad * angle); Dictionary <string, float> offsetData = new Dictionary <string, float>(); offsetData["startTime"] = startTime; offsetData["velocityX"] = vx; offsetData["velocityY"] = vy; atkOffsets.Add(offsetData); var curData = atkOffsets[bi]; if (bi >= 1) { var preData = atkOffsets[bi - 1]; curData["delay"] = startTime - preData["startTime"]; } else { if (startTime > 0) { curData["delay"] = startTime; } } ++bi; } foreach (var v in atkOffsets) { if (v.ContainsKey("delay")) { var gtconfig = new GoTweenConfig(); gtc.append(new GoTween( gameObject.transform, v["delay"], gtconfig.onComplete(delegate(AbstractGoTween obj) { rigidBody.velocity = new Vector3(v["velocityX"], v["velocityY"], 0.0f); }) )); } } var cbcon = new GoTweenConfig(); gtc.append(new GoTween( gameObject.transform, 0.01f, cbcon.onComplete(delegate(AbstractGoTween obj) { //DestroyEfx (); }) )); gtc.appendDelay(2.0f); var con = new GoTweenConfig(); gtc.append(new GoTween( gameObject.transform, 0.01f, con.position(Vector3.zero, false).setEaseType(GoEaseType.Linear).setUpdateType(GoUpdateType.FixedUpdate) )); gtc.play(); }
void applyNonJumpSkillMove(List <Dictionary <string, string> > boxDataDict) { gtc = new GoTweenChain(); gtc.autoRemoveOnComplete = true; List <Dictionary <string, float> > atkOffsets = new List <Dictionary <string, float> >(); int bi = 0; foreach (var boxData in boxDataDict) { if (boxData["self_aff"] != "位移") { break; } char[] delimiterChars = { ',' }; string[] sdata = boxData["self_param"].Split(delimiterChars); if (sdata.Length < 3) { break; } List <float> fdata = new List <float>(); foreach (string s in sdata) { fdata.Add(Convert.ToSingle(s)); } float startTime = fdata[0] / 24; float speed = fdata[1]; float dist = fdata[2]; float duration = Mathf.Abs(dist / speed); speed = dist / duration; Dictionary <string, float> offsetData = new Dictionary <string, float>(); offsetData["startTime"] = startTime; offsetData["endTime"] = startTime + duration; offsetData["curTime"] = 0; offsetData["totalTime"] = duration; offsetData["speed"] = speed; atkOffsets.Add(offsetData); if (bi >= 1) { var preData = atkOffsets[bi - 1]; if (preData["endTime"] > startTime) { preData["endTime"] = startTime; preData["totalTime"] = startTime - preData["startTime"]; } else { preData["delay"] = startTime - preData["endTime"]; } } else { var curData = atkOffsets[bi]; if (startTime > 0) { curData["delay"] = startTime; } } ++bi; } foreach (var v in atkOffsets) { if (v.ContainsKey("delay")) { gtc.appendDelay(v["delay"]); } var gtconfig = new GoTweenConfig(); if (v["totalTime"] > 0) { var dirInc = new Vector3(v["speed"] * v["totalTime"], 0, 0); gtc.append(new GoTween( gameObject.transform, v["totalTime"], gtconfig.position(dirInc, true).setEaseType(GoEaseType.Linear).setUpdateType(GoUpdateType.FixedUpdate) )); } } var cbcon = new GoTweenConfig(); gtc.append(new GoTween( gameObject.transform, 0.01f, cbcon.onComplete(delegate(AbstractGoTween obj) { //DestroyEfx (); }) )); gtc.appendDelay(2.0f); var con = new GoTweenConfig(); gtc.append(new GoTween( gameObject.transform, 0.01f, con.position(Vector3.zero, false).setEaseType(GoEaseType.Linear).setUpdateType(GoUpdateType.FixedUpdate) )); gtc.play(); }