Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

PoolManager [By Path-o-logical-Games]

Discussion in 'Assets and Asset Store' started by Rafes, Sep 13, 2011.

  1. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,155
    Is there any issue with existing "pooled" projects when updating to 2.6?
     
  2. Rafes

    Rafes

    Joined:
    Jun 2, 2011
    Posts:
    764
    I didn't have any issues updating our main project or PoolManager test project.

    On another subject, I added some Shuriken content to the example files.
     
  3. Rafes

    Rafes

    Joined:
    Jun 2, 2011
    Posts:
    764
  4. Rafes

    Rafes

    Joined:
    Jun 2, 2011
    Posts:
    764
  5. Rafes

    Rafes

    Joined:
    Jun 2, 2011
    Posts:
    764
    First I want to thank all of you for making PoolManager so great. Your suggestions and feedback, through these forums, our own, and email, have been invaluable!

    PoolManager just turned 1 year old, and has been running bug free for over 7 months!!

    To "celebrate", we released a new tool... TargetPROI

    Here is the TargetPRO thread on these forums.
     
  6. Rafes

    Rafes

    Joined:
    Jun 2, 2011
    Posts:
    764
  7. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,983
    Can you help me with this:

    I want to use a similar function as "destroy self" in Playmaker however there is no such thing as "despawn self" in the Playmaker version.

    How do I set this up?

    Thanks
     
  8. Rafes

    Rafes

    Joined:
    Jun 2, 2011
    Posts:
    764
    Hi, I'm not sure how to do it in PlayMaker, but you should be able to pass "self" (the instance) in to the SpawnPool's Despawn() method. I assume there is an equivilent. If you ask the PlayMaker folks and they can't help, email support@path-o-logical.com and we will follow up and get it sorted out.
     
  9. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,983
    Ok I try some things to see if I can get it working
    Can I despawn objects on trigger collide with a tag?
     
  10. Rafes

    Rafes

    Joined:
    Jun 2, 2011
    Posts:
    764
    I'm not sure what you mean. You can despawn from any script/function. Perhaps if you explain more about the mechanic you are designing?

    Feel free to post to our forums if you want a dedicated thread for your question: support.path-o-logical.com/forums
     
  11. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,983
    I found the way to do it, I put the script on a prefab and it works the way I want, so instead of destroy self, I use the despawn reference form the pool.
     
  12. Rafes

    Rafes

    Joined:
    Jun 2, 2011
    Posts:
    764
  13. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,983
    Assets/Editor/PathologicalGames/Common/PGEditorUtils.cs(746,13): warning CS0168: The variable `content' is declared but never used
     
  14. Rafes

    Rafes

    Joined:
    Jun 2, 2011
    Posts:
    764
  15. Rafes

    Rafes

    Joined:
    Jun 2, 2011
    Posts:
    764
    Hi,

    Be sure to subscribe to the Release Notes thread on our forums by following this link and clicking on "Subscribe Topic" in the upper left. This will notify you of new releases.

    You can also subscribe to the PoolManager forums! While viewing the list of topics in the forums, there is a "Subscribe Forum" link in the upper right.
     
  16. Rafes

    Rafes

    Joined:
    Jun 2, 2011
    Posts:
    764
    Hi all,

    A Tip for nGUI Users

    PoolManager works great with all sprite systems but we found a particularly close fit with nGUI. nGUI likes to have its sprites parented under a UIPanel so just add a PoolManager SpawnPool component to a GameObject with a UIPanel component and everything spawned will automatically be made a child of the SpawnPool and UIPanel.

    For example, our enemy life bars are a sprite, and should be parented under a UIPanel so all of them are still one draw call. All I had to do was drop a SpawnPool component on my UIPanel and hit play. All Life bars were automatically spawned under the panel and everything worked perfectly! Even reloading works as expected!

    Enjoy,
     
  17. Rafes

    Rafes

    Joined:
    Jun 2, 2011
    Posts:
    764
    Hi,

    The folks at PlayMaker have already integrated PoolManager and now TargetPRO is getting the same attention! The two systems already work great together, so we are excited to see what PlayMaker users can do with them!

    TargetPRO and PlayMaker will make an exciting combination. Check out this thread on the PlayMaker forums for information:
    http://hutonggames.com/playmakerfor...8b1kbqb0abt5d8dmr6&topic=2078.msg9135#msg9135

    Also, if you are already a PoolManager user and want to get TargetPRO at a 20% discount, simply email support@path-o-logical.com and we will get you a discount coupon!
     
  18. Rafes

    Rafes

    Joined:
    Jun 2, 2011
    Posts:
    764
    Hi all,

    We just released PoolManager 2.7 with some great new features! This is available for those who purchased directly from our website. I will post again when it is available in the AssetStore.

    As always, the release notes are updated on our forums here:
    http://forums.support.path-o-logical.com/viewtopic.php?f=3&t=31&p=202#p202

    SpawnPools now have two new options:http://docs.poolmanager.path-o-logical.com/

    Match Pool Scale
    When an instance is initially created, it will be scaled relative to the Spawn Pool's GameObject. This is great for sprite-based GUI systems, such as nGUI, which often uses a small scale.​

    Match Pool Layer
    When an instance is initially created, it's layer will be set to match Spawn Pool's GameObject. ​

    PrefabPool limiting has been extended with this new option:http://docs.poolmanager.path-o-logical.com/home/per-prefab-options

    Limit FIFO
    With this option on, the number of instances will still be limited, but instead of stopping spawns and returning null, PoolManager will continue to spawn new instances by first despawning old ones. The instance is chosen on a First-In-First-Out (FIFO) basis.​


    The next planned release will be PoolManager3.0 with Unity4x support!
     
  19. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,155
    Good news.

    Rafes, I am getting this error:

    SpawnPool projectiles: laserprefab(Clone)010 has already been despawned. You cannot despawn something more than once!
    UnityEngine.Debug:LogError(Object)


    Is there any function in Pool Manager to check if an object has already been despawned?
    My problem is because I need the projectile (laserprefab) to be despawned if collided with something or if a time count has expired...
     
    Last edited: Sep 2, 2012
  20. Rafes

    Rafes

    Joined:
    Jun 2, 2011
    Posts:
    764
    Hi, that IS PoolManger's check. It is telling you that you called Despawn() on that instance already. It shouldnt break anything but you should be able to clean it up. This usually happens when a co-routine or physics event and some other trigger call despawn code in the same frame. There is a "race situation" in your code somewhere.
     
  21. Rafes

    Rafes

    Joined:
    Jun 2, 2011
    Posts:
    764
    PoolManager 2.7 is now available in the AssetStore!
     
  22. jrDev

    jrDev

    Joined:
    Nov 5, 2008
    Posts:
    1,745
    Hello, I am trying to figure out how to use the OnDespawned event. So I create a script with OnDespawn event, attach it to the prefab to be pooled. The problem I am getting is an error because OnDespawned is being called when the instance is initially created then despawned...How do I use OnDespawned properly?
     
  23. Rafes

    Rafes

    Joined:
    Jun 2, 2011
    Posts:
    764
    Hi,

    OnDespawned is essentially the same as Unity's OnDisable, except that it is only triggered by PoolManager whereas OnDisable will run anytime a gameObject is disabled.

    In the future, PoolManager may have an option to "despawn" by moving an object in off in to space, as opposed to disabiling a gameObject (again, this will be an option). In this case, OnDisable would never be triggered, making OnSpawned and OnDespawned a more critical.

    For help with your specific issue, please start a thread on our forums with some more detail about your error:
    http://support.path-o-logical.com/forums

    Here is the direct address for the future. The one above has the search feature and doc links though:
    http://forums.support.path-o-logical.com/index.php
     
  24. jrDev

    jrDev

    Joined:
    Nov 5, 2008
    Posts:
    1,745
  25. Breakmachine

    Breakmachine

    Joined:
    Sep 19, 2009
    Posts:
    39
    Hi Rafes

    Im having trouble using FIFO in combination with ParticleSystem prefabs. I'm only spawing the item once and not trying to despawn it myself.

    SpawnPool Bullets: BulletSpark(Clone)001 has already been despawned. You cannot despawn something more than once!
    UnityEngine.Debug:LogError(Object)
    SpawnPool:Despawn(Transform) (at Assets/Plugins/PathologicalGames/PoolManager/SpawnPool.cs:638)
    <ListenForEmitDespawn>c__Iterator3:MoveNext() (at Assets/Plugins/PathologicalGames/PoolManager/SpawnPool.cs:833)
     
  26. Rafes

    Rafes

    Joined:
    Jun 2, 2011
    Posts:
    764
    Hi Breakmachine,

    I started a thread on our forums for your issue here: http://forums.support.path-o-logical.com/viewtopic.php?f=3&t=1321

    I will reply there as soon as possible. I believe we already have a fix for this but I need to run a test later to be sure.

    Thank you for the report!
     
  27. Breakmachine

    Breakmachine

    Joined:
    Sep 19, 2009
    Posts:
    39
    Thanks Rafes. That hides the error.
     
  28. jrDev

    jrDev

    Joined:
    Nov 5, 2008
    Posts:
    1,745
    Hey Rafes, Unity4 warnings fix please?
     
  29. Rafes

    Rafes

    Joined:
    Jun 2, 2011
    Posts:
    764
    Coming this week!
     
  30. Rafes

    Rafes

    Joined:
    Jun 2, 2011
    Posts:
    764
    To make things easier we jumped a version... so...



    PoolManager 4.0 is now available for our direct users. It has been submitted to the Asset Store and I will reply again when I get the email that it is available.

    - Unity 4 support for the fastest PoolManager yet!
    - New overload method for Pools.Create() that creates a SpawnPool on a given GameObject. The original version created the GameObject. See the docs here: http://docs.poolmanager.path-o-logi...ager/poolmanager-pools/poolmanager-createpool.

    As usual, the release notes are here: http://forums.support.path-o-logical.com/viewtopic.php?f=3&t=31&p=202#p202
    The main forums page with awesome search feature is here: http://support.path-o-logical.com/forums
     
    Last edited: Nov 22, 2012
  31. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,155
    Ok, but is PoolManager 4 completelly compatible with existing projects (working in U4) using previous version?
     
  32. Rafes

    Rafes

    Joined:
    Jun 2, 2011
    Posts:
    764
    Absolutely! The updates are entirely internal. There is nothing you have to do except install it.
     
  33. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,307
    Rafes, I can't download this. I get the following message:

    "The re-download limit for this item has been exceeded. If you have questions about this error message, please contact customerservice@esellerate.net"

    How do I get the update? I bought it before it was on the Asset Store and have already upgraded a few times by downloading newer versions.
     
  34. Rafes

    Rafes

    Joined:
    Jun 2, 2011
    Posts:
    764
    If you bought it through the Asset Store you'll have to wait for them to approve the new release and download it there.

    If you bought it through us, and got "a download limit" message, just email support@path-o-logical.com with your order number and we can reset the limit back to 0.
     
  35. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,307
    Ok thanks Rafe. I've deleted all the old files, reimported and I'm getting a script error:

    Assets/Plugins/PathologicalGames/PoolManager/SpawnPool.cs(809,37): error CS1061: Type `UnityEngine.GameObject' does not contain a definition for `activeInHierarchy' and no extension method `activeInHierarchy' of type `UnityEngine.GameObject' could be found (are you missing a using directive or an assembly reference?)

    Is this supposed to be compilable in Unity 3.5.6? If not, how do I get V 2.7? I think I'm one version back from that.
     
  36. Rafes

    Rafes

    Joined:
    Jun 2, 2011
    Posts:
    764

    No. We changed the version to 4.0 specifically to sync with Unity's major version. It is only compatible with Unity 4x. Note the release note here: http://forums.support.path-o-logical.com/viewtopic.php?f=3&t=31

    There is no need to upgrade unless you switch to Unity 4. Aside from the new overload method mentioned.

    Also, you shouldn't need to delete old files when updating the package.

    If you'd like a specific version package, please email support@path-o-logical.com with your order info and I can email it to you directly.
     
  37. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,307
    I'm on V 2.6 - There were a couple other updates before this one. So I want to grab the last non-4 version. How do I get it?
     
  38. Rafes

    Rafes

    Joined:
    Jun 2, 2011
    Posts:
    764
    Please email support@path-o-logical.com with your order info and I can email it to you directly.
     
  39. Rafes

    Rafes

    Joined:
    Jun 2, 2011
    Posts:
    764
    PoolManager 4 for Unity 4 is now available in the AssetStore!
     
  40. MaDDoX

    MaDDoX

    Joined:
    Nov 10, 2009
    Posts:
    761
    Rafes, just as a suggestion, wouldn't you consider adding some preprocessor directives to the code so the new versions are also compatible with Unity 3.5?
    That's what I did in RageTools and it worked fine, not much work at all:

    Code (csharp):
    1. #if UNITY_4_0
    2.                 thisTransform.gameObject.SetActive(false);
    3.             currentGroup.SetActive(false);
    4. #else
    5.                 thisTransform.gameObject.active = false;
    6.             currentGroup.active = false;
    7. #endif
    If you use those commands often you can even have a helper method for object activation, and just add one directive within it. This will keep the code clean and legible. The only gotcha is that you'll also have to upload the version from 3.5.x to the asset store, but unless you got new / updated scenes in the package that's usually just a case of copying the .cs files over to a second project, created in 3.5.

    Just my $0.02, good luck!
     
  41. Rafes

    Rafes

    Joined:
    Jun 2, 2011
    Posts:
    764
    That's a great idea. (Thought I'd have to find the old version of Unity and install it). Version 4 is really just a port of version 2.7 that was stable for months, so I think I'll wait to see if there is a situation where I need to provide a fix, in which case I can do this instead of branching.

    Thanks for the post!
     
  42. MaDDoX

    MaDDoX

    Joined:
    Nov 10, 2009
    Posts:
    761
    Sorry that I didn't express myself clearly, I meant you havo to upload the 3.5 code to the asset store *from* a Unity 3.5 installation. You can have both in your systems without a problem, just make sure to install in a different directory, for instance 'program files(x86)/Unity4'.

    Being a component dev myself, I think it's worth it going the extra mileage to prevent noise and the case-by-case support overhead.
    Cheers :)
     
  43. dsfds

    dsfds

    Joined:
    Aug 19, 2012
    Posts:
    16
    Is there any ways to do a automatically override instantiate/destroy instead of using instantiate/destroy.
     
  44. Rafes

    Rafes

    Joined:
    Jun 2, 2011
    Posts:
    764
    Please explain. I don't understand the question.
     
  45. dsfds

    dsfds

    Joined:
    Aug 19, 2012
    Posts:
    16
    oops,
    Is there any ways to do a automatically override instantiate/destroy instead of using " Spawn/Despawn"

    like automatically mapping the instantiate to spawn without any code changes.
     
  46. Rafes

    Rafes

    Joined:
    Jun 2, 2011
    Posts:
    764
    I'm not sure. I try to avoid ambitious remapping. I think this is more about .Net than PoolManager. Sorry I can't be of more help.
     
  47. Crazy Robot

    Crazy Robot

    Joined:
    Apr 18, 2009
    Posts:
    921
    Hello,

    I'm on Unity 3.5.6 and I'm using PM2.7, I'm seeing a very long delay between Awake and Start when I preload 20 objects. If I reduce the number down to 1, it loads very fast.

    Any help?

    Thanks.
     
  48. Rafes

    Rafes

    Joined:
    Jun 2, 2011
    Posts:
    764
    I wouldn't expect Start() to run at all during pre-loading. In fact, I've seen cases where it never runs. Are you sure Start() is running before you spawn something?

    (This might be better to support on our forums at http://support.path-o-logical.com/forums)
     
  49. Crazy Robot

    Crazy Robot

    Joined:
    Apr 18, 2009
    Posts:
    921
    Sorry, it's not my spawn objects that are running Start, it's the Poolmanager itself.

    here is what happens with about 20 objects.

    This only happens on the device (iPhone)

    when the scene first loads awake is called and then start. between awake and start is a very long delay. so in my troubleshooting, I reduced the amount in the poolmanager Object from 20 to 1, there is no longer a delay when the scene starts.

    I don't spawn anything for about 10 seconds after the scene loads. the delay is before I call to spawn.

    Thanks,

    JL
     
  50. Rafes

    Rafes

    Joined:
    Jun 2, 2011
    Posts:
    764
    I have about 8 pools spawning several hundred objects and I don't notice any delay on my iPhone4s.

    Did you try preloading an empty GameObject with no scripts to be sure it is PoolManager itself and not an issue with your prefab or other system?

    I'm not sure how to proceed except to ask that you send me a stripped down project that I can debug.
     
unityunity