unity3d游戏开发之编写脚本(hello world)

时间:2022-07-15 12:16:16 阅读: 最新文章 文档下载
说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。
今天学了最基础的打印“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 () { } }

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




运行该场景world

这篇文章来自狗刨学习网

即可看到“hello


本文来源:https://www.wddqw.com/doc/0bebebdce309581b6bd97f19227916888486b9b2.html