今天在编写一个通用模块的时候,遇到一个奇怪的问题,vs编译时没有任何问题,但是轮到unity编译时,却报错: error CS0103: The name `PrintInt' does not exist in the current context 出问题的代码片段如下: public void MovePoker(Vector3 startPos, Vector3 endPos, float moveTime, Ease ease = Ease.Flash) { view.MoveSelf
如图: 定义属性描述特性(因为没有描述的数据,让绘制类去绘制所以为空) using UnityEngine; using System.Collections; public class EnumFlagsAttribute : PropertyAttribute {} 自定义属性绘制类: using UnityEngine; using System.Collections; using UnityEditor; [CustomPropertyDrawer(typeof(EnumFlagsAt
首先是自定义 using UnityEngine; using System.Collections; using UnityEditor; public class EnumFlagsAttribute : PropertyAttribute {} [CustomPropertyDrawer(typeof(EnumFlagsAttribute))] public class EnumFlagsAttributeDrawer : PropertyDrawer { public override
最近在项目中做测试脚本用到一些布尔值做方法的开关,突然想到可以制作一个复选框控制开关. 首先搜集网上的资料,基本大同小异,这里就不多做解释了,代码附上: public class EnumFlagsAttribute : PropertyAttribute{} [CustomPropertyDrawer(typeof(EnumFlagsAttribute))] public class EnumFlagsDrawer:PropetyDrawer { public override void On
using System; using System.Collections; using System.Collections.Generic; using UnityEngine; /** 有限状态机系统基于Eric Dybsand的<游戏编程精粹>(Game Programming Gems)第3.1章 如何使用: 1. 在状态转化机中的相应枚举类中,声明 transitions 和 states 的label. 2. 写新的类集成 FSMState, 对于写的每一个类都要写上"
using UnityEngine; using System.Collections; using System.Text; public class rotCube : MonoBehaviour { //示例,如何为一个自定义对象实现GetEnumerator接口,从而可以对该对象使用foreach //这种写法是c#2.0才有的,通过yield关键字与IEnumerator返回类型组合成一个枚举器 //C#会自动生成一个IEnumerator类,该类实现了MoveNext(),Reset
Persistence 场景保持是HoloLens全息体验的一个关键特性,当用户离开原场景中时,原场景中全息对象会保持在特定位置,当用户回到原场景时,能够准确还原原场景的全息内容.WorldAnchorStore类是实现此特性的关键API,这保证了用户能够将任何全息对象贴到任何他们想要放置的位置. How to persist holograms across sessions 如何在整个会话中保持全息对象 WorldAnchorStore能够允许你保持场景中空间锚的位置,为了能够真正保持全息对