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)); }
/// <summary>Resets all values back to their defaults.</summary> public virtual void clear() { Owner = null; ID = null; EndLoc = new VectorF[2]; CurLength = FInt.F0; State = new SegState[2]; State[0] = SegState.Complete; State[0] = SegState.Complete; Visible = false; LastCheck = TimeSpan.MinValue; LastCheckNum = 0; }
void OnCompleteOperation() { mState = SegState.Idle; }
public void Rotate(float angle, float time) { mState = SegState.Busy; iTween.RotateAdd(gameObject, iTween.Hash("time", time, "amount", angle * Vector3.up, "easetype", iTween.EaseType.easeInQuad, "oncomplete", "OnCompleteOperation")); }