Author Topic: a bug on UICenterOnChild  (Read 1553 times)

qn9663

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
a bug on UICenterOnChild
« on: September 04, 2013, 01:06:00 AM »
   // change by qn
   // first center One GameObject
   // last void OnEnable () { Recenter(); } but mDrag.panel == null
   void OnEnable () { StartCoroutine(YieldStart());}
         
   //first OnEnable can't find mDrag.panel == null
   IEnumerator YieldStart(){
      yield return null;
      Recenter();
   }

   

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: a bug on UICenterOnChild
« Reply #1 on: September 04, 2013, 04:12:14 AM »
Why is it null? You might have a script execution order issue. Just set it to execute after the standard time.