Example #1
0
        //REQUIRED END

        public override void DrawWindow(int stepID)
        {
            if (stepID == 1)
            {
                DrawText("First, you have to <b>Enable</b> this addon, for it simply click on the button below:");
#if LOCALIZATION
                DrawText("The addons is already enabled, continue with the next step.\n");
#else
                DrawAddonActivationButton();
#endif
            }
            else if (stepID == 2)
            {
                DrawText("Now you have to <b>integrate</b> the addon content in the required game scenes,\nClick on the button below to see the integration details of each scene:");
                GUILayout.Space(10);

                /* if (sceneList == null)
                 * {
                 *   BuildScenes();
                 * }*/
                if (sceneList != null)
                {
                    DrawMFPSMaps(sceneList.ToArray(), true);
                }

                GUILayout.Space(10);
                using (new MFPSEditorStyles.CenteredScope())
                {
                    if (DrawButton("Refresh Scenes Status", GUILayout.Width(200), GUILayout.Height(20)))
                    {
                        BuildScenes();
                    }
                }
                GUILayout.Space(40);

                using (new MFPSEditorStyles.CenteredScope())
                {
                    if (MFPSEditorStyles.ButtonOutline("INTEGRATE", BLUE_COLOR, GUILayout.Width(200), GUILayout.Height(30)))
                    {
                        if (GetMFPSSceneType() == MFPSSceneType.Lobby)
                        {
                            IntegrateInLobby();
                        }
                        else if (GetMFPSSceneType() == MFPSSceneType.Map)
                        {
                            IntegrateInMap();
                        }
                        BuildScenes();
                    }
                }
                GUILayout.FlexibleSpace();
                DrawText("Once you finish with the integration you are all set!");
            }
        }
Example #2
0
        // Draw the property inside the given rect
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            position.height = EditorGUIUtility.singleLineHeight;
            MFPSEditorStyles.DrawBackground(position, new Color(0, 0, 0, 0.2f));
            property.isExpanded = EditorGUI.Foldout(position, property.isExpanded, label);

            if (!property.isExpanded)
            {
                return;
            }
            position.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
            // Using BeginProperty / EndProperty on the parent property means that
            // prefab override logic works on the entire property.
            EditorGUI.BeginProperty(position, label, property);

            // Don't make child fields be indented
            var indent = EditorGUI.indentLevel;

            EditorGUI.indentLevel = 0;


            var  list = property.FindPropertyRelative("AllWeapons");
            Rect r    = position;

            for (int i = 0; i < list.arraySize; i++)
            {
                var isEnabled = list.GetArrayElementAtIndex(i).FindPropertyRelative("isEnabled");
                GUI.enabled = isEnabled.boolValue;
                r           = position;
                GUI.Box(r, GUIContent.none);
                r.x += 4;
                GUI.Label(r, list.GetArrayElementAtIndex(i).FindPropertyRelative("Name").stringValue);
                if (!isEnabled.boolValue)
                {
                    MFPSEditorStyles.DrawBackground(position, disableColor);
                }
                GUI.enabled = true;
                r.x         = r.width - 25;
                r.width     = 20;
                if (!isEnabled.boolValue)
                {
                    if (GUI.Button(r, GUIContent.none, "OL Plus"))
                    {
                        isEnabled.boolValue = true;
                    }
                }
                else
                {
                    if (GUI.Button(r, GUIContent.none, "OL Minus"))
                    {
                        isEnabled.boolValue = false;
                    }
                }
                position.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
            }
            GUI.enabled = true;
            // Set indent back to what it was
            EditorGUI.indentLevel = indent;

            EditorGUI.EndProperty();
        }