void OnCompleteReflect(OnReflectParam param) { if (param != null) { Utility.SetAsChild(param.axes.transform.parent.gameObject, param.go); Destroy(param.axes); } Normalize(param.theta); OnCompleteOperation(); }
public void DoReflect(float AxesAngle, float time, int relativeTheta, int isConjugate = -1) { mState = SegState.Busy; GameObject reflectAxes = new GameObject(); OnReflectParam param = new OnReflectParam(reflectAxes, this.gameObject, relativeTheta); reflectAxes.name = "reflectAxes" + AxesAngle.ToString() + "_" + r.ToString(); reflectAxes.transform.RotateAround(transform.position, Vector3.up, (float)AxesAngle); GameObject theAxes = GameObject.Find("reflectAxes" + AxesAngle.ToString() + "_" + r.ToString()); Utility.SetAsChild(gameObject.transform.parent.gameObject, theAxes); Utility.SetAsChild(theAxes, gameObject); iTween.RotateAdd(theAxes, iTween.Hash("time", time, "amount", isConjugate * 180.0f * Vector3.right, "easetype", iTween.EaseType.linear)); iTween.RotateAdd(gameObject, iTween.Hash("time", time, "amount", 180.0f * Vector3.forward, "easetype", iTween.EaseType.linear, "oncomplete", "OnCompleteReflect", "oncompleteparams", param)); }