Search Unity

TextMesh Pro Why does TMP add "TMP_SpriteAnimator" Component?

Discussion in 'UGUI & TextMesh Pro' started by CDF, Sep 10, 2019.

  1. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    1,311
    Just noticed today, that *almost* every TMP_Text has this "TMP_SpriteAnimator" Component added.

    * AFAIK, This just seems to be happening on prefab variants that derive from a base prefab containing TMP Text objects.

    Just wondering why this is automatically being added? And if that's expected behaviour?
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    It should not unless you access the "spriteAnimator" property.

    Having said that, I have seen this component added to objects but was never able to figure out how / why.

    I wonder if the Prefab process somehow access this property resulting in this component being added.

    Are you able to reproduce this behavior when creating a new prefab / variant?
     
  3. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    1,311
    Hmm, yeah I'm not accessing the spriteAnimator variable.

    Actually, nevermind, found the issue.
    Recently used this library: https://github.com/yasirkula/UnityAssetUsageDetector
    Which I assume invokes fields/properties using reflection. I guess because it accessed that property, the spriteAnimator component was added!

    My bad. Can close this :)
     
    Stephan_B likes this.