Render Mode: Screen Space - Overlay:将UI放置在场景的上面,调节场景大小或调整分辨率,则Canvas也会随之调整. Screen Space - Camera:Canvas由一个特定的相机渲染,相机的设置会影响UI. World Space:使Canvas像场景中的其他对象一样渲染. 默认情况为Screen Space - Overlay 模式, 即不能更改 Rect Transform 更换成 World Space 即可设置Rect Transform
绑定在摄像机上的脚本 using UnityEngine; using System.Collections; public class abc : MonoBehaviour { //设置移动速度 public int speed = 5; //设置将被初始化载入的对象 public Transform newobject = null; // Use this for initialization void Start () { } // Update is called once per