Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/317.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 将实例化与精益吐温相结合_C#_Unity3d_Instantiation - Fatal编程技术网

C# 将实例化与精益吐温相结合

C# 将实例化与精益吐温相结合,c#,unity3d,instantiation,C#,Unity3d,Instantiation,我想用lean tween缩放一个对象,但我也只是实例化它 //this line instantiates the Gem gemList1.Add(Instantiate(Gem, new Vector2((xPos_Hole1 + (Random.Range(-20, 20))) * 2.0F, (-229 + (20 * i))), Quaternion.identity)); //This line animates the GEM by scaling it LeanTween.s

我想用lean tween缩放一个对象,但我也只是实例化它

//this line instantiates the Gem
gemList1.Add(Instantiate(Gem, new Vector2((xPos_Hole1 + (Random.Range(-20, 20))) * 2.0F, (-229 + (20 * i))), Quaternion.identity));

//This line animates the GEM by scaling it
LeanTween.scale(Gem, new Vector3(1.7f, 1.7f, 1.7f), 5f).setEase(LeanTweenType.easeOutBounce);
如何组合下面的代码行?换句话说,我想在实例化预制件时对其进行缩放/设置动画

//this line instantiates the Gem
gemList1.Add(Instantiate(Gem, new Vector2((xPos_Hole1 + (Random.Range(-20, 20))) * 2.0F, (-229 + (20 * i))), Quaternion.identity));

//This line animates the GEM by scaling it
LeanTween.scale(Gem, new Vector3(1.7f, 1.7f, 1.7f), 5f).setEase(LeanTweenType.easeOutBounce);

实例化游戏对象时,将结果保存到临时变量中。将该临时变量添加到列表中,然后在
LeanTween.scale
函数中也使用该临时变量

//this line instantiates the Gem
GameObject tempObj = Instantiate(Gem, new Vector2((xPos_Hole1 + (Random.Range(-20, 20))) * 2.0F, (-229 + (20 * i))), Quaternion.identity);

//this line add the instantiated Gem to the List
gemList1.Add(tempObj);

//This line animates the GEM by scaling it
LeanTween.scale(tempObj, new Vector3(1.7f, 1.7f, 1.7f), 5f).setEase(LeanTweenType.easeOutBounce);

实例化游戏对象时,将结果保存到临时变量中。将该临时变量添加到列表中,然后在
LeanTween.scale
函数中也使用该临时变量

//this line instantiates the Gem
GameObject tempObj = Instantiate(Gem, new Vector2((xPos_Hole1 + (Random.Range(-20, 20))) * 2.0F, (-229 + (20 * i))), Quaternion.identity);

//this line add the instantiated Gem to the List
gemList1.Add(tempObj);

//This line animates the GEM by scaling it
LeanTween.scale(tempObj, new Vector3(1.7f, 1.7f, 1.7f), 5f).setEase(LeanTweenType.easeOutBounce);

谢谢你的回答谢谢你的回答