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"); } }
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(); } } }
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(); } } }
/// <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(); }
/// <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(); }