下面我们开始今天的技能培训。 我们学习Unity3D培训目标:让初学者可以更快速的掌握技术,自行制作修改素材,可以独立完成2D、3D小规模游戏及网页游戏开发。
[csharp] view plaincopy
- using UnityEngine;
- using System.Collections;
- public class Test : MonoBehaviour
- {
- public GameObject testBtn;
- public Font f;
- // Use this for initialization
- void Start()
- {
- UIEventListener.Get(testBtn).onClick += CreatLabel;
- }
- // Update is called once per frame
- void Update()
- {
- }
- void CreatLabel(GameObject go)
- {
- UILabel label = NGUITools.AddChild<UILabel>(gameObject);
- label.trueTypeFont = f;
- label.text = "Test";
- }
- }
本教程旨在帮助初学者快速掌握Unity3D技术,通过学习能够独立完成2D及3D小规模游戏和网页游戏的开发。教程中包含了如何使用Unity引擎创建游戏对象,并通过示例代码展示了如何为游戏按钮添加事件监听器以及如何创建和设置UI标签。
2072

被折叠的 条评论
为什么被折叠?



