1.Screen 屏幕类 作用:设置文本或其它在屏幕中间,不论分辨率
2.设置CubeScore在屏幕中间
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Center : MonoBehaviour {
public GUIText m_cubescore;
// Use this for initialization
void Start () {
int x = Screen.width / 2;
int y = Screen.height / 2;
m_cubescore.pixelOffset = new Vector2(x, y);
}
// Update is called once per frame
void Update () {
}
}
3.在unity 里要添加GoldScore物体到脚本的Cubescore里