void Start() { pointA = 0; pointB = 400; clonedScript = GetComponentInChildren <SquashAndStretchDeformer>(); }
public void MoveItUp() { if (_itLerps) { for (int i = 0; i < objectList.Count; i++) { SquashAndStretchDeformer clonedScript = objectList[i].GetComponentInChildren <SquashAndStretchDeformer>(); if (clonedScript.Factor != endFactor) { //float GoingToStartFactor = startFactor; //float GoingToEndFactor = endFactor; float timeSinceLerp = Time.time - currentLerpTime; float t = timeSinceLerp / spawnTime; Perc = t * t * t * (t * (6f * t - 15f) + 10f); clonedScript.Factor = Mathf.Lerp(clonedScript.Factor, endFactor, Perc); //clonedScript.Bottom = Mathf.Lerp(clonedScript.Bottom, 0, Perc); // if(clonedScript.Factor == endFactor){ // float p = Time.time/spawnTime; // float Percmore = t*t*t * (t * (6f*t - 15f) + 10f); // clonedScript.Factor = Mathf.Lerp(clonedScript.Factor, startFactor, Percmore); // _itLerps = false; // Debug.Log(clonedScript.Factor); // } } // if(t >= 1.0f) // { // _itLerps = false; // } // if(clonedScript.Factor == endFactor){ // objectList.Remove(objectList[i]); // } } } }
void Start() { m_squashAndStretchDeformer = new SquashAndStretchDeformer(); InvokeRepeating("ObjectStretching", spawnTime, spawnDelay); objectToStretch.SetActive(false); }
void Start() { squash = GetComponentInChildren <SquashAndStretchDeformer>(); }