コード例 #1
0
 private void CleanupFish(Fish f) {
   _collected.Enqueue(f.gameObject);
   if (_collected.Count > MaxFish) {
     // Too many fish, kill the oldest
     Destroy(_collected.Dequeue());
   }
 }
コード例 #2
0
 /// <summary>
 /// Drop a fish into the collector.
 /// </summary>
 /// <param name="f">Fish that was dropped</param>
 public void DropFish(Fish f) {
   f.Release(DropPoint);
   CleanupFish(f);
 }
コード例 #3
0
 /// <summary>
 /// Drop a fish into the collector.
 /// </summary>
 /// <param name="f">Fish that was dropped</param>
 public void DropFish(Fish f)
 {
     f.Release(DropPoint);
     CleanupFish(f);
 }