void OnEnable() { CanvasController cc = (CanvasController)target; choiceIndex = cc.activeScreenIndex; cc.SetCanvasScreenActive(choiceIndex); }
public void OnSceneGUI() { if (EditorApplication.isPlaying) { return; } Handles.BeginGUI(); EditorGUILayout.LabelField("Active Canvas", EditorStyles.largeLabel); choiceIndex = EditorGUILayout.Popup( choiceIndex, System.Enum.GetNames(typeof(CanvasController.CanvasUIScreen)), GUILayout.Width(140)); CanvasController cc = (CanvasController)target; // Debug.Log("Setting canvas from editor"); cc.SetCanvasScreenActive(choiceIndex); // if (GUILayout.Button("Press Me")) Debug.Log("Got it to work."); Handles.EndGUI(); }