Ejemplo n.º 1
0
        public static void BeginGeneration()
        {
            generating  = true;
            fileChanged = false;
            string currentPath = Application.dataPath;
            int    lastIndex   = currentPath.LastIndexOf('/');

            currentPath = currentPath.Remove(lastIndex, currentPath.Length - lastIndex);


            SteamVR_Input_EditorWindow.SetProgressBarText("Beginning generation...", 0);

            GenerationStep_CreateActionSetClasses();
            GenerationStep_CreateHelperClasses();
            GenerationStep_CreateInitClass();
            GenerationStep_CreateAssemblyDefinition();
            DeleteUnusedScripts();

            if (fileChanged)
            {
                EditorPrefs.SetBool(generationNeedsReloadKey, true);
            }

            AssetDatabase.Refresh();

            SteamVR_Input_EditorWindow.ClearProgressBar();
            generating = false;
        }
        private static void GenerationStep_CreateHelperClasses()
        {
            SteamVR_Input_EditorWindow.SetProgressBarText("Generating actions and actionsets classes...", 0.5f);

            GenerateActionHelpers(steamVRInputActionsClass);
            GenerateActionSetsHelpers(steamVRInputActionSetsClass);

            string actionsFullpath    = Path.Combine(GetClassPath(), steamVRInputActionsClass + ".cs");
            string actionSetsFullpath = Path.Combine(GetClassPath(), steamVRInputActionSetsClass + ".cs");

            Debug.LogFormat("<b>[SteamVR Input]</b> Created input script main classes: {0} and {1}", actionsFullpath, actionSetsFullpath);
        }
        private static void GenerationStep_CreateActionSetClasses()
        {
            SteamVR_Input_EditorWindow.SetProgressBarText("Generating action set classes...", 0.25f);

            SteamVR_Input.InitializeFile();

            CreateActionsSubFolder();

            setClasses = GenerateActionSetClasses();

            Debug.LogFormat("<b>[SteamVR Input]</b> Created input script set classes: {0}", setClasses.Count);
        }
        public static void BeginGeneration()
        {
            generating  = true;
            fileChanged = false;

            SteamVR_Input_EditorWindow.SetProgressBarText("Beginning generation...", 0);

            GenerationStep_CreateActionSetClasses();
            GenerationStep_CreateHelperClasses();
            GenerationStep_CreateInitClass();
            GenerationStep_CreateAssemblyDefinition();
            DeleteUnusedScripts();

            if (fileChanged)
            {
                EditorPrefs.SetBool(generationNeedsReloadKey, true);
            }

            AssetDatabase.Refresh();

            SteamVR_Input_EditorWindow.ClearProgressBar();
            generating = false;
        }