예제 #1
0
        static void SS_CreateSSArea()
        {
            if ((Selection.activeGameObject) == null)
            {
                return;
            }

            bool         isValid = false;
            SS_LevelArea theRect = (Selection.activeGameObject).GetComponent <SS_LevelArea>();

            if (theRect != null)
            {
                isValid = true;
            }

            SS_LevelCanvas theLevel = (Selection.activeGameObject).GetComponent <SS_LevelCanvas>();

            if (theLevel != null)
            {
                isValid = true;
            }

            if (isValid)
            {
                SS_CreateLevelArea(Selection.activeGameObject, "", Random.ColorHSV());
            }
            else
            {
                Debug.Log("Not valid");
            }
        }
예제 #2
0
        public static void CheckForLevelCanvasUpdateInput(GameObject theGO)
        {
            if (Event.current.type == EventType.MouseUp)
            {
                SS_LevelCanvas theLevelCanvas = theGO.gameObject.GetComponentInParent <SS_LevelCanvas>();

                if (theLevelCanvas == null)
                {
                    theLevelCanvas = theGO.gameObject.GetComponent <SS_LevelCanvas>();
                }

                if (theLevelCanvas != null)
                {
                    theLevelCanvas.UpdateChildren();
                }
            }
        }
예제 #3
0
        public static void CheckForSwitchDisplayInput(GameObject theArea)
        {
            Event e = Event.current;

            if (EventType.KeyDown == e.type && KeyCode.R == e.keyCode)
            {
                if (e.modifiers == EventModifiers.Shift)
                {
                    SS_LevelCanvas theLevelCanvas = theArea.gameObject.GetComponentInParent <SS_LevelCanvas>();

                    if (theLevelCanvas == null)
                    {
                        theLevelCanvas = theArea.gameObject.GetComponent <SS_LevelCanvas>();
                    }

                    theLevelCanvas.SwitchLevelCanvasDebugDisplay();
                }
            }
        }
예제 #4
0
        /// <summary>
        /// Action that gets called from child elements to update the level canvas hierarchy
        /// </summary>
        public void SwitchCanvasDisplayMode()
        {
            SS_LevelCanvas theLevelCanvas = gameObject.GetComponentInParent <SS_LevelCanvas>();

            theLevelCanvas.SwitchLevelCanvasDebugDisplay();
        }
예제 #5
0
        /// <summary>
        /// Action that gets called from child elements to update the level canvas hierarchy
        /// </summary>
        public void UpdateLevelCanvas()
        {
            SS_LevelCanvas theLevelCanvas = gameObject.GetComponentInParent <SS_LevelCanvas>();

            theLevelCanvas.UpdateChildren();
        }