コード例 #1
0
        public static T Get()
        {
            if (instance == null)
            {
                instance = new ClassObjPool <T>();
                AddInstance(instance);
            }
            T local;

            if (instance.pool.Count > 0)
            {
                local = instance.pool.Dequeue();
            }
            else
            {
                local = Activator.CreateInstance <T>();
            }
            instance.reqSeq++;
            local.usingSeq = instance.reqSeq;
            local.holder   = instance;
            local.OnInit();
            return(local);
        }
コード例 #2
0
 static public FOWRevealer Get()
 {
     return(ClassObjPool <FOWRevealer> .Get());
 }