Esempio n. 1
0
        public bool OnGUI()
        {
            bool reInitialize = false;

            EditorGUILayout.HelpBox(projectSpecifier != null ? string.Format(moduleProjectSpecifierHelp, projectSpecifierModuleName) : noModuleProjectSpecifierHelp, MessageType.Info);
            GUITools.Space();

            if (projectSpecifier != null)
            {
                EditorGUILayout.LabelField("Current Module:", GUITools.boldLabel);
                EditorGUILayout.LabelField(projectSpecifierModuleName);

                if (!string.IsNullOrEmpty(exportWarnings))
                {
                    EditorGUILayout.HelpBox(exportWarnings, MessageType.Warning);
                    GUITools.Space();
                }

                GUITools.Space();

                // show export options
                EditorGUILayout.LabelField("Exporting:", GUITools.boldLabel);
                EditorGUILayout.BeginHorizontal();
                if (GUILayout.Button("Export"))
                {
                    if (DoExport(false))
                    {
                        reInitialize = true;
                    }
                }
                if (GUILayout.Button("Export And Upgrade"))
                {
                    if (DoExport(true))
                    {
                        reInitialize = true;
                    }
                }
                EditorGUILayout.EndHorizontal();
            }
            else
            {
                // create a new module project specifier
                if (GUILayout.Button("Create Module Project Specifier"))
                {
                    ModuleProjectSpecifier specifier = AssetTools.CreateScriptableObject <ModuleProjectSpecifier>(defaultSpecifierPath);
                    Selection.activeObject = specifier;
                    EditorGUIUtility.PingObject(specifier);
                    Debug.Log("Created Module Project Specifier at: " + defaultSpecifierPath);
                    reInitialize = true;
                }
            }
            return(reInitialize);
        }
Esempio n. 2
0
        public GenericGamepadProfile CreateNewGamepadProfile(string name)
        {
            string dir  = InputManager.fullResourcesDirectory + GamepadHandler.gamepadProfilesResourcesDirectory;
            string path = dir + "/" + name + ".asset";

            int x = 0;

            while (System.IO.File.Exists(path))
            {
                path = dir + "/" + name + x.ToString() + ".asset";
                x++;
            }

            GenericGamepadProfile profile = AssetTools.CreateScriptableObject <GenericGamepadProfile>(path, true);

            NewProfile(profile);

            return(profile);
        }