当类继承与MonoBehaviour时

public class TestSingle : MonoBehaviour

{

public static TestSingle Instance;

void Awake()

{

Instance = this ;

}

}

当类不继承与MonoBehaviour时

public class TestSingle :

{

public static TestSingle instance;

public static TestSingle Instance

{

get

{

if(instance == null)

instance = new TestSingle();

return instance;

}

}

}

最新文章

  1. 关于linux中文乱码的问题。
  2. Redis介绍以及安装(Linux)
  3. NodeJS介绍
  4. Android_listview_scrollListener
  5. iOS动画技术笔记
  6. nginx 目录密码保护的设置方法
  7. Java学习笔记之I/O
  8. @synchronized(self)
  9. Java 中文编码分析
  10. .NET Core装饰模式和.NET Core的Stream
  11. VMware小记
  12. Failed to load ApplicationContext ,Error creating bean with name 'adminUserService': Injection of autowired dependencies failed;
  13. win 10 升级远程连接服务器 要求的函数不受支持
  14. java学习——异常处理
  15. 为什么redis使用单线程还能这么快?
  16. Vue的新启之笔
  17. 【python】基础入门
  18. Delphi按名字调用方法高级解决方案
  19. Java-URLEncoder.encode 什么时候才是必须的
  20. 动态规划:POJ 3616 Milking Time

热门文章

  1. centos6 mini安装图形界面,并vnc远程控制
  2. HTML中dl元素的高度问题
  3. Educational Codeforces Round 22 B. The Golden Age(暴力)
  4. git lfs setpu(4)
  5. 《30天自制操作系统》学习笔记--Mac环境搭建
  6. 在Postman脚本中发送请求(pm.sendRequest)
  7. c 判断一个字符是否为空格
  8. Django基础之命名URL和URL反向解析
  9. Nginx访问非常慢
  10. docker安装Elasticsearch Kibana和Cerebro