private void Awake() { if (rot != null) { rot = dice.GetComponent <TransformRotation>(); } }
void Start() { instanciate = this; AuxFinalRotationX = FinalRotationX; AuxFinalRotationY = FinalRotationY; AuxFinalRotationZ = FinalRotationZ; Rotation = transform.eulerAngles; }
private void Awake() { if (rot1 != null) { rot1 = dice1.GetComponent <TransformRotation>(); } if (rot2 != null) { rot2 = dice1.GetComponent <TransformRotation>(); } if (rot3 != null) { rot3 = dice1.GetComponent <TransformRotation>(); } }
public TransformRotation GetTransformRotationAtLen(float len) { int currSplineIdx = -1; for (int splineIdx = 0; splineIdx < mNodes.Count; splineIdx++) { if (mNodes[splineIdx].Len > len) { continue; } else { currSplineIdx = splineIdx; break; } } if (currSplineIdx == -1) { return(null); } // Calculates the d param between 0 and 1 float param = (len - mNodes[currSplineIdx].Len) / (mNodes[currSplineIdx + 1].Len - mNodes[currSplineIdx].Len); // Smooth the param param = MathUtils.Ease(param, mNodes[mCurrentIdx].EaseIO.x, mNodes[mCurrentIdx].EaseIO.y); TransformRotation tr = new TransformRotation(); tr.pos = GetHermiteInternal(mCurrentIdx, param); if (mRotations) { tr.rot = GetSquad(mCurrentIdx, param); } return(tr); }
public void SetUp() { containingObject = new GameObject(); subject = containingObject.AddComponent <TransformRotation>(); }
public TransformRotation GetTransformRotationAtLen(float len) { int currSplineIdx = -1; for(int splineIdx = 0; splineIdx < mNodes.Count; splineIdx++) { if(mNodes[splineIdx].Len > len) { continue; } else { currSplineIdx = splineIdx; break; } } if(currSplineIdx == -1) { return null; } // Calculates the d param between 0 and 1 float param = (len - mNodes[currSplineIdx].Len) / (mNodes[currSplineIdx + 1].Len - mNodes[currSplineIdx].Len); // Smooth the param param = MathUtils.Ease(param, mNodes[mCurrentIdx].EaseIO.x, mNodes[mCurrentIdx].EaseIO.y); TransformRotation tr = new TransformRotation(); tr.pos = GetHermiteInternal(mCurrentIdx, param); if (mRotations) { tr.rot = GetSquad(mCurrentIdx, param); } return tr; }