Jump to content

Spawner API improvement idea


AdamBlas
Go to solution Solved by Bryan,

Recommended Posts

Hi, I come with an idea/solution to issue I've had.

Imagine we have code like this:

GeNaSpawner spawner = // ...
spawner.SpawnerData.MinInstances = 100;
spawner.SpawnerData.MaxInstances = 150;
Debug.Log($"Min instances: {spawner.SpawnerData.MinInstances}");

I've noticed some inconsistency in this code. Sometimes, MinInstances would be properly set, but sometimes, it would stay at the value you can see in GeNaSpawner inspector.

After some tesing I've discovered that the reason why MinInstances may not be set to a new value is because new value is greater than MaxInstances. In this case, MinInstances value would stay the same. Then I simply fixed my code like that:

GeNaSpawner spawner = // ...
spawner.SpawnerData.MaxInstances = int.MaxValue;
spawner.SpawnerData.MinInstances = 100;
spawner.SpawnerData.MaxInstances = 150;
Debug.Log($"Min instances: {spawner.SpawnerData.MinInstances}");

While it was easy to fix, it took me too much time to find it.

So, my proposition is to either increase MaxInstances when MinInstances is greater or to put some console warning that assignment operation has failed.

Link to comment
Share on other sites

  • Solution

Hello AdamBlas,

Thank you for bringing this matter to our attention and for dedicating time to troubleshoot and understand this issue.

You're absolutely right, the inconsistencies you've observed when setting MinInstances and MaxInstances can be confusing. We appreciate your idea to improve this mechanism.

I've come up with a possible solution to this, which would involve moving the checks from the properties to the Editor. This way, when adjusting the values via the API, there won't be any unexpected changes.

We'll make sure to review and consider this adjustment in our future updates. Your contribution to enhancing the user experience with GeNa Pro is greatly appreciated!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Tell a friend

    Love Canopy - Procedural Worlds? Tell a friend!
  • Need help?

    We work with some of the biggest brands in global gaming, automotive, technology, and government to create environments, games, simulations, and product launches for desktop, mobile, and VR.

    Our unique expertise and technology enable us to deliver solutions that look and run better at a fraction of the time and cost of a typical project.

    Check out some of our non-NDA work in the Gallery, and then Contact Us to accelerate your next project!

×
×
  • Create New...