有没有办法在脚本中复制游戏对象的变换值(位置、旋转、缩放)。我不想单独复制每个转换值,如下面的脚本所示。
public GameObject Obj02;
public GameObject Obj04;
private Vector3 positionOfObj02;
private Vector3 rotationOfObj02;
private Vector3 positionOfObj04;
private Vector3 rotationOfObj04;
void Start()
{
positionOfObj02 = Obj02.transform.localPosition;
rotationOfObj02 = Obj02.transform.localEulerAngles;
positionOfObj04 = Obj04.transform.localPosition;
rotationOfObj04 = Obj04.transform.localEulerAngles;
}
墨色风雨
Smart猫小萌
相关分类