我们控制端要发送很多命令给终端设备,其中有速度,方向,开关门,开关灯....方法千万种,我只取一瓢.我还小,不知道其他人是怎么写的.我喜欢把有规律的东西放在一起写!为了我的强迫症! using UnityEngine; using System.Collections; using System; public class Json : MonoBehaviour { public JsonType msg = new JsonType(); public Speed speed = new S
在上一篇的基础上,可以测试下行为树的嵌套,所谓的行为树嵌套,就是在一棵行为树下的某一个分支,接入另一棵行为树. 以下面这棵行为树为例: TestBehaviorTree2.lua TestBehaviorTree2 = BTBehaviorTree:New(); local this = TestBehaviorTree2; this.name = "TestBehaviorTree2"; function this:New() local o = {}; setmetatable(o
在子级有ScrollRect组件的对象添加以下脚本: using UnityEngine; using System.Collections; using UnityEngine.UI; using UnityEngine.EventSystems; public class DragEventSyn : MonoBehaviour, IEndDragHandler, IBeginDragHandler, IDragHandler{ public ScrollRect parentScrollR
Protobuf-net提供的一种易于使用的数据序列化方案,可序列化带有[ProtoContract]特性的类实例,并可支持Unity各个发布平台,且效率高.易用性强. public static class Serialization { public static byte[] Serialize<T>(T instance) { byte[] bytes; using (var ms = new MemoryStream()) { Serializer.Serialize(ms, ins