浏览代码

Pool Cleanup (#147)

Removed space from asset filename
Move LocalPoolTester from Assets to the Example folder
Renamed ComponentPool to ComponentPoolSO to match naming convention
/main
GitHub 4 年前
当前提交
136bad1f
共有 10 个文件被更改,包括 4 次插入4 次删除
  1. 2
      UOP1_Project/Assets/Scripts/Pool/Example/Assets/SharedGlobalParticlePool.asset
  2. 2
      UOP1_Project/Assets/Scripts/Pool/Example/ParticlePoolSO.cs
  3. 2
      UOP1_Project/Assets/Scripts/Pool/ComponentPoolSO.cs
  4. 2
      UOP1_Project/Assets/Scripts/Pool/ComponentPoolSO.cs.meta
  5. 0
      /UOP1_Project/Assets/Scripts/Pool/Example/Assets/SharedGlobalParticlePool.asset.meta
  6. 0
      /UOP1_Project/Assets/Scripts/Pool/Example/Assets/SharedGlobalParticlePool.asset
  7. 0
      /UOP1_Project/Assets/Scripts/Pool/ComponentPoolSO.cs
  8. 0
      /UOP1_Project/Assets/Scripts/Pool/ComponentPoolSO.cs.meta
  9. 0
      /UOP1_Project/Assets/Scripts/Pool/Example/LocalPoolTester.cs
  10. 0
      /UOP1_Project/Assets/Scripts/Pool/Example/LocalPoolTester.cs.meta

2
UOP1_Project/Assets/Scripts/Pool/Example/Assets/SharedGlobalParticlePool.asset


m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 485377a59a3f4fc4b9618f557ab57b6f, type: 3}
m_Name: Shared GlobalParticlePool
m_Name: SharedGlobalParticlePool
m_EditorClassIdentifier:
_factory: {fileID: 11400000, guid: ca185e564147672458eeabb1f9080925, type: 2}
_initialPoolSize: 5

2
UOP1_Project/Assets/Scripts/Pool/Example/ParticlePoolSO.cs


using UOP1.Factory;
[CreateAssetMenu(fileName = "NewParticlePool", menuName = "Pool/Particle Pool")]
public class ParticlePoolSO : ComponentPool<PoolableParticle>
public class ParticlePoolSO : ComponentPoolSO<PoolableParticle>
{
[SerializeField]
private ParticleFactorySO _factory;

2
UOP1_Project/Assets/Scripts/Pool/ComponentPoolSO.cs


/// Implements a Pool for Component types.
/// </summary>
/// <typeparam name="T">Specifies the component to pool.</typeparam>
public abstract class ComponentPool<T> : PoolSO<T> where T : Component, IPoolable
public abstract class ComponentPoolSO<T> : PoolSO<T> where T : Component, IPoolable
{
public abstract int InitialPoolSize { get; set; }
private GameObject _poolRootObject;

2
UOP1_Project/Assets/Scripts/Pool/ComponentPoolSO.cs.meta


fileFormatVersion: 2
guid: cf67ce39a704c6842aa23316769815b9
guid: f70709d2336a8d0408dc6b0d703f9639
MonoImporter:
externalObjects: {}
serializedVersion: 2

/UOP1_Project/Assets/Scripts/Pool/Example/Assets/Shared GlobalParticlePool.asset.meta → /UOP1_Project/Assets/Scripts/Pool/Example/Assets/SharedGlobalParticlePool.asset.meta

/UOP1_Project/Assets/Scripts/Pool/Example/Assets/Shared GlobalParticlePool.asset → /UOP1_Project/Assets/Scripts/Pool/Example/Assets/SharedGlobalParticlePool.asset

/UOP1_Project/Assets/Scripts/Pool/ComponentPool.cs → /UOP1_Project/Assets/Scripts/Pool/ComponentPoolSO.cs

/UOP1_Project/Assets/Scripts/Pool/ComponentPool.cs.meta → /UOP1_Project/Assets/Scripts/Pool/ComponentPoolSO.cs.meta

/UOP1_Project/Assets/LocalPoolTester.cs → /UOP1_Project/Assets/Scripts/Pool/Example/LocalPoolTester.cs

/UOP1_Project/Assets/LocalPoolTester.cs.meta → /UOP1_Project/Assets/Scripts/Pool/Example/LocalPoolTester.cs.meta

正在加载...
取消
保存