Author Topic: Scripting Hierarchy  (Read 1254 times)

basil_11

  • Guest
Scripting Hierarchy
« on: November 08, 2012, 10:47:45 PM »
hi I'm new in NGUI
   can you help me fix my problem.
SCENARIO:
I have scene and it goes like this:
>UI Root(3D)
   >Camera
      >Anchor
      >Panel main
                -have a script named "MainController"
      >Panel Inventory
               -have a script named: "PanelInventoryController"

both script have void start();

-> "MainController" void start() have some codes that "Generates/make CARDS" and savi un ArrayList

-> "PanelMainController void start() "i have some codes inside "PanelInventoryController" that will "Get the list of CARDS" on ArrayList that  "MainController" Generates

>the problem is:
    -> I Always get 0(Zero) CARDS because the "PanelMainController" is always executed firsr before the "MainController"



dlewis

  • Guest
Re: Scripting Hierarchy
« Reply #1 on: November 09, 2012, 12:30:27 AM »
Change the order in which the objects are turned on so that one script runs before another. Or you could change the script execution order  (edit-project-script execution order)

basil_11

  • Guest
Re: Scripting Hierarchy
« Reply #2 on: November 09, 2012, 06:57:58 AM »
That is a big help!!! thanks boss!