Insanely huge initial commit

This commit is contained in:
2026-02-21 17:04:05 -08:00
parent 9cdd36191a
commit 613d75914a
22525 changed files with 4035207 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
/*
* Credit to:
* http://blog.boredmormongames.com/2014/08/object-pooling.html
*/
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
namespace Com.LuisPedroFonseca.ProCamera2D.TopDownShooter
{
public class Pool : MonoBehaviour
{
public GameObject thing;
private List<GameObject> things = new List<GameObject>();
public GameObject nextThing
{
get
{
if (things.Count < 1)
{
GameObject newClone = (GameObject)Instantiate(thing);
newClone.transform.parent = transform;
newClone.SetActive(false);
things.Add(newClone);
PoolMember poolMember = newClone.AddComponent<PoolMember>();
poolMember.pool = this;
}
GameObject clone = things[0];
things.RemoveAt(0);
clone.SetActive(true);
return clone;
}
set
{
value.SetActive(false);
things.Add(value);
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: fdbbe6350bcb6474aab904b9d0ae5883
timeCreated: 1443708212
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,20 @@
/*
* Credit to:
* http://blog.boredmormongames.com/2014/08/object-pooling.html
*/
using UnityEngine;
using System.Collections;
namespace Com.LuisPedroFonseca.ProCamera2D.TopDownShooter
{
public class PoolMember : MonoBehaviour
{
public Pool pool;
void OnDisable()
{
pool.nextThing = gameObject;
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 2f0ed1897ab02461183d3c6e6b981f44
timeCreated: 1443708255
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: