随笔分类 -  ScriptC#

摘要:左右移动盘子的脚本 脚本效果 : 控制乒乓球弹跳逻辑的脚本 csharp using System.Collections; using System.Collections.Generic; using UnityEngine; public class BallController : Mono 阅读全文
posted @ 2017-03-10 17:14 Hu&Fei 阅读(1708) 评论(0) 推荐(0) 编辑
摘要:下面是 Unity 常用类间的关系图 Unity 任何要绑定在 GameObject 上的脚本都必须继承自 MonoBehaviour. 许多常用的类都属于组件, 如 Transform,Camera,Light 和 Animation 等. 所有的 GameObject 上都绑定了一个 Trans 阅读全文
posted @ 2017-03-09 21:06 Hu&Fei 阅读(981) 评论(0) 推荐(0) 编辑
摘要:1. 什么是协程 A coroutine is a function that is executed partially and, presuming suitable conditions are met, will be resumed at some point in the future 阅读全文
posted @ 2017-03-09 16:29 Hu&Fei 阅读(2056) 评论(0) 推荐(0) 编辑
摘要:Unity 官方的手册上有一张说明图 , 网址是 → "点这里" , 图片如下 : Reset is called in the Editor when the script is attached or reset. → Reset 是在用户点击检视面板的 Reset 按钮或者首次添加该组件时被调 阅读全文
posted @ 2017-02-10 13:54 Hu&Fei 阅读(1106) 评论(1) 推荐(0) 编辑
摘要:UGUI 可视化创建以及关联事件很方便, 动态创建可以利用创建好的 Prefab 进行实例化, 只是在关联事件上有些复杂, 本文总结了几种给按钮绑定事件的关联方式. 1. 可视化创建及事件绑定 Step 1 : 通过 Hierarchy 面板创建 . Step 2 : 创建一个脚本 TestClic 阅读全文
posted @ 2017-02-06 14:16 Hu&Fei 阅读(129857) 评论(1) 推荐(10) 编辑