在Unity中用Transform控制物体的位置,旋转,缩放
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CubeTransform : MonoBehaviour {
// 坐标
public float x = 0.0f;
public float y = 0.0f;
public float z = 0.0f;
// 添加一个 Transform 的类
public Transform Mytransform;
void Start () {
// 坐标 旋转 缩放
// eulerAngles 欧拉角
Mytransform.position = new Vector3(0, 0, 0);
Mytransform.eulerAngles = new Vector3(30, 0, 0);
Mytransform.localScale = new Vector3(3, 3, 3);
}
void Update () {
}
}