资源简介
TUIO模拟器,可以自定义设置发送端口和接收端口,在没有硬件的情况下可以自行测试使用,同时还是Unity原工程,可以加压缩后直接使用unity打开研究
代码片段和文件信息
/*
Singleton MonoBehaviour
Generic Unity MonoBehaviour Singleton
Usage:
public class MusicManager : SingletonMonobehaviour {
public void PlaySong(string name) {}
}
To survive scene loads use DontDestroyonload(this) in subclasses or use SingletonMonobehaviourNoDestroy.
nb. this ONLY works if any parents of the gameobject aren‘t themselves destroyed! ie. should be at root level or nested in another non-destructible gameobject.
Updated 24/5/2015
Copyright Flightless 2014. All rights reserved.
*/
using UnityEngine;
using System.Collections.Generic;
namespace Flightless {
public abstract class SingletonMonoBehaviour : MonoBehaviour where T : SingletonMonoBehaviour {
private static T _instance;
public static T instance { get { return _instance ?? (!isApplicationQuitting ? new Gameobject(“_“ + typeof(T)).AddComponent() : null ); } }
public static T CreateInstance() { return instance; }
public static bool hasInstance { get { return _instance != null; } }
public static bool isApplicationQuitting { get; protected set; }
virtual protected void Awake() {
if (_instance != null) {
Debug.LogError(name + “.Awake() error: already initialised as “ + _instance.name);
Destroy(gameobject);
return;
}
_instance = (T)this;
Initialise();
}
virtual protected void Initialise() {}
virtual protected void OnApplicationQuit() {
isApplicationQuitting = true;
}
virtual protected void OnDestroy() {
if (_instance == this) _instance = null;
}
}
public abstract class SingletonMonoBehaviourNoDestroy : SingletonMonoBehaviour where T : SingletonMonoBehaviourNoDestroy {
override protected void Awake() {
base.Awake();
DontDestroyonload(gameobject);
}
}
}
相关资源
- 电容触摸按键方案
- Toucher4.4触摸屏浏览器正式版亲测可用
- QT5开发及高清PDF,资料全
- 基于stm32f103 usb 的Win7系统触摸屏程序
- 基于STM32的智能管家门控系统设计与实
- DMTFT-28型TFT触摸屏9320版资料
- 基于stm32的触摸屏电子秤
- 施耐德触摸屏最新升级包
- 华硕触摸板驱动和ATK
- i5-8250u_i5-8350u_i7-8550u_i7-8650u 改WIN7 集显
- 人机界面组态软件HMImaker
- 自动化生产线PLC
- STM32触摸按键
- 最完整的威纶通触摸屏培训教程
- PLC与触摸屏程序
- 破解版触摸屏浏览器
- 锦锐触摸单片机CA51F351S6全套DEMO资料
- 威纶通触摸屏说明书461页版
- stm32+触摸屏+红外控制舵机实验
- (Unity)EasyTouch3.16(触摸插件
- 基于百度Ai -- 理解与交互技术UNIT 实现
- 人机交互技术 课件 孟祥旭
- 触摸屏—恢复__Recovery_System.rar
- 台达 触摸屏程序
- MCGS触摸屏新手宝典书签版
- TUIO多点触摸类
- 党务政务公开触摸屏查询系统.rar
- 昆仑通态嵌入式一体化触摸屏TCP7012
- 基于BS818A的八位电容触摸按键方案
- 西门子人机界面触摸屏组态与应用技
评论
共有 条评论