Beispiel #1
0
    static void Init()
    {
        EasyMotionForceSlidersSetupWindow window = (EasyMotionForceSlidersSetupWindow)EditorWindow.GetWindow(typeof(EasyMotionForceSlidersSetupWindow));

        window.Show();
        window.titleContent = new GUIContent("Force Sliders Setup", "Select the sliders the player will use to control the amount of Pitch/Roll forces produced.");
        window.minSize      = new Vector2(300, 400);
        window.maxSize      = new Vector2(300, 900);
    }
 private void DrawForceSlidersStep()
 {
     DrawLogoBox();
     this.titleContent = new GUIContent("3/3 Setup Wizard");
     EditorGUILayout.Space();
     EditorGUILayout.LabelField("3/3   Force Slider References", GetWelcomeStyle());
     EditorGUILayout.LabelField("You may wish to give your player some level of control over how much Pitch and Roll forces the plugin will create." +
                                "If so, you can assign 2 sliders which will act as overall multipliers.", GetTextAreaStyle());
     EditorGUILayout.Space();
     EditorGUILayout.Space();
     EditorGUILayout.Space();
     EditorGUILayout.LabelField("1. Platform On/Off Toggle Reference \u221A", GetListItemStyle(FontStyle.Normal, green));
     EditorGUILayout.LabelField("2. Serial Port COM Dropdown Reference \u221A", GetListItemStyle(FontStyle.Normal, green));
     EditorGUILayout.LabelField("3. Force Slider References (Optional)", GetListItemStyle(FontStyle.Bold, Color.black));
     EditorGUILayout.LabelField("4. Rigidbody Reference (Final)", GetListItemStyle(FontStyle.Bold, Color.black));
     GUILayout.FlexibleSpace();
     EditorGUILayout.BeginHorizontal(GetButtonStyle());
     if (GUILayout.Button("Select Sliders", skin.button))
     {
         finishWizard = true;
         if (!FoundSliderController())
         {
             EasyMotionForceSlidersSetupWindow window = GetWindow <EasyMotionForceSlidersSetupWindow>(typeof(EasyMotionInitialSetup));
             window.Show();
             window.titleContent = new GUIContent("Sliders Setup", "Select the sliders the player will use to control produced forces.");
             window.minSize      = new Vector2(300, 400);
             window.maxSize      = new Vector2(300, 900);
         }
     }
     if (GUILayout.Button("Skip", skin.button))
     {
         finishWizard      = true;
         skippedSliderStep = true;
     }
     try
     {
         if (GUILayout.Button("Cancel", skin.button))
         {
             if (EditorUtility.DisplayDialog("EasyMotion - Configuration Wizard", "All assigned elements will be reset.\n\nAre you sure you wish to exit the wizard?", "Ok", "Cancel"))
             {
                 DestroyAllScripts();
                 this.Close();
             }
         }
         EditorGUILayout.EndHorizontal();
     }
     catch (Exception) { }
 }