I know that SpawnObject feature has limit to call 1000 times per join.
Now I have tried to make ArrayPool like feature and manage Spawnable-look objects.
but it is so difficult to initialize used game object using VRC_Trigger and some limited unity feature.
so I want to add Object Pool feature to VRCSDK and SpawnObjectFromPool Trigger Action like below:
ObjectPool Component has one prefab property to spawn. and can set max number of live same time in scene.
SpawnObjectFromPool can sets ObjectPool Game Object and spawn transform.
If exceed max number of lives. earliest object will be destroyed (or latest action will do nothing?)
When spawned object is destoyed. Available pool resource will be regained.
And other behavior is same as SpawnObjects.
---
(in Japanese)
SpawnObjectの1000回リミットが辛いので、
リソースを予め用意して配列管理的にオブジェクトを扱うことを試みたのですが、
正直VRC_TriggerとUnityのコンポーネントだけでは、
初期化とか位置設定とかラウンドロビン実装が想像以上に複雑、且つ汎用性も皆無で
精神的にしんどくなりました。
ObjectPoolコンポーネントと、SpawnObjectFromPoolアクションを提案させてください。こんな感じの奴です。:
・ObjectPoolはGameObject1つと、最大生成数の数字プロパティを持ちます。
・SpawnObjectFromPoolトリガーアクションはシーンに存在するObjectPoolを指定し、また、今まで通りSpawn Locationを指定できる。
・挙動としてはSpawnObjectとほとんど同じだが、シーン内に存在するObjectが最大生成数を超える場合は、最も古いオブジェクトが消えるか、最新のActionが何も作らずに終わる。
生成数はSpawnしたObjectがDestroyされると減る。(Poolに空きができる)