shogo0x2e / BlackHoleBoogie

1 stars 1 forks source link

Added serialized spawning limit #28

Closed Haraldol closed 4 days ago

Haraldol commented 4 days ago

Describe your changes

Issue ticket number and link

Added serilizable field so we can adjust max spawning in unity.

maxObjectCount and currentObjectCount that incements when objects are spawned and decrements when objects are destroyed. A SetSpawner() method is added to AbstractObject to assign the Spawner reference. The OnDestroy() method in AbstractObject calls OnObjectDestroyed() from the spawner when the object is destroyed. When spawning an object in Spawner, the reference to Spawner is passed to the new object.