unity3D写一个hello world


unity3D写一个hello world

打开unity并且在assets建立一个新的文件,新的文件命名为hello world.unity.接着创建一个新的C#Sript脚本文件,命名为hello world.C#Script,用VS2015打开并编写该脚本程序。

代码如下:

public class NewBehaviourScript : MonoBehaviour {

    // Use this for initialization
    void Start() {

    }

    // Update is called once per frame
    void Update() {

    }
    void OnGUI ()
        {
        GUI.skin.label.fontSize = 100;
        GUI.Label(new Rect(10,10,Screen.width,Screen.height),"hello world");
        }


}

 在unity中选定主摄像机,将写好的脚本程序拖到最右下角的复选框,然后点击中间运行按钮

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM