Browse Source

Implemented feature, but needs commenting before finishing

feature/Minesweeper
DESKTOP-B4ME9GF\Joshua Reason 6 years ago
parent
commit
b0e7e1f753
11 changed files with 172 additions and 1 deletions
  1. +1
    -1
      Assets/Editor Add On.meta
  2. +8
    -0
      Assets/Editor Add On/Custom Attributes.meta
  3. +8
    -0
      Assets/Editor Add On/Custom Attributes/Hide in Prefab.meta
  4. +8
    -0
      Assets/Editor Add On/Custom Attributes/Hide in Prefab/Examples.meta
  5. +19
    -0
      Assets/Editor Add On/Custom Attributes/Hide in Prefab/Examples/HideInPrefabExample.cs
  6. +11
    -0
      Assets/Editor Add On/Custom Attributes/Hide in Prefab/Examples/HideInPrefabExample.cs.meta
  7. +58
    -0
      Assets/Editor Add On/Custom Attributes/Hide in Prefab/Examples/HideInPrefabExample.prefab
  8. +8
    -0
      Assets/Editor Add On/Custom Attributes/Hide in Prefab/Examples/HideInPrefabExample.prefab.meta
  9. +8
    -0
      Assets/Editor Add On/Custom Attributes/Hide in Prefab/Scripts.meta
  10. +32
    -0
      Assets/Editor Add On/Custom Attributes/Hide in Prefab/Scripts/HideInPrefabAttribute.cs
  11. +11
    -0
      Assets/Editor Add On/Custom Attributes/Hide in Prefab/Scripts/HideInPrefabAttribute.cs.meta

Assets/Editor/Editor AddOn.meta → Assets/Editor Add On.meta View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 1eba5231ebd032b4db5d58d699e0f0de
guid: 7a8bfbd0555f21048abd1415f2c47893
folderAsset: yes
DefaultImporter:
externalObjects: {}

+ 8
- 0
Assets/Editor Add On/Custom Attributes.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 040e0c0ec80bb52409744b03671df838
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 8
- 0
Assets/Editor Add On/Custom Attributes/Hide in Prefab.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f134e8ccabae44c45b14bad67978a30b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 8
- 0
Assets/Editor Add On/Custom Attributes/Hide in Prefab/Examples.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: affc4046c2a5111479cf285e82bedb4f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 19
- 0
Assets/Editor Add On/Custom Attributes/Hide in Prefab/Examples/HideInPrefabExample.cs View File

@ -0,0 +1,19 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class HideInPrefabExample : MonoBehaviour {
[Header ("Drag Me into scene to show hidden properties.")]
[HideInPrefab]
public float HiddenFloat = 5; //Hidden in prefab inspector
public float ShownFloat = 6; //Not hidden in prefab inspector
[HideInInspector]
public float AlwaysHiddenFloat = 7; //Always hidden (Unity's default implementation)
[HideInPrefab]
public GameObject HiddenGameObject; //Hidden in Prefab inspector
public GameObject ShownGameObject; //NotHidden in Prefab inspector
}

+ 11
- 0
Assets/Editor Add On/Custom Attributes/Hide in Prefab/Examples/HideInPrefabExample.cs.meta View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b3a8b00c985891a448737258d9b09ede
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

+ 58
- 0
Assets/Editor Add On/Custom Attributes/Hide in Prefab/Examples/HideInPrefabExample.prefab View File

@ -0,0 +1,58 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1839211675386134}
m_IsPrefabParent: 1
--- !u!1 &1839211675386134
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4904693562653106}
- component: {fileID: 114800799608557334}
m_Layer: 0
m_Name: HideInPrefabExample
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4904693562653106
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1839211675386134}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &114800799608557334
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1839211675386134}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b3a8b00c985891a448737258d9b09ede, type: 3}
m_Name:
m_EditorClassIdentifier:
HiddenFloat: 5
ShownFloat: 6
AlwaysHiddenFloat: 7
HiddenGameObject: {fileID: 0}
ShownGameObject: {fileID: 0}

+ 8
- 0
Assets/Editor Add On/Custom Attributes/Hide in Prefab/Examples/HideInPrefabExample.prefab.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3e4c28a2ff8a30f4da1d96c254a14fc5
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:

+ 8
- 0
Assets/Editor Add On/Custom Attributes/Hide in Prefab/Scripts.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5629afcda35004c4d99c76bde4f4eeb7
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 32
- 0
Assets/Editor Add On/Custom Attributes/Hide in Prefab/Scripts/HideInPrefabAttribute.cs View File

@ -0,0 +1,32 @@
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
public class HideInPrefabAttribute : PropertyAttribute
{
}
[CustomPropertyDrawer(typeof(HideInPrefabAttribute))]
public class HideInPrefabDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
PrefabType type = PrefabUtility.GetPrefabType(property.serializedObject.targetObject);
if (type != PrefabType.Prefab)
EditorGUI.PropertyField(position, property, label);
}
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
{
PrefabType type = PrefabUtility.GetPrefabType(property.serializedObject.targetObject);
if (type == PrefabType.Prefab)
return 0;
return base.GetPropertyHeight(property, label);
}
}

+ 11
- 0
Assets/Editor Add On/Custom Attributes/Hide in Prefab/Scripts/HideInPrefabAttribute.cs.meta View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7ffee7f5af11da344ae52c6c92cce67c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Loading…
Cancel
Save