protected virtual void DrawObjectsElement(Rect rect, int index, bool isActive, bool isFocused)
            {
                EditorGUIUtility.fieldWidth = 50f;

                SerializedProperty prefab   = objects.GetPropertyOfIndex(index, "prefab");
                SerializedProperty position = objects.GetPropertyOfIndex(index, "position");
                SerializedProperty rotation = objects.GetPropertyOfIndex(index, "rotation");
                SerializedProperty scale    = objects.GetPropertyOfIndex(index, "scale");

                EditorGUI.BeginChangeCheck();
                prefab.objectReferenceValue = EditorGUI.ObjectField(GUIArea.ProgressLine(ref rect), "Prefab", prefab.objectReferenceValue, typeof(GameObject), false);
                if (EditorGUI.EndChangeCheck())
                {
                    serializedObject.ApplyModifiedPropertiesWithoutUndo();

                    ForAllTargets((MultiPrefab target) => target.objects[index].Instantiate(target.transform));
                }

                EditorGUI.BeginChangeCheck();
                EditorGUI.PropertyField(GUIArea.ProgressLine(ref rect), position);
                EditorGUI.PropertyField(GUIArea.ProgressLine(ref rect), rotation);
                EditorGUI.PropertyField(GUIArea.ProgressLine(ref rect), scale);
                if (EditorGUI.EndChangeCheck())
                {
                    serializedObject.ApplyModifiedPropertiesWithoutUndo();

                    ForAllTargets((MultiPrefab target) => target.objects[index].UpdateInstanceCoords());
                }
            }
Exemple #2
0
            void DrawPlatformsPreviewElement(Rect rect, int index, bool isActive, bool isFocused)
            {
                SerializedProperty platform = platformsList.preview.GetArrayElement(index);

                GUIArea.Progress(ref rect, GUIArea.LayoutOffset / 2);

                EditorGUI.PropertyField(GUIArea.ProgressLine(ref rect), platform, new GUIContent("Platform " + (index + 1)));
            }
            public static void Draw(ref Rect rect, SerializedProperty property)
            {
                SerializedProperty name  = property.FindPropertyRelative("name");
                SerializedProperty asset = property.FindPropertyRelative("asset");

                asset.objectReferenceValue = EditorGUI.ObjectField(GUIArea.ProgressLine(ref rect), property.displayName, asset.objectReferenceValue, typeof(SceneAsset), false);

                name.stringValue = asset.objectReferenceValue ? asset.objectReferenceValue.name : "";
            }
Exemple #4
0
        protected override void DrawDefaultElement(Rect rect, int index, bool isActive, bool isFocused)
        {
            string label = ElementNameGetter(GetArrayElement(index));

            if (label == string.Empty)
            {
                label = "--------";
            }

            EditorGUI.LabelField(GUIArea.ProgressLine(ref rect), label);
        }
Exemple #5
0
            void DrawPlatformsElement(Rect rect, int index, bool isActive, bool isFocused)
            {
                SerializedProperty name   = platformsList.main.GetPropertyOfIndex(index, "name");
                SerializedProperty module = platformsList.main.GetPropertyOfIndex(index, "module");

                GUIArea.ProgressLayout(ref rect);

                name.stringValue = EditorGUI.TextField(GUIArea.ProgressLine(ref rect), "Name", name.stringValue);

                module.objectReferenceValue = EditorGUI.ObjectField(GUIArea.ProgressLine(ref rect), platformsList.main.serializedProperty.displayName, module.objectReferenceValue, target.ModuleType, false);
            }
            public override void OnGUI(Rect rect, SerializedProperty property, GUIContent label)
            {
                InitProperty(property);

                label.text = property.displayName;

                EnabledValue = EditorGUI.ToggleLeft(GUIArea.ProgressLine(ref rect), label, EnabledValue);

                if (EnabledValue)
                {
                    DrawValue(ref rect, property, label);
                }
            }
        public virtual void Draw(ref Rect rect)
        {
            if (HasChildern)
            {
                PropertyExpanded = EditorGUI.Foldout(GUIArea.ProgressLine(ref rect), PropertyExpanded, Label);

                if (PropertyExpanded)
                {
                    DrawChildern(ref rect);
                }
            }
            else
            {
                EditorGUI.PropertyField(GUIArea.ProgressLine(ref rect), Property);
            }
        }
Exemple #8
0
 protected virtual void DrawDefaultSingleElements(Rect rect, int index, bool isActive, bool isFocused, SerializedProperty property)
 {
     EditorGUI.PropertyField(GUIArea.ProgressLine(ref rect), property);
 }
 public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
 {
     EditorGUI.PropertyField(GUIArea.ProgressLine(ref position), GetValueProperty(property), new GUIContent(property.displayName), true);
 }