File tree Expand file tree Collapse file tree
com.meta.tutorial.framework Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66using System . Text . RegularExpressions ;
77using Meta . Tutorial . Framework . Hub . UIComponents ;
88using Meta . Tutorial . Framework . Hub . Utilities ;
9+ using Meta . Tutorial . Framework . Windows ;
910using UnityEditor ;
1011using UnityEngine ;
1112using UnityEngine . Networking ;
@@ -37,6 +38,12 @@ public void GenerateAllSubContexts()
3738 }
3839 }
3940
41+ [ ContextMenu ( "Toggle Edit Mode" ) ]
42+ private void ToggleEditMode ( )
43+ {
44+ TutorialFrameworkHub . ToggleEditTutorials ( ) ;
45+ }
46+
4047 [ Serializable ]
4148 public class Banner
4249 {
Original file line number Diff line number Diff line change @@ -71,21 +71,26 @@ protected override void OnEnable()
7171 // Devs who want to author new tutorials should manually add "META_EDIT_TUTORIALS" to the project's Scripting Define Symbols.
7272 /*
7373 [MenuItem("Meta/Tutorial Hub/Toggle Edit Tutorials/Enable", priority = 1)]
74+ */
7475 private static void EnableEditTutorials ( )
7576 {
7677 ToggleEditTutorials ( true ) ;
7778 }
78- */
7979
8080#if META_EDIT_TUTORIALS
8181 [ MenuItem ( "Meta/Tutorial Hub/Edit Tutorials/Disable" , priority = 2 ) ]
8282#endif
83- private static void DisableEditTutorials ( )
83+ internal static void DisableEditTutorials ( )
8484 {
8585 ToggleEditTutorials ( false ) ;
8686 }
8787
88- private static void ToggleEditTutorials ( bool bEnabled )
88+ internal static void ToggleEditTutorials ( )
89+ {
90+ ToggleEditTutorials ( ! IsEditModeEnabled ( ) ) ;
91+ }
92+
93+ internal static void ToggleEditTutorials ( bool bEnabled )
8994 {
9095 // add EDIT_TUTORIALS to the list of defines
9196 var defines = PlayerSettings . GetScriptingDefineSymbolsForGroup ( EditorUserBuildSettings . selectedBuildTargetGroup ) ;
@@ -101,6 +106,12 @@ private static void ToggleEditTutorials(bool bEnabled)
101106 }
102107 }
103108
109+ internal static bool IsEditModeEnabled ( )
110+ {
111+ var defines = PlayerSettings . GetScriptingDefineSymbolsForGroup ( EditorUserBuildSettings . selectedBuildTargetGroup ) ;
112+ return defines . Contains ( "META_EDIT_TUTORIALS" ) ;
113+ }
114+
104115#if META_EDIT_TUTORIALS
105116 [ MenuItem ( "Meta/Tutorial Hub/Edit Tutorials/Regenerate All Configs" , priority = 2 ) ]
106117#endif
Original file line number Diff line number Diff line change 11{
22 "name" : " com.meta.tutorial.framework" ,
3- "version" : " 1.0.5 " ,
3+ "version" : " 1.0.6 " ,
44 "displayName" : " Meta Tutorial Framework" ,
55 "description" : " Core components for creating in-editor tutorials and documentation." ,
66 "hideInEditor" : false
You can’t perform that action at this time.
0 commit comments