摘要: 其实只是要在要绑定的对象上挂上一个脚本,然后使用UIEventListener的Get方法进行事件绑定 要监听的游戏对象身上要挂载碰撞体 UIEventListener.Get(要监听的游戏对象).绑定的事件+=方法名; void 方法名GameObject go) { Debug.Log("On 阅读全文
posted @ 2019-04-01 11:05 青梨 阅读(255) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2019-03-31 10:33 青梨 阅读(0) 评论(0) 推荐(0) 编辑
摘要: Unity中提供了五种获取对象的方法1.通过对象名称(Find)public static GameObject Find(string name);通过名字寻找对象并返回它,只返回active GameObject,如果没有GameObject,则返回null。如果名称内包含“/”字符,会当做是h 阅读全文
posted @ 2019-03-30 01:40 青梨 阅读(300) 评论(0) 推荐(0) 编辑
摘要: 1 void Awake () 2 { 3 //获取需要监听的按钮对象 4 GameObject button = GameObject.Find("UI Root (2D)/Camera/Anchor/Panel/LoadUI/MainCommon/Button"); 5 //设置这个按... 阅读全文
posted @ 2019-03-30 01:31 青梨 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 1,引用SceneManagement 2,使用跳转语句SceneManager.LoadScene("场景名字/ID"); 3,添加场景到Build settings里面 阅读全文
posted @ 2019-03-28 17:15 青梨 阅读(852) 评论(0) 推荐(0) 编辑
摘要: using System.Collections; using System.Collections.Generic; using UnityEngine; using LitJson; public class ListJson : MonoBehaviour { void Start () { //fun1(); fun2(); ... 阅读全文
posted @ 2018-12-21 16:31 青梨 阅读(681) 评论(0) 推荐(0) 编辑
摘要: using System.Collections; using System.Collections.Generic; using UnityEngine; using System; public class jiontext : MonoBehaviour { [Serializable] public class Preson { public... 阅读全文
posted @ 2018-12-21 15:11 青梨 阅读(784) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2018-12-18 23:25 青梨 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 一,设置 二,脚本 阅读全文
posted @ 2018-12-16 01:26 青梨 阅读(3831) 评论(0) 推荐(0) 编辑
摘要: 一,把陷阱制作成预制体; 二,把角色死亡特效制作成预制体 三,有一些公共变量要拖进脚本里 四,特效要及时的销毁,给特效预制体添加脚本DeadDestroy; 五,脚本 阅读全文
posted @ 2018-12-15 22:59 青梨 阅读(2664) 评论(0) 推荐(0) 编辑