コード例 #1
0
        // =================================================================================
        // Display.
        // ---------------------------------------------------------------------------------
        public new void OnGUI()
        {
            // Draw common stuff for all editors
            base.OnGUI();

            UpdateMgr();
            // Nothing to be drawn until we are fully initialized.
            if (!IsInitialized() || IStorage == null)
            {
                // Tell the user that we can display without a behavior or library.
                ShowNotification(new GUIContent("No iCanScript component selected !!!"));
                myNotificationShown = true;
                return;
            }

            // Remove any previously shown notification.
            if (myNotificationShown)
            {
                RemoveNotification();
                myNotificationShown = false;
            }

            var toolbarRect = ShowToolbar();
            var frameArea   = new Rect(0, toolbarRect.height, position.width, position.height - toolbarRect.height);

            myMainView.Display(frameArea);
            ProcessEvents(frameArea);
            // Make new selection visible
            if (mySelectedAreaCache != myController.SelectedArea)
            {
                mySelectedAreaCache = myController.SelectedArea;
                myMainView.MakeVisible(mySelectedAreaCache, frameArea);
            }
        }
コード例 #2
0
        // =================================================================================
        // Display.
        // ---------------------------------------------------------------------------------
        /// Displays the editor window and processes the user events.
        public new void OnGUI()
        {
            // -- Wait until library fully loaded. --
            if (!LibraryController.IsLibraryLoaded)
            {
                ShowNotification(new GUIContent("Waiting for library to load..."));
                return;
            }
            RemoveNotification();

            // -- Initialize the display controller. --
            if (!IsInitialized())
            {
                return;
            }

            // -- Draw the base stuff for all windows --
            base.OnGUI();

            // -- Show toolbar --
            var toolbarRect = ShowToolbar();

            myScrollViewArea = new Rect(0, toolbarRect.height, position.width, position.height - toolbarRect.height);

            // -- Show library content --
            myMainView.Display(myScrollViewArea);
            ProcessEvents(myScrollViewArea);
//          // -- Make new selection visible --
//          if(mySelectedAreaCache != myController.SelectedArea) {
//              mySelectedAreaCache= myController.SelectedArea;
//              myMainView.MakeVisible(mySelectedAreaCache, myScrollViewArea);
//          }
        }