// Update is called once per frame void Update() { if (expand) { timeOBJ.Value += Time.deltaTime; //update the timer sliderVal = timeOBJ.Value; //set the slider to the time objects value lerpOBJ.Interprolant = sliderVal / timeOBJ.Max; //set the interprolant to the sliders value throwableObjCollider.radius = lerpOBJ.Result; //set the result to be the lerp result if (throwableObjCollider.radius >= 10f) { throwableObjCollider.radius = .8f; expand = false; } } else { sliderVal = 0; timeOBJ = new TimeOBJ { Max = 10, Value = sliderVal }; lerpOBJ = new LerpOBJ { Beginning = 0, Ending = timeOBJ.Max, Interprolant = timeOBJ.Value //set the ending of the lerp object }; } }
// Use this for initialization void Start() { timeOBJ = new TimeOBJ { Max = 10, Value = sliderVal }; lerpOBJ = new LerpOBJ { Beginning = 0, Ending = timeOBJ.Max, Interprolant = timeOBJ.Value //set the ending of the lerp object }; throwableObjCollider = GetComponent <SphereCollider>(); //add a collider and store the reference throwableObjCollider.radius = lerpOBJ.Result; //set the radius of the sphere collider }