Author Topic: [Editor] How to call the Selectors?  (Read 1612 times)

Chaosgod_Espér

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 28
    • View Profile
[Editor] How to call the Selectors?
« on: January 29, 2015, 03:10:24 AM »
hi there..

I wanted to know how to call the Atlas Selection window and a Sprite Selector.
I know theres DrawSpriteField, but no documentation about, how to use that, how to write a callback or how to create the atlas selection..

Can someone explain this Editor stuff?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: [Editor] How to call the Selectors?
« Reply #1 on: January 29, 2015, 01:10:24 PM »
What documentation are you expecting? The functions themselves do have a comment above them and all they do is what the function's title suggests: they draw a sprite field. Not sure why you need this to be honest? Most of editor related code was not meant to be used by others.

If you just do a reference search on DrawSpriteField, you will find quite a few places where it's used. UICreateWidgetWizard for example:
  1. NGUIEditorTools.DrawSpriteField("Sprite", "Sprite that will be created", NGUISettings.atlas, NGUISettings.selectedSprite, OnSprite, GUILayout.Width(120f));
OnSprite is the callback function that gets called when the sprite gets selected.