如何随时间更改对象的X轴比例?我尝试了这段代码:
transform.localScale.x *= 1.1f;
但是它给了我这个错误:
无法修改“ Transform.localScale”的返回值,因为它不是变量
答案 0 :(得分:0)
要仅更改localScale中的单个值,您需要在本地创建一个新的Vector3。这样做的两个例子:
for(int i=0;i<5;i++)
{
double[][] CC = new double[listoflists[i].Count - 1][];
}
替代方法:
// Make a new vector with identical y and z values, but with a new x value.
var newScale = new Vector3(
transform.localScale.x * 1.1f,
transform.localScale.y,
transform.localScale.z);
// Set scale to the new Vector3.
transform.localScale = newScale;