Exemple #1
0
        // Use this for initialization
        void Start()
        {
            this.getDebugCamera     = ToolbeltManager.FirstInstance.sceneCamera.GetComponent <GetDebugCamera>();
            this.optionalGlobalsGUI = ToolbeltManager.FirstInstance.sceneCamera.gameObject;
            this.SceneRoot          = ToolbeltManager.FirstInstance.transform;


            this.itemMenu = new ItemMenu(new Rect(LEFT_OFFSET, TAB_HEIGHT + TOP_OFFSET, this.width, this.height - TAB_HEIGHT), this.SceneRoot, this.dropSkin);
            //this.dropDownList = new DebugDropDownList(new Rect (0, TAB_HEIGHT,this.width/2,this.height-TAB_HEIGHT), this.SceneRoot);
            //this.dropDownList.dropSkin = this.dropSkin;
            //this.itemViewer = new DebugItemViewer(new Rect(this.width/2, TAB_HEIGHT,this.width/2,this.height-TAB_HEIGHT));

            this.globalsViewer = new DebugGlobalsMenu(new Rect(LEFT_OFFSET, TAB_HEIGHT + TOP_OFFSET, this.width / 2, this.height - TAB_HEIGHT), this.getDebugCamera, this.optionalGlobalsGUI);
            this.saveMenu      = new SaveMenu(new Rect(LEFT_OFFSET, TAB_HEIGHT + TOP_OFFSET, this.width / 2, this.height - TAB_HEIGHT), this.SceneRoot.gameObject, this.RefreshRootObject);

            this.debugTabs[0] = this.itemMenu;
            this.debugTabs[1] = this.globalsViewer;
            this.debugTabs[2] = new DebugTabMenu();     // STUB
            this.debugTabs[3] = this.saveMenu;
        }
        // Use this for initialization
        public DebugGlobalsMenu(Rect canvas, GetDebugCamera getDebugCamera, GameObject otherGlobalsGameObject)
        {
            this.canvas = canvas;
            this.getDebugCamera = getDebugCamera;

            if (otherGlobalsGameObject != null)
            {
            MonoBehaviour[] potentials = otherGlobalsGameObject.GetComponents<MonoBehaviour>();
            foreach (MonoBehaviour mb in potentials)
            {
                if (mb == null) continue;

                icDebugGUI toAdd = mb as icDebugGUI; //returns null if monobehaviour is not an icDebugGUI
                if (toAdd != null)
                {
                    otherGlobals.Add(toAdd);
                }
            }
            }
        }
        // Use this for initialization

        public DebugGlobalsMenu(Rect canvas, GetDebugCamera getDebugCamera, GameObject otherGlobalsGameObject)
        {
            this.canvas         = canvas;
            this.getDebugCamera = getDebugCamera;

            if (otherGlobalsGameObject != null)
            {
                MonoBehaviour[] potentials = otherGlobalsGameObject.GetComponents <MonoBehaviour>();
                foreach (MonoBehaviour mb in potentials)
                {
                    if (mb == null)
                    {
                        continue;
                    }

                    icDebugGUI toAdd = mb as icDebugGUI;             //returns null if monobehaviour is not an icDebugGUI
                    if (toAdd != null)
                    {
                        otherGlobals.Add(toAdd);
                    }
                }
            }
        }
        // Use this for initialization
        void Start()
        {
            this.getDebugCamera = ToolbeltManager.FirstInstance.sceneCamera.GetComponent<GetDebugCamera>();
            this.optionalGlobalsGUI = ToolbeltManager.FirstInstance.sceneCamera.gameObject;
            this.SceneRoot = ToolbeltManager.FirstInstance.transform;

            this.itemMenu = new ItemMenu(new Rect(LEFT_OFFSET, TAB_HEIGHT+TOP_OFFSET, this.width,this.height - TAB_HEIGHT), this.SceneRoot, this.dropSkin);
            //this.dropDownList = new DebugDropDownList(new Rect (0, TAB_HEIGHT,this.width/2,this.height-TAB_HEIGHT), this.SceneRoot);
            //this.dropDownList.dropSkin = this.dropSkin;
            //this.itemViewer = new DebugItemViewer(new Rect(this.width/2, TAB_HEIGHT,this.width/2,this.height-TAB_HEIGHT));

            this.globalsViewer = new DebugGlobalsMenu(new Rect(LEFT_OFFSET, TAB_HEIGHT+TOP_OFFSET,this.width/2,this.height-TAB_HEIGHT), this.getDebugCamera, this.optionalGlobalsGUI);
            this.saveMenu = new SaveMenu(new Rect(LEFT_OFFSET,TAB_HEIGHT+TOP_OFFSET,this.width/2,this.height-TAB_HEIGHT),this.SceneRoot.gameObject,this.RefreshRootObject);

            this.debugTabs[0] = this.itemMenu;
            this.debugTabs[1] = this.globalsViewer;
            this.debugTabs[2] = new DebugTabMenu(); // STUB
            this.debugTabs[3] = this.saveMenu;
        }