unity scale循环大小
2016-03-12 本文已影响103人
自由的天空
float rate = .5f;
float maxScale = 1.2f;
float minScale = .8f;
float scale = (Mathf.Sin(Time.time * (rate * 2 * Mathf.PI)) + 1f)/2f;
scale = Mathf.Lerp (minScale, maxScale, scale);
transform.localScale = new Vector3(scale,scale,scale);