您的位置:首页 > 移动开发 > Unity3D

初学Unity3D——编写脚本(hello world)

2014-11-14 22:22 344 查看
本日志,随时更新

今天学了最基础的打印“hello world”
首先,创建C#脚本(Assets-create-C# Script)
可重命名自己需要的名字,双击打开,会弹出u3d默认编辑器





打开后的界面





在void Start()里输入代码

using UnityEngine;

using System.Collections;

public class hello : MonoBehaviour {

// Use this for initialization

void Start () {

print ("hello world");

}

// Update is called once per frame

void Update () {

}

}

保存,把脚本拖拽到游戏对象上,或主照相机





运行该场景

即可看到“hello
world”
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: