CyanPlayerObjectPool icon indicating copy to clipboard operation
CyanPlayerObjectPool copied to clipboard

PlayerObjectPool not automatically created if inspector isnt shown

Open Happyrobot33 opened this issue 2 years ago • 1 comments

If I import a prefab that has a object pool on it but I dont look at the inspector for the pool itself, it will never make the PlayerObjectPool object to initialize the pools. This is an issue when distributing packages that use CyanPlayerObjectPool

Happyrobot33 avatar Oct 16 '23 18:10 Happyrobot33

doing this in CyanPlayerObjectPoolEditor technically works but not sure if im missing anything

[InitializeOnLoadMethod]
private static void Initialize()
{
    // Go through each setup helper and verify their pool size.
    foreach (var helper in FindObjectsOfType<CyanPoolSetupHelper>())
    {
        helper.VerifyPoolSize();
    }
}

Happyrobot33 avatar Oct 16 '23 18:10 Happyrobot33