Search Unity

Question Regarding Object Pooling and Text Effects

Discussion in 'UGUI & TextMesh Pro' started by nventimiglia, Oct 9, 2014.

  1. nventimiglia

    nventimiglia

    Joined:
    Sep 20, 2011
    Posts:
    153
    I have an object pool system that work fine for non UI objects with a standard transform. I wanted to add some pooled objects (effects) with Text components. It looks like these effects require placement inside a canvas (presumably set to world space).

    Would placing my object pool manager inside a canvas be the way to go ? Will this cause problems for my non ui effects with regular transforms ? Has anyone had any issues with mixing rect transforms with regular transforms ?
     
  2. JAKJ

    JAKJ

    Joined:
    Aug 17, 2014
    Posts:
    185
    A rect transform is still a regular transform: It just has the added thing of needing to be inside a canvas for the canvas renderer to work and the rect transform to be adjusted properly. If you are using SetParent after pulling an item from your pool, then it doesn't matter that they're not in a canvas because they will be when you SetParent; If you want them to stay parented how they are, then just put your pool in the canvas with all of them SetActive false, and activate at need.