Author Topic: Bug or Feature? UISprite and UIFilledSprite the same?  (Read 3459 times)

ENAY

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 248
    • View Profile
Bug or Feature? UISprite and UIFilledSprite the same?
« on: June 14, 2012, 07:02:38 AM »
Something just caught me out. Ok, so I was going through my objects using GetComponentsInChildren<UIFilledSprite> and I decided to add 2 UISprites in the intention that I could simply get at them quickly with

GetComponentsInChildren<UISprite>()[0]

etc.

Until I found out that no matter which I search for, both types of sprites are in the same list. Is this normal behaviour?
I am thinking that this is a feature.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Bug or Feature? UISprite and UIFilledSprite the same?
« Reply #1 on: June 14, 2012, 07:51:13 AM »
That's polymorphism for you. UIFilledSprite extends UISprite, ergo, all UIFilledSprites are also UISprites.


If all UISprites are listed as UIFilledSprites that's weird though.