close
文章出處
選擇file -->new project
然后保存到相應的地方
下面是這個剛創建的工程效果圖。
然后創建一個C# Script ||定位到最左下角找到 assets --> create --> C# Script 然后起一個名字。
創建好了如圖所示
然后選中左邊的 Main Camera
把剛創建的Script 與Main Camera 關聯
把剛創建的Script Add 進來。然后選中剛創建的Script open it 打開。
打開后如圖所示
添加如下代碼
using UnityEngine; using System.Collections; public class NewBehaviourScript : MonoBehaviour { // Use this for initialization void Start () { } // Update is called once per frame void Update () { } void OnGUI() { //開始按鈕 if(GUI.Button(new Rect(0,10,100,30),"qingjoin ")) { //System.Console.WriteLine("hello world"); print("hello qingjoin !"); // Debug.Log("up.up"); } } }
回到Unity 界面。運行。 選擇Edit --> play
如圖所示。效果
這樣一個最簡單的unity 就基本完成了。
接下來把整個工程導入到iOS 平臺 。
選擇Build & run 選擇iOS
好像這個只能在真機上運行。。。
![]() |
不含病毒。www.avast.com |
全站熱搜