Exemple #1
0
 public ProfilePool(int size)
 {
     for (var i = 0; i < size; i++)
     {
         freeProfiles.AddFirst(new Profile( ));
     }
 }
Exemple #2
0
        private Profile GetProfile()
        {
            var profile = freeProfiles.First.Value;

            if (profile == null)
            {
                profile = new Profile( );
            }
            usedProfiles.AddFirst(profile);
            UnityEngine.Debug.Assert(Count < 1000);
            return(profile);
        }