这个懒字体现在:这种单例模式只会在第一次使用时才创建事例,而不是应用程序启动时就创建。一种“敌不动我不动”,“催一下动一下”的感觉 它的好处也在于此,因为只有当我们代码中需要用到某个单例模式对象时才会去实例化分配内存。
using System; using System.Collections; using System.Collections.Generic; using UnityEngine; [DisallowMultipleComponent] public class 挂载式的单例<T> : Mon
using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using System.Reflection; public abstract class NoMonoSin
using System.Collections; using System.Collections.Generic; using UnityEngine; public class BaseManager<T> where T:class,new() { private static
//递归写法 public static int Fibonacci(int n) { //这么写得了解问题的最简形式的样子 并且函数本身的调用就是最上层分支 if (n < 2) { return n == 0
using System; namespace Lesson12_委托 { #region 知识点一 委托是什么 //委托是 函数(方法)的容器 //可以理解为表示函数(方法)的变量类型 //用来 存储、传递函数(方法) //委托的本质是一个类,用来定义函