├── .gitattributes ├── .gitignore ├── .vsconfig ├── Assets ├── Gizmos.meta ├── Gizmos │ ├── MyScript Gizmo.png │ └── MyScript Gizmo.png.meta ├── Unity-Attributes-Example.meta └── Unity-Attributes-Example │ ├── 0.Extensions.meta │ ├── 0.Extensions │ ├── AssemblyExtensions.cs │ └── AssemblyExtensions.cs.meta │ ├── 0.Utilities.meta │ ├── 0.Utilities │ ├── ApplicationUtility.cs │ ├── ApplicationUtility.cs.meta │ ├── Editor.meta │ └── Editor │ │ ├── UnityAttributeUtility.cs │ │ └── UnityAttributeUtility.cs.meta │ ├── 1.AddComponentMenu.meta │ ├── 1.AddComponentMenu │ ├── AddComponentMenuExample.cs │ └── AddComponentMenuExample.cs.meta │ ├── 10.DisallowMultipleComponent.meta │ ├── 10.DisallowMultipleComponent │ ├── DisallowMultipleComponentExample.cs │ └── DisallowMultipleComponentExample.cs.meta │ ├── 11.ExcludeFromObjectFactory.meta │ ├── 11.ExcludeFromObjectFactory │ ├── Editor.meta │ ├── Editor │ │ ├── ExcludeFromObjectFactoryExampleEditor.cs │ │ └── ExcludeFromObjectFactoryExampleEditor.cs.meta │ ├── ExcludeFromObjectFactoryExample.cs │ ├── ExcludeFromObjectFactoryExample.cs.meta │ ├── ObjectFactoryExample.cs │ ├── ObjectFactoryExample.cs.meta │ ├── Presets.meta │ └── Presets │ │ ├── ExcludeFromObjectFactoryExample.preset │ │ ├── ExcludeFromObjectFactoryExample.preset.meta │ │ ├── ObjectFactoryExample.preset │ │ └── ObjectFactoryExample.preset.meta │ ├── 12.ExcludeFromPreset.meta │ ├── 12.ExcludeFromPreset │ ├── Editor.meta │ ├── Editor │ │ ├── ExcludeFromPresetExampleEditor.cs │ │ └── ExcludeFromPresetExampleEditor.cs.meta │ ├── ExcludeFromPresetExample.asset │ ├── ExcludeFromPresetExample.asset.meta │ ├── ExcludeFromPresetExample.cs │ ├── ExcludeFromPresetExample.cs.meta │ ├── ExcludeFromPresetExample.preset │ └── ExcludeFromPresetExample.preset.meta │ ├── 13.ExecuteAlways.meta │ ├── 13.ExecuteAlways │ ├── ExecuteAlwaysExample.cs │ └── ExecuteAlwaysExample.cs.meta │ ├── 14.ExecuteInEditMode.meta │ ├── 14.ExecuteInEditMode │ ├── PrintAwake.cs │ └── PrintAwake.cs.meta │ ├── 15.GradientUsage.meta │ ├── 15.GradientUsage │ ├── GradientUsageExample.cs │ └── GradientUsageExample.cs.meta │ ├── 16.GUITarget.meta │ ├── 16.GUITarget │ ├── GUITargetExample.cs │ ├── GUITargetExample.cs.meta │ ├── GUITargetExample.unity │ └── GUITargetExample.unity.meta │ ├── 17.Header.meta │ ├── 17.Header │ ├── HeaderExample.cs │ └── HeaderExample.cs.meta │ ├── 18.HelpURL.meta │ ├── 18.HelpURL │ ├── HelpURLExample.cs │ └── HelpURLExample.cs.meta │ ├── 19.HideInInspector.meta │ ├── 19.HideInInspector │ ├── HideInInspectorExample.cs │ └── HideInInspectorExample.cs.meta │ ├── 2.AssemblyIsEditorAssembly.meta │ ├── 2.AssemblyIsEditorAssembly │ ├── AssemblyIsEditorAssemblyExample.asmdef │ ├── AssemblyIsEditorAssemblyExample.asmdef.meta │ ├── AssemblyIsEditorAssemblyExample.cs │ └── AssemblyIsEditorAssemblyExample.cs.meta │ ├── 20.Multiline.meta │ ├── 20.Multiline │ ├── MultilineExample.cs │ └── MultilineExample.cs.meta │ ├── 21.PreferBinarySerialization.meta │ ├── 21.PreferBinarySerialization │ ├── PreferBinarySerializationExample.asset │ ├── PreferBinarySerializationExample.asset.meta │ ├── PreferBinarySerializationExample.cs │ └── PreferBinarySerializationExample.cs.meta │ ├── 22.Range.meta │ ├── 22.Range │ ├── RangeExample.cs │ └── RangeExample.cs.meta │ ├── 23.RequireComponent.meta │ ├── 23.RequireComponent │ ├── RequireComponentExample.cs │ └── RequireComponentExample.cs.meta │ ├── 24.RuntimeInitializeOnLoadMethod.meta │ ├── 24.RuntimeInitializeOnLoadMethod │ ├── RuntimeInitializeOnLoadMethodExample.cs │ └── RuntimeInitializeOnLoadMethodExample.cs.meta │ ├── 25.SelectionBase.meta │ ├── 25.SelectionBase │ ├── SelectionBaseExample.cs │ ├── SelectionBaseExample.cs.meta │ ├── SelectionBaseExample.unity │ └── SelectionBaseExample.unity.meta │ ├── 26.SerializeField.meta │ ├── 26.SerializeField │ ├── SerializeFieldExample.cs │ └── SerializeFieldExample.cs.meta │ ├── 27.SharedBetweenAnimators.meta │ ├── 27.SharedBetweenAnimators │ ├── SharedBetweenAnimatorsExample.controller │ ├── SharedBetweenAnimatorsExample.controller.meta │ ├── SharedBetweenAnimatorsExample.cs │ ├── SharedBetweenAnimatorsExample.cs.meta │ ├── SharedBetweenAnimatorsExample.prefab │ ├── SharedBetweenAnimatorsExample.prefab.meta │ ├── SharedBetweenAnimatorsExample.unity │ ├── SharedBetweenAnimatorsExample.unity.meta │ ├── SharedBetweenAnimatorsExample2.prefab │ ├── SharedBetweenAnimatorsExample2.prefab.meta │ ├── SharedBetweenAnimatorsExampleCounter.cs │ ├── SharedBetweenAnimatorsExampleCounter.cs.meta │ ├── SharedBetweenAnimatorsExample_idle.anim │ ├── SharedBetweenAnimatorsExample_idle.anim.meta │ ├── SharedBetweenAnimatorsExample_move.anim │ └── SharedBetweenAnimatorsExample_move.anim.meta │ ├── 28.Space.meta │ ├── 28.Space │ ├── SpaceExample.cs │ └── SpaceExample.cs.meta │ ├── 29.TextArea.meta │ ├── 29.TextArea │ ├── TextAreaExample.cs │ └── TextAreaExample.cs.meta │ ├── 3.BeforeRenderOrder.meta │ ├── 3.BeforeRenderOrder │ ├── BeforeRenderOrderExample.cs │ └── BeforeRenderOrderExample.cs.meta │ ├── 30.Tooltip.meta │ ├── 30.Tooltip │ ├── TooltipExample.cs │ └── TooltipExample.cs.meta │ ├── 31.UnityAPICompatibilityVersion.meta │ ├── 31.UnityAPICompatibilityVersion │ ├── UnityAPICompatibilityVersionExample.asmdef │ ├── UnityAPICompatibilityVersionExample.asmdef.meta │ ├── UnityAPICompatibilityVersionExample.cs │ └── UnityAPICompatibilityVersionExample.cs.meta │ ├── 32.FormerlySerializedAs.meta │ ├── 32.FormerlySerializedAs │ ├── FormerlySerializedAsExample.cs │ ├── FormerlySerializedAsExample.cs.meta │ ├── FormerlySerializedAsExample.prefab │ └── FormerlySerializedAsExample.prefab.meta │ ├── 33.CanEditMultipleObjects.meta │ ├── 33.CanEditMultipleObjects │ ├── CanEditMultipleObjectsExample.cs │ ├── CanEditMultipleObjectsExample.cs.meta │ ├── Editor.meta │ └── Editor │ │ ├── CanEditMultipleObjectsExampleEditor.cs │ │ └── CanEditMultipleObjectsExampleEditor.cs.meta │ ├── 34.CustomPreview.meta │ ├── 34.CustomPreview │ ├── Editor.meta │ ├── Editor │ │ ├── MyObjectPreview.cs │ │ └── MyObjectPreview.cs.meta │ ├── MyObject.cs │ └── MyObject.cs.meta │ ├── 35.CustomPropertyDrawer.meta │ ├── 35.CustomPropertyDrawer │ ├── AttackBehaviour.cs │ ├── AttackBehaviour.cs.meta │ ├── Attributes.meta │ ├── Attributes │ │ ├── TabEnumAttribute.cs │ │ └── TabEnumAttribute.cs.meta │ ├── Editor.meta │ ├── Editor │ │ ├── EquipmentAbilityDrawer.cs │ │ ├── EquipmentAbilityDrawer.cs.meta │ │ ├── TabEnumAttributeDrawer.cs │ │ └── TabEnumAttributeDrawer.cs.meta │ ├── EquipmentSystem.meta │ └── EquipmentSystem │ │ ├── Enums.meta │ │ ├── Enums │ │ ├── EquipmentAbilityType.cs │ │ ├── EquipmentAbilityType.cs.meta │ │ ├── EquipmentType.cs │ │ └── EquipmentType.cs.meta │ │ ├── Equipment.cs │ │ ├── Equipment.cs.meta │ │ ├── EquipmentAbility.cs │ │ ├── EquipmentAbility.cs.meta │ │ ├── EquipmentEffect.cs │ │ ├── EquipmentEffect.cs.meta │ │ ├── EquipmentGroup.cs │ │ ├── EquipmentGroup.cs.meta │ │ ├── EquipmentSystem.cs │ │ ├── EquipmentSystem.cs.meta │ │ ├── EquipmentSystem.unity │ │ ├── EquipmentSystem.unity.meta │ │ ├── EquipmentSystemSettings.lighting │ │ └── EquipmentSystemSettings.lighting.meta │ ├── 36.DrawGizmo.meta │ ├── 36.DrawGizmo │ ├── DrawGizmoExample.mat │ ├── DrawGizmoExample.mat.meta │ ├── DrawGizmoExample.unity │ ├── DrawGizmoExample.unity.meta │ ├── Editor.meta │ ├── Editor │ │ ├── MyScriptGizmoDrawer.cs │ │ └── MyScriptGizmoDrawer.cs.meta │ ├── MyScript.cs │ └── MyScript.cs.meta │ ├── 37.InitializeOnLoad.meta │ ├── 37.InitializeOnLoad │ ├── Editor.meta │ └── Editor │ │ ├── InitializeOnLoadExample.cs │ │ └── InitializeOnLoadExample.cs.meta │ ├── 38.OnOpenAsset.meta │ ├── 38.OnOpenAsset │ ├── Editor.meta │ └── Editor │ │ ├── OnOpenAssetExample.cs │ │ └── OnOpenAssetExample.cs.meta │ ├── 39.PostProcessBuild.meta │ ├── 39.PostProcessBuild │ ├── Editor.meta │ └── Editor │ │ ├── PostProcessBuildExample.cs │ │ └── PostProcessBuildExample.cs.meta │ ├── 4.ColorUsage.meta │ ├── 4.ColorUsage │ ├── ColorUsageExample.cs │ └── ColorUsageExample.cs.meta │ ├── 40.PostProcessScene.meta │ ├── 40.PostProcessScene │ ├── Editor.meta │ ├── Editor │ │ ├── PostProcessSceneExample.cs │ │ └── PostProcessSceneExample.cs.meta │ ├── PostProcessSceneExample.unity │ ├── PostProcessSceneExample.unity.meta │ ├── TestLoadScene.cs │ └── TestLoadScene.cs.meta │ ├── 41.GridPaintSorting.meta │ ├── 41.GridPaintSorting │ ├── README.md │ ├── README.md.meta │ ├── gridpaintsorting.jpg │ └── gridpaintsorting.jpg.meta │ ├── 42.MenuItem.meta │ ├── 42.MenuItem │ ├── Editor.meta │ ├── Editor │ │ ├── MenuTest.cs │ │ └── MenuTest.cs.meta │ ├── MenuItemExample.unity │ ├── MenuItemExample.unity.meta │ ├── MenuItemExampleSettings.lighting │ └── MenuItemExampleSettings.lighting.meta │ ├── 43.SettingsProvider.meta │ ├── 43.SettingsProvider │ ├── Editor.meta │ └── Editor │ │ ├── MyCustomSettings.asset │ │ ├── MyCustomSettings.asset.meta │ │ ├── MyCustomSettings.cs │ │ ├── MyCustomSettings.cs.meta │ │ ├── MyPreferencesProvider.cs │ │ ├── MyPreferencesProvider.cs.meta │ │ ├── settings_ui.cs │ │ ├── settings_ui.cs.meta │ │ ├── settings_ui.uss │ │ ├── settings_ui.uss.meta │ │ ├── settings_ui.uxml │ │ └── settings_ui.uxml.meta │ ├── 44.Icon.meta │ ├── 44.Icon │ ├── IconExample.cs │ ├── IconExample.cs.meta │ ├── 未标题-1.png │ └── 未标题-1.png.meta │ ├── 45.InspectorName.meta │ ├── 45.InspectorName │ ├── InspectorNameExample.cs │ └── InspectorNameExample.cs.meta │ ├── 46.Min.meta │ ├── 46.Min │ ├── MinExample.cs │ └── MinExample.cs.meta │ ├── 47.NonReorderable.meta │ ├── 47.NonReorderable │ ├── NonReorderableExample.cs │ └── NonReorderableExample.cs.meta │ ├── 48.SearchContext.meta │ ├── 48.SearchContext │ ├── SearchContextExample.cs │ └── SearchContextExample.cs.meta │ ├── 49.InitializeOnEnterPlay.meta │ ├── 49.InitializeOnEnterPlay │ ├── Editor.meta │ └── Editor │ │ ├── InitializeOnEnterPlayExample.cs │ │ └── InitializeOnEnterPlayExample.cs.meta │ ├── 5.ContextMenu.meta │ ├── 5.ContextMenu │ ├── ContextMenuExample.cs │ └── ContextMenuExample.cs.meta │ ├── 50.FilePath.meta │ ├── 50.FilePath │ ├── Editor.meta │ └── Editor │ │ ├── FilePathExample.txt │ │ ├── FilePathExample.txt.meta │ │ ├── MySingleton.cs │ │ └── MySingleton.cs.meta │ ├── 51.CustomEditor.meta │ ├── 51.CustomEditor │ ├── CustomEditorExample.cs │ ├── CustomEditorExample.cs.meta │ ├── CustomEditorExample2.cs │ ├── CustomEditorExample2.cs.meta │ ├── Editor.meta │ └── Editor │ │ ├── CustomEditorExampleEditor.cs │ │ └── CustomEditorExampleEditor.cs.meta │ ├── 52.DidReloadScripts.meta │ ├── 52.DidReloadScripts │ ├── Editor.meta │ └── Editor │ │ ├── DidReloadScriptsExample.cs │ │ └── DidReloadScriptsExample.cs.meta │ ├── 6.ContextMenuItem.meta │ ├── 6.ContextMenuItem │ ├── ContextMenuItemExample.cs │ └── ContextMenuItemExample.cs.meta │ ├── 7.CreateAssetMenu.meta │ ├── 7.CreateAssetMenu │ ├── CreateAssetMenuExample.asset │ ├── CreateAssetMenuExample.asset.meta │ ├── CreateAssetMenuExample.cs │ └── CreateAssetMenuExample.cs.meta │ ├── 8.CustomGridBrush.meta │ ├── 8.CustomGridBrush │ ├── CustomGridBrushExample.asset │ ├── CustomGridBrushExample.asset.meta │ ├── CustomGridBrushExample.png │ ├── CustomGridBrushExample.png.meta │ ├── CustomGridBrushExample.unity │ ├── CustomGridBrushExample.unity.meta │ ├── CustomGridBrushExampleSettings.lighting │ ├── CustomGridBrushExampleSettings.lighting.meta │ ├── Editor.meta │ ├── Editor │ │ ├── CustomGridBrushExample.cs │ │ └── CustomGridBrushExample.cs.meta │ ├── New Palette.prefab │ └── New Palette.prefab.meta │ ├── 9.Delayed.meta │ ├── 9.Delayed │ ├── DelayedExample.cs │ ├── DelayedExample.cs.meta │ ├── Editor.meta │ └── Editor │ │ ├── DelayedExampleEditor.cs │ │ └── DelayedExampleEditor.cs.meta │ ├── Unity-Attributes-Example.unity │ ├── Unity-Attributes-Example.unity.meta │ ├── Unity-Attributes-ExampleSettings.lighting │ └── Unity-Attributes-ExampleSettings.lighting.meta ├── LICENSE ├── Packages ├── manifest.json └── packages-lock.json ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── PackageManagerSettings.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── SceneTemplateSettings.json ├── TagManager.asset ├── TimeManager.asset ├── UnityConnectSettings.asset ├── VFXManager.asset ├── VersionControlSettings.asset └── XRSettings.asset ├── README.md └── img ├── 11.gif ├── 12.gif ├── 16.gif ├── 21.gif ├── 22.gif ├── 23.gif ├── 25.gif ├── 27.gif ├── 30.gif ├── 32.gif ├── 33.gif ├── 34.gif ├── 36.gif ├── 38.gif ├── 46.gif ├── 47.gif ├── 50.gif ├── Xnip2021-06-20_14-16-01.png ├── Xnip2021-06-20_14-25-19.png ├── Xnip2021-06-20_14-52-41.png ├── Xnip2021-06-20_15-10-29.png ├── Xnip2021-06-20_15-24-35.png ├── Xnip2021-06-20_15-31-15.png ├── Xnip2021-06-20_15-35-28.png ├── Xnip2021-06-20_15-39-03.png ├── Xnip2021-06-20_17-04-13.png ├── Xnip2021-06-20_17-24-22.png ├── Xnip2021-06-20_17-26-33.png ├── Xnip2021-06-20_18-07-44.png ├── Xnip2021-06-20_19-44-08.png ├── Xnip2021-06-20_19-59-50.png ├── Xnip2021-06-20_20-36-37.png ├── Xnip2021-06-20_21-45-19.png ├── Xnip2021-06-20_22-27-49.png ├── assemblyIseditorassembly.gif ├── beforerenderorder.jpg ├── colorusage1.jpg ├── colorusage2.jpg ├── contextmenu.gif ├── contextmenuitem.gif ├── createassetmenu.gif ├── customgridbrush.gif ├── delayed.gif ├── disallowmultiplecomponent.gif ├── gridpaintsorting1.jpg ├── gridpaintsorting2.jpg └── gridpaintsorting3.jpg /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # This .gitignore file should be placed at the root of your Unity project directory 2 | # 3 | # Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore 4 | # 5 | /[Ll]ibrary/ 6 | /[Tt]emp/ 7 | /[Oo]bj/ 8 | /[Bb]uild/ 9 | /[Bb]uilds/ 10 | /[Ll]ogs/ 11 | /[Mm]emoryCaptures/ 12 | 13 | # Never ignore Asset meta data 14 | !/[Aa]ssets/**/*.meta 15 | 16 | # Uncomment this line if you wish to ignore the asset store tools plugin 17 | # /[Aa]ssets/AssetStoreTools* 18 | 19 | # TextMesh Pro files 20 | [Aa]ssets/TextMesh*Pro/ 21 | 22 | # Autogenerated Jetbrains Rider plugin 23 | [Aa]ssets/Plugins/Editor/JetBrains* 24 | 25 | # Visual Studio cache directory 26 | .vs/ 27 | 28 | # Gradle cache directory 29 | .gradle/ 30 | 31 | # Autogenerated VS/MD/Consulo solution and project files 32 | ExportedObj/ 33 | .consulo/ 34 | *.csproj 35 | *.unityproj 36 | *.sln 37 | *.suo 38 | *.tmp 39 | *.user 40 | *.userprefs 41 | *.pidb 42 | *.booproj 43 | *.svd 44 | *.pdb 45 | *.mdb 46 | *.opendb 47 | *.VC.db 48 | 49 | # Unity3D generated meta files 50 | *.pidb.meta 51 | *.pdb.meta 52 | *.mdb.meta 53 | 54 | # Unity3D generated file on crash reports 55 | sysinfo.txt 56 | 57 | # Builds 58 | *.apk 59 | *.unitypackage 60 | 61 | # Crashlytics generated file 62 | crashlytics-build.properties 63 | 64 | /UserSettings 65 | 66 | .DS_Store 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /.vsconfig: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "components": [ 4 | "Microsoft.VisualStudio.Workload.ManagedGame" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /Assets/Gizmos.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 86f268a7f20d3438ab1034ce51ed3dc9 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Gizmos/MyScript Gizmo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/Assets/Gizmos/MyScript Gizmo.png -------------------------------------------------------------------------------- /Assets/Gizmos/MyScript Gizmo.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 435b40b863e194101a4507758d8f8f29 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 10 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: 0 35 | aniso: 1 36 | mipBias: 0 37 | wrapU: 0 38 | wrapV: 0 39 | wrapW: 0 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 44 | spriteExtrude: 1 45 | spriteMeshType: 0 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 0 51 | alphaUsage: 1 52 | alphaIsTransparency: 0 53 | spriteTessellationDetail: -1 54 | textureType: 8 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 3 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 2048 64 | resizeAlgorithm: 0 65 | textureFormat: 4 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | forceMaximumCompressionQuality_BC6H_BC7: 0 73 | - serializedVersion: 3 74 | buildTarget: Standalone 75 | maxTextureSize: 2048 76 | resizeAlgorithm: 0 77 | textureFormat: 4 78 | textureCompression: 1 79 | compressionQuality: 50 80 | crunchedCompression: 0 81 | allowsAlphaSplitting: 0 82 | overridden: 0 83 | androidETC2FallbackOverride: 0 84 | forceMaximumCompressionQuality_BC6H_BC7: 0 85 | spriteSheet: 86 | serializedVersion: 2 87 | sprites: [] 88 | outline: 89 | - - {x: -2, y: -2} 90 | - {x: -2, y: 2} 91 | - {x: 2, y: 2} 92 | - {x: 2, y: -2} 93 | physicsShape: 94 | - - {x: -2, y: -2} 95 | - {x: -2, y: 2} 96 | - {x: 2, y: 2} 97 | - {x: 2, y: -2} 98 | bones: [] 99 | spriteID: 5e97eb03825dee720800000000000000 100 | internalID: 0 101 | vertices: [] 102 | indices: 103 | edges: [] 104 | weights: [] 105 | secondaryTextures: [] 106 | spritePackingTag: 107 | pSDRemoveMatte: 0 108 | pSDShowRemoveMatteOption: 0 109 | userData: 110 | assetBundleName: 111 | assetBundleVariant: 112 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a2a8074ce8df7427b9ec2776710e50b8 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/0.Extensions.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dacf6f44597c84428b28ede8e766378f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/0.Extensions/AssemblyExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | using System; 6 | using System.Reflection; 7 | 8 | namespace UnityAttributesExample { 9 | 10 | public static class AssemblyExtensions { 11 | 12 | public static bool IsEditorAssembly(this Assembly assembly) { 13 | return Attribute.IsDefined(assembly, typeof(UnityEngine.AssemblyIsEditorAssembly)); 14 | } 15 | 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/0.Extensions/AssemblyExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ebee85821c39645c486f69c24770a989 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/0.Utilities.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 399a1765f67b240f9abc1c3c0683fb72 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/0.Utilities/ApplicationUtility.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | public static class ApplicationUtility { 8 | 9 | public static void Quit() { 10 | Application.Quit(); 11 | #if UNITY_EDITOR 12 | UnityEditor.EditorApplication.isPlaying = false; 13 | #endif 14 | } 15 | 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/0.Utilities/ApplicationUtility.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ff70713de822a44169e267bb2dba7ee4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/0.Utilities/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 580748ea5317f4490bdd1a765e65edd8 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/0.Utilities/Editor/UnityAttributeUtility.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c3264b73fd2964279a0fd428a8bfa055 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/1.AddComponentMenu.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6cf427c48a29446838edb98d79e038b8 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/1.AddComponentMenu/AddComponentMenuExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | // The AddComponentMenu attribute allows you to place a script anywhere in the "Component" menu, 8 | // instead of just the "Component->Scripts" menu. 9 | // You use this to organize the Component menu better, 10 | // this way improving workflow when adding scripts. 11 | // 12 | // Important notice: You need to restart. 13 | 14 | [AddComponentMenu("Unity-Atrributes-Example/Add Component Menu Example")] 15 | public class AddComponentMenuExample : MonoBehaviour { 16 | 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/1.AddComponentMenu/AddComponentMenuExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4da44b47075054378a97779765fe03ba 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/10.DisallowMultipleComponent.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b0b6610a588114264aab14f9cde22693 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/10.DisallowMultipleComponent/DisallowMultipleComponentExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | // Prevents MonoBehaviour of same type (or subtype) to be added more than once to a GameObject. 8 | 9 | [DisallowMultipleComponent] 10 | public class DisallowMultipleComponentExample : MonoBehaviour { 11 | 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/10.DisallowMultipleComponent/DisallowMultipleComponentExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: da8883ffbfff640c6973d39053834977 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/11.ExcludeFromObjectFactory.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3989729f0b86e4338b2e0de8a337351a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/11.ExcludeFromObjectFactory/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 55fb46ec379a044159412d87085b0aeb 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/11.ExcludeFromObjectFactory/Editor/ExcludeFromObjectFactoryExampleEditor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | using UnityEditor; 6 | 7 | namespace UnityAttributesExample { 8 | 9 | public class ExcludeFromObjectFactoryExampleEditor { 10 | 11 | [@MenuItem("GameObject/Unity-Attributes-Example/ExcludeFromObjectFactoryExample/AddComponent_ExcludeFromObjectFactory===>Successed", false, 20)] 12 | static void AddComponent_ExcludeFromObjectFactory_Successed() { 13 | if (Selection.activeGameObject != null) { 14 | Selection.activeGameObject.AddComponent(); 15 | } 16 | } 17 | 18 | [@MenuItem("GameObject/Unity-Attributes-Example/ExcludeFromObjectFactoryExample/AddComponent_ExcludeFromObjectFactory(With Preset)===>Failed", false, 21)] 19 | static void AddComponentWithPreset_ExcludeFromObjectFactory_Failed() { 20 | if (Selection.activeGameObject != null) { 21 | ObjectFactory.AddComponent(Selection.activeGameObject); 22 | } 23 | } 24 | 25 | [@MenuItem("GameObject/Unity-Attributes-Example/ExcludeFromObjectFactoryExample/AddComponent===>Successed", false, 22)] 26 | static void AddComponent_Successed() { 27 | if (Selection.activeGameObject != null) { 28 | Selection.activeGameObject.AddComponent(); 29 | } 30 | } 31 | 32 | [@MenuItem("GameObject/Unity-Attributes-Example/ExcludeFromObjectFactoryExample/AddComponent(With Preset)===>Successed", false, 23)] 33 | static void AddComponentWithPreset_Successed() { 34 | 35 | /// 36 | /// https://sniperindia.com/Promotions/2019/10/17/unity-reseller-in-hyderabad-3/ 37 | /// 38 | 39 | if (Selection.activeGameObject != null) { 40 | ObjectFactory.AddComponent(Selection.activeGameObject); 41 | } 42 | } 43 | 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/11.ExcludeFromObjectFactory/Editor/ExcludeFromObjectFactoryExampleEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2feab5187604d4e39994a59811375fb3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/11.ExcludeFromObjectFactory/ExcludeFromObjectFactoryExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | // Add ExcludeFromObjectFactory attribute to a class to prevent the class and its inherited classes from being created with ObjectFactory methods. 8 | 9 | [ExcludeFromObjectFactory] 10 | public class ExcludeFromObjectFactoryExample : MonoBehaviour { 11 | 12 | public int aa = 24; 13 | 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/11.ExcludeFromObjectFactory/ExcludeFromObjectFactoryExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 692b8690426894fb2a9f5a5f05e72640 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/11.ExcludeFromObjectFactory/ObjectFactoryExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | 8 | public class ObjectFactoryExample : MonoBehaviour { 9 | 10 | public int aa = 25; 11 | 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/11.ExcludeFromObjectFactory/ObjectFactoryExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 529d8809aa69848c0adc07d9c1b2e741 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/11.ExcludeFromObjectFactory/Presets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0ddf6559ef4dc41e393b5333604e3b1c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/11.ExcludeFromObjectFactory/Presets/ExcludeFromObjectFactoryExample.preset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!181963792 &2655988077585873504 4 | Preset: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_Name: ExcludeFromObjectFactoryExample 10 | m_TargetType: 11 | m_NativeTypeID: 114 12 | m_ManagedTypePPtr: {fileID: 11500000, guid: 692b8690426894fb2a9f5a5f05e72640, 13 | type: 3} 14 | m_ManagedTypeFallback: 15 | m_Properties: 16 | - target: {fileID: 0} 17 | propertyPath: m_Enabled 18 | value: 1 19 | objectReference: {fileID: 0} 20 | - target: {fileID: 0} 21 | propertyPath: m_EditorHideFlags 22 | value: 0 23 | objectReference: {fileID: 0} 24 | - target: {fileID: 0} 25 | propertyPath: m_EditorClassIdentifier 26 | value: 27 | objectReference: {fileID: 0} 28 | - target: {fileID: 0} 29 | propertyPath: aa 30 | value: 88 31 | objectReference: {fileID: 0} 32 | m_ExcludedProperties: [] 33 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/11.ExcludeFromObjectFactory/Presets/ExcludeFromObjectFactoryExample.preset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3ece2b50ef87a46eb9e24f7c9a3a58b2 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2655988077585873504 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/11.ExcludeFromObjectFactory/Presets/ObjectFactoryExample.preset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!181963792 &2655988077585873504 4 | Preset: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_Name: ObjectFactoryExample 10 | m_TargetType: 11 | m_NativeTypeID: 114 12 | m_ManagedTypePPtr: {fileID: 11500000, guid: 529d8809aa69848c0adc07d9c1b2e741, 13 | type: 3} 14 | m_ManagedTypeFallback: 15 | m_Properties: 16 | - target: {fileID: 0} 17 | propertyPath: m_Enabled 18 | value: 1 19 | objectReference: {fileID: 0} 20 | - target: {fileID: 0} 21 | propertyPath: m_EditorHideFlags 22 | value: 0 23 | objectReference: {fileID: 0} 24 | - target: {fileID: 0} 25 | propertyPath: m_EditorClassIdentifier 26 | value: 27 | objectReference: {fileID: 0} 28 | - target: {fileID: 0} 29 | propertyPath: aa 30 | value: 72 31 | objectReference: {fileID: 0} 32 | m_ExcludedProperties: [] 33 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/11.ExcludeFromObjectFactory/Presets/ObjectFactoryExample.preset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e53dd1cf132244657aa954fe7303809e 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2655988077585873504 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/12.ExcludeFromPreset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1489a43008e3a4ca993c07a8cb63a79d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/12.ExcludeFromPreset/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 62159d7331ee1413c86f7d4a3dab1d01 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/12.ExcludeFromPreset/Editor/ExcludeFromPresetExampleEditor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | using UnityEditor; 6 | using UnityEditor.Presets; 7 | 8 | namespace UnityAttributesExample { 9 | 10 | public class ExcludeFromPresetExampleEditor { 11 | 12 | [@MenuItem("Assets/Unity-Attributes-Example/Exclude From Preset Example/Generate Preset", false, 5022)] 13 | static void CreatePreset() { 14 | if (Selection.activeObject != null && Selection.activeObject.GetType() == typeof(ExcludeFromPresetExample)) { 15 | var preset = new Preset(Selection.activeObject); 16 | var path = AssetDatabase.GetAssetPath(Selection.activeObject); 17 | var ext = System.IO.Path.GetExtension(path); 18 | AssetDatabase.CreateAsset(preset, path.Replace(ext, ".preset")); 19 | } else { 20 | Debug.LogWarning("Please select an 'ExcludeFromPresetExample' type asset."); 21 | } 22 | } 23 | 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/12.ExcludeFromPreset/Editor/ExcludeFromPresetExampleEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 706d6b65b559b45e2a8347d350e1c437 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/12.ExcludeFromPreset/ExcludeFromPresetExample.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 80e2ce739cf6d41b19f4537c157e67d5, type: 3} 13 | m_Name: ExcludeFromPresetExample 14 | m_EditorClassIdentifier: 15 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/12.ExcludeFromPreset/ExcludeFromPresetExample.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aeec59e7d7ee14d4aa58e0214f348e2f 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/12.ExcludeFromPreset/ExcludeFromPresetExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | // Add ExcludeFromPreset attribute to a class to prevent creating a Preset from the instances of the class. 8 | 9 | [ExcludeFromPreset] 10 | [CreateAssetMenu(fileName = "ExcludeFromPresetExample.asset", menuName = "Unity-Attributes-Example/Exclude From Preset Example", order = 7021)] 11 | public class ExcludeFromPresetExample : ScriptableObject { 12 | 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/12.ExcludeFromPreset/ExcludeFromPresetExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 80e2ce739cf6d41b19f4537c157e67d5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/12.ExcludeFromPreset/ExcludeFromPresetExample.preset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!181963792 &2655988077585873504 4 | Preset: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_Name: ExcludeFromPresetExample 10 | m_TargetType: 11 | m_NativeTypeID: 0 12 | m_ManagedTypePPtr: {fileID: 0} 13 | m_ManagedTypeFallback: 14 | m_Properties: [] 15 | m_ExcludedProperties: [] 16 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/12.ExcludeFromPreset/ExcludeFromPresetExample.preset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c6edcddf51997404aba01f41ce36a104 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2655988077585873504 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/13.ExecuteAlways.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7b4350009ec954c81bab9ad051d55fbe 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/13.ExecuteAlways/ExecuteAlwaysExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | [ExecuteAlways] 8 | public class ExecuteAlwaysExample : MonoBehaviour { 9 | 10 | /// 11 | /// https://docs.unity3d.com/ScriptReference/ExecuteAlways.html 12 | /// 13 | 14 | void Start() { 15 | 16 | if (Application.IsPlaying(gameObject)) { 17 | 18 | // Play logic 19 | 20 | } else { 21 | 22 | // Editor logic 23 | 24 | } 25 | } 26 | 27 | #region On an object which is not part of the playing world, the functions are not called constantly like they otherwise are. 28 | 29 | void Update() { 30 | if (Application.IsPlaying(gameObject)) { 31 | 32 | // Play logic 33 | 34 | } else { 35 | 36 | // - Update is only called when something in the Scene changed. 37 | 38 | // Editor logic 39 | 40 | //Debug.LogWarning("Editor Update()"); 41 | } 42 | } 43 | 44 | void OnGUI() { 45 | if (Application.IsPlaying(gameObject)) { 46 | 47 | // Play logic 48 | 49 | } else { 50 | 51 | // - OnGUI is called when the Game view receives a non-editor-only Event that it does not use (e.g., EventType.ScrollWheel) 52 | // and does not forward to the Editor's keyboard shortcut system (e.g., EventType.KeyDown, EventType.KeyUp). 53 | // Events forwarded to the Game view are enqueued and are not guaranteed to be processed immediately. 54 | 55 | // Editor logic 56 | 57 | } 58 | 59 | } 60 | 61 | void OnRenderObject() { 62 | if (Application.IsPlaying(gameObject)) { 63 | 64 | // Play logic 65 | 66 | } else { 67 | 68 | // - OnRenderObject and the other rendering callback functions are called on every repaint of the Scene view or Game view. 69 | 70 | // Editor logic 71 | 72 | } 73 | } 74 | 75 | #endregion 76 | 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/13.ExecuteAlways/ExecuteAlwaysExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f5621bd74db614a3195d2c3f60f410af 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/14.ExecuteInEditMode.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8872b9592f85b461bae40ba782bb854e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/14.ExecuteInEditMode/PrintAwake.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | /// 8 | /// https://docs.unity3d.com/ScriptReference/ExecuteInEditMode.html 9 | /// 10 | 11 | // The PrintAwake script is placed on a GameObject. The Awake function is usually 12 | // called when the GameObject is started at runtime. Due to the ExecuteInEditMode 13 | // attribute, the script is also called by the Editor. The Awake() function will be called, 14 | // for example, when the Scene is changed to a 15 | // different Scene in the Project window. 16 | // The Update() function is called, for example, when the GameObject transform 17 | // position is changed in the Editor. 18 | 19 | [ExecuteInEditMode] 20 | public class PrintAwake : MonoBehaviour { 21 | void Awake() { 22 | Debug.Log("Editor causes this Awake"); 23 | } 24 | 25 | void Update() { 26 | Debug.Log("Editor causes this Update"); 27 | } 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/14.ExecuteInEditMode/PrintAwake.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3f79d8ec39401451e8682b28a11c0fe0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/15.GradientUsage.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e290684fa6fea45a6a7ec95d04045b51 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/15.GradientUsage/GradientUsageExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | public class GradientUsageExample : MonoBehaviour { 8 | 9 | // Attribute used to configure the usage of the GradientField and Gradient Editor for a gradient. 10 | 11 | // Use this attribute on a Gradient to configure the GradientField and Gradient Editor to treat the colors as HDR colors or as normal LDR colors. 12 | 13 | [GradientUsage(true)] 14 | public Gradient gradient; 15 | 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/15.GradientUsage/GradientUsageExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c9c327b8183644ce7b40710225e069ca 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/16.GUITarget.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a8e474032e22d423cb20f45ec6f4dcfc 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/16.GUITarget/GUITargetExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | public class GUITargetExample : MonoBehaviour { 8 | 9 | // GUITarget attribute allows to control for which display the OnGUI is called. 10 | 11 | [GUITarget(1, 2)] 12 | void OnGUI() { 13 | var color = GUI.color; 14 | GUI.color = Color.red; 15 | GUILayout.Space(30f); 16 | GUILayout.Label(" This information is visible on 'Display 2' and 'Display 3' only."); 17 | GUI.color = color; 18 | } 19 | 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/16.GUITarget/GUITargetExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4df0f96ef245349788d98c60046420c7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/16.GUITarget/GUITargetExample.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9a50a2df16cc04918bdda9b391d15d32 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/17.Header.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 678983ff3e2c54fbaaf68ab9e08d7124 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/17.Header/HeaderExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | public class HeaderExample : MonoBehaviour { 8 | 9 | // Use this PropertyAttribute to add a header above some fields in the Inspector. 10 | 11 | // The header is done using a DecoratorDrawer. 12 | 13 | [Header("Health Settings")] 14 | public int health = 0; 15 | public int maxHealth = 100; 16 | 17 | [Header("Shield Settings")] 18 | public int shield = 0; 19 | public int maxShield = 0; 20 | 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/17.Header/HeaderExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: adbf0d44d3bc24833acd719a5ee4174f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/18.HelpURL.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9a95eb56194264152b496bd115ef9390 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/18.HelpURL/HelpURLExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | // Provide a custom documentation URL for a class. 8 | 9 | [HelpURL("https://github.com/LastAssertor")] 10 | public class HelpURLExample : MonoBehaviour { 11 | 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/18.HelpURL/HelpURLExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 992dfd035eb6b4417811fb03db8070a3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/19.HideInInspector.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 99d70581f4c3c406c9a8778e228290c8 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/19.HideInInspector/HideInInspectorExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | public class HideInInspectorExample : MonoBehaviour { 8 | 9 | // Makes a variable not show up in the inspector but be serialized. 10 | 11 | [HideInInspector] 12 | public int p = 5; 13 | 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/19.HideInInspector/HideInInspectorExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 476aee2b28adc49fbb38862efbf98558 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/2.AssemblyIsEditorAssembly.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: df32492fac8f14352bbf3e57fbaf9d5f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/2.AssemblyIsEditorAssembly/AssemblyIsEditorAssemblyExample.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "AssemblyIsEditorAssemblyExample", 3 | "references": [], 4 | "includePlatforms": [], 5 | "excludePlatforms": [], 6 | "allowUnsafeCode": false, 7 | "overrideReferences": false, 8 | "precompiledReferences": [], 9 | "autoReferenced": true, 10 | "defineConstraints": [], 11 | "versionDefines": [] 12 | } -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/2.AssemblyIsEditorAssembly/AssemblyIsEditorAssemblyExample.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 82d2fc30b21a1492b81fe413611c336f 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/2.AssemblyIsEditorAssembly/AssemblyIsEditorAssemblyExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | // Assembly level attribute. Any classes in an assembly with this attribute will be considered to be Editor Classes. 6 | 7 | // 这个程序集下的任何类都会被引擎认为是编辑器类, 8 | // 例如:在这个程序集里,继承MonoBehaviour的脚本都不能被挂载到GameObject上 9 | 10 | [assembly: AssemblyIsEditorAssembly] // Add 'AssemblyIsEditorAssembly' attribute to this assembly. 11 | 12 | namespace UnityAttributesExample { 13 | 14 | public class AssemblyIsEditorAssemblyExample : MonoBehaviour { 15 | 16 | } 17 | 18 | } 19 | 20 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/2.AssemblyIsEditorAssembly/AssemblyIsEditorAssemblyExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 96b2a6fc0dadd4403ba3ac9983277ac2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/20.Multiline.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e81b9852653964b2f89856b959ccffd6 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/20.Multiline/MultilineExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | public class MultilineExample : MonoBehaviour { 8 | 9 | [Multiline(8)] // Attribute to make a string be edited with a multi-line textfield. 10 | public string value; 11 | 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/20.Multiline/MultilineExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1921d1097039d420ebbced5b5e72237e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/21.PreferBinarySerialization.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3e33c5d0649ac403185e9e35acec8ac1 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/21.PreferBinarySerialization/PreferBinarySerializationExample.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/Assets/Unity-Attributes-Example/21.PreferBinarySerialization/PreferBinarySerializationExample.asset -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/21.PreferBinarySerialization/PreferBinarySerializationExample.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 65dd491c42b1445ed9fa810d1445aafc 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/21.PreferBinarySerialization/PreferBinarySerializationExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | // Prefer ScriptableObject derived type to use binary serialization regardless of project's asset serialization mode. 8 | 9 | // This is useful for custom asset types that contain large amounts of data. 10 | // Always keeping them stored as binary can both improve read/write performance, 11 | // as well as produce more compact representations on disk. 12 | // The major downsides are that binary asset files are no longer humanly readable, 13 | // and that you can no longer merge them in your revision control software. 14 | 15 | // Asset serialization in Unity always uses a consistent serialization mode throughout the entirety of each file. 16 | // As a result, when an asset file contains multiple assets, 17 | // it might not always be possible to respect the desire to force a specific asset to use binary serialization. 18 | // The serialization mode of an asset file is controlled by the main asset at that path. 19 | // As a result, care has to be taken when composing complex assets using AssetDabase.CreateAsset and AssetDatabase.AddObjectToAsset 20 | // to ensure that the main asset is the object with this attribute set. 21 | // Scene files always follow the asset serialization mode configured in the project, 22 | // thus PreferBinarySerialization is always ignored for assets embedded in Scenes. 23 | 24 | // The attribute can only be applied to ScriptableObject derived classes, it will be ignored for all other types. 25 | 26 | [PreferBinarySerialization] 27 | [CreateAssetMenu(fileName = "PreferBinarySerializationExample.asset", menuName = "Unity-Attributes-Example/Prefer Binary Serialization Example", order = 7023)] 28 | public class PreferBinarySerializationExample : ScriptableObject { 29 | 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/21.PreferBinarySerialization/PreferBinarySerializationExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 618639b0e79794203b64a07a73ab03d5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/22.Range.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2e89629cc30d444fdbc4336b6845dcbc 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/22.Range/RangeExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | public class RangeExample : MonoBehaviour { 8 | 9 | // Attribute used to make a float or int variable in a script be restricted to a specific range. 10 | 11 | // When this attribute is used, the float or int will be shown as a slider in the Inspector instead of the default number field. 12 | 13 | [Range(0, 100)] 14 | public int intValue; 15 | [Range(0, 1000f)] 16 | public float floatValue; 17 | 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/22.Range/RangeExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7f9030ec0efe443de9fef683ba6a8967 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/23.RequireComponent.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 664f15583b7154841a250fdcb0bc09c3 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/23.RequireComponent/RequireComponentExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | // The RequireComponent attribute automatically adds required components as dependencies. 8 | 9 | // When you add a script which uses RequireComponent to a GameObject, 10 | // the required component will automatically be added to the GameObject. 11 | // This is useful to avoid setup errors. 12 | // For example a script might require that a Rigidbody is always added to the same GameObject. 13 | // Using RequireComponent this will be done automatically, 14 | // thus you can never get the setup wrong. 15 | 16 | // Note that RequireComponent only checks for missing dependencies during the moment the component is added to a GameObject. 17 | // Existing instances of the component whose GameObject lacks the new dependencies will not have those dependencies automatically added. 18 | 19 | [RequireComponent(typeof(BoxCollider))] 20 | public class RequireComponentExample : MonoBehaviour { 21 | 22 | 23 | 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/23.RequireComponent/RequireComponentExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1bb138d1fe25848af8370d7156a5852e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/24.RuntimeInitializeOnLoadMethod.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: abed8293ec05f4a95a7ba7bbfbba3517 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/24.RuntimeInitializeOnLoadMethod/RuntimeInitializeOnLoadMethodExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | /// !!!!提示:取消下面的注释后,运行测试!!!!! 8 | 9 | /* 10 | 11 | class RuntimeInitializeOnLoadMethodExample { 12 | 13 | // Allow a runtime class method to be initialized when a game is loaded at runtime without action from the user. 14 | 15 | // Methods marked [RuntimeInitializeOnLoadMethod] are invoked after the game has been loaded. 16 | // This is after the Awake method has been invoked. 17 | 18 | // Note: The execution order of methods marked [RuntimeInitializeOnLoadMethod] is not guaranteed. 19 | 20 | // Callback used for registration of subsystems 21 | [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] 22 | static void OnSubsystemRegistration() { 23 | Debug.Log("0.OnSubsystemRegistration"); 24 | } 25 | 26 | // Callback when all assemblies are loaded and preloaded assets are initialized. 27 | [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterAssembliesLoaded)] 28 | static void OnAfterAssembliesLoaded() { 29 | Debug.Log("1.OnAfterAssembliesLoaded"); 30 | } 31 | 32 | [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSplashScreen)] 33 | static void OnBeforeSplashScreen() { 34 | Debug.Log("2.Before the splash screen is shown."); 35 | } 36 | 37 | // 加载第一个场景时会被调用 38 | [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] 39 | static void OnBeforeSceneLoad() { 40 | Debug.Log("3.Before first Scene loaded"); 41 | } 42 | 43 | // 等价于[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterSceneLoad)] 44 | [RuntimeInitializeOnLoadMethod] 45 | static void OnAfterSceneLoad1() { 46 | Debug.Log("4-1.After first Scene loaded"); 47 | } 48 | 49 | [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterSceneLoad)] 50 | static void OnAfterSceneLoad2() { 51 | Debug.Log("4-2.After first Scene loaded"); 52 | } 53 | 54 | [RuntimeInitializeOnLoadMethod] 55 | static void OnAfterSceneLoad3() { 56 | Debug.Log("4-3.After first Scene loaded"); 57 | } 58 | 59 | } 60 | 61 | */ 62 | 63 | } 64 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/24.RuntimeInitializeOnLoadMethod/RuntimeInitializeOnLoadMethodExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8ab7a5fad74dc4fe0a1889ba32b23e62 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/25.SelectionBase.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 69684e8d991654080927386d1cbd1ef4 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/25.SelectionBase/SelectionBaseExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | // Add this attribute to a script class to mark its GameObject as a selection base object for Scene View picking. 8 | 9 | // In the Unity Scene View, when clicking to select objects, 10 | // Unity will try to figure out the best object to select for you. 11 | // If you click on an object that is part of a Prefab, the root of the Prefab is selected, 12 | // because a Prefab root is treated as a selection base. You can make other objects be treated as selection base too. 13 | // You need to create a script class with the SelectionBase attribute, and then you need to add that script to the GameObject. 14 | 15 | [SelectionBase] 16 | public class SelectionBaseExample : MonoBehaviour { 17 | 18 | 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/25.SelectionBase/SelectionBaseExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 87e0a35bc58554854ab18887a7d7e2ff 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/25.SelectionBase/SelectionBaseExample.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2cffd6a7de233404db70d0df8815a815 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/26.SerializeField.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 64c84219fd0b6422a87b2bf4e19a5113 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/26.SerializeField/SerializeFieldExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 92306cfb77fdc40268ccf262170bb1e8 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/27.SharedBetweenAnimators.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 51de2b896e5264edda59f631965c3a07 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/27.SharedBetweenAnimators/SharedBetweenAnimatorsExample.controller.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 26722a611d4114a0e8d7cc87bad859d1 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/27.SharedBetweenAnimators/SharedBetweenAnimatorsExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | // SharedBetweenAnimatorsAttribute is an attribute that 8 | // specify that this StateMachineBehaviour should be instantiate only once and shared among all Animator instance. 9 | // This attribute reduce the memory footprint for each controller instance. 10 | 11 | // It's up to the programmer to choose which StateMachineBehaviour could use this attribute. 12 | // Be aware that if your StateMachineBehaviour change some member variable it will affect all other Animator instance using it. 13 | // See Also: StateMachineBehaviour class. 14 | 15 | [SharedBetweenAnimators] 16 | public class SharedBetweenAnimatorsExample : StateMachineBehaviour { 17 | 18 | override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { 19 | 20 | var Animators = SharedBetweenAnimatorsExampleCounter.Instance.Animators; 21 | if (!Animators.Contains(animator)) { 22 | Animators.Add(animator); 23 | } 24 | 25 | var StateMachineBehaviours = SharedBetweenAnimatorsExampleCounter.Instance.StateMachineBehaviours; 26 | if (!StateMachineBehaviours.Contains(this)) { 27 | StateMachineBehaviours.Add(this); 28 | } 29 | } 30 | 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/27.SharedBetweenAnimators/SharedBetweenAnimatorsExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ce103569491e04f54b7dac2703f4165c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/27.SharedBetweenAnimators/SharedBetweenAnimatorsExample.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ff1c3a18c372947f6bb1239a7658375a 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/27.SharedBetweenAnimators/SharedBetweenAnimatorsExample.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cd1002ca1f5ea4e9c87fef314c3e4348 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/27.SharedBetweenAnimators/SharedBetweenAnimatorsExample2.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bce80c1d86b6a4137a4a980240d01297 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/27.SharedBetweenAnimators/SharedBetweenAnimatorsExampleCounter.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | public sealed class SharedBetweenAnimatorsExampleCounter : MonoBehaviour { 8 | 9 | static SharedBetweenAnimatorsExampleCounter m_Instance; 10 | 11 | public static SharedBetweenAnimatorsExampleCounter Instance { 12 | get { 13 | if (m_Instance == null) { 14 | m_Instance = FindObjectOfType(); 15 | } 16 | if (m_Instance == null) { 17 | m_Instance = new GameObject(typeof(SharedBetweenAnimatorsExampleCounter).Name).AddComponent(); 18 | DontDestroyOnLoad(m_Instance.gameObject); 19 | } 20 | return m_Instance; 21 | } 22 | } 23 | 24 | public List StateMachineBehaviours = new List(); 25 | 26 | public List Animators = new List(); 27 | 28 | } 29 | 30 | 31 | } 32 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/27.SharedBetweenAnimators/SharedBetweenAnimatorsExampleCounter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bf1a1eb14147b467c8db6001afce000a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/27.SharedBetweenAnimators/SharedBetweenAnimatorsExample_idle.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c2f302a4af908492fb46d1bd8b8949dd 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/27.SharedBetweenAnimators/SharedBetweenAnimatorsExample_move.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c5877a25a4b2c4db19a5302f7899f3e6 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/28.Space.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1b0b7cf04a9c6456d8e91e3dd2d75693 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/28.Space/SpaceExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | public class SpaceExample : MonoBehaviour { 8 | 9 | public int health = 0; 10 | public int maxHealth = 100; 11 | 12 | [Space(10)] // 10 pixels of spacing here. 13 | 14 | public int shield = 0; 15 | public int maxShield = 0; 16 | 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/28.Space/SpaceExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e7875448496384981bba5d6589c4b343 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/29.TextArea.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8eb2b1b1d51064e10a8a9d9174bf5dc5 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/29.TextArea/TextAreaExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | public class TextAreaExample : MonoBehaviour { 8 | 9 | // Attribute to make a string be edited with a height-flexible and scrollable text area. 10 | 11 | // You can specify the minimum and maximum lines for the TextArea, 12 | // and the field will expand according to the size of the text. 13 | // A scrollbar will appear if the text is bigger than the area available. 14 | 15 | // Note: The maximum lines refers to the maximum size of the TextArea. 16 | // There is no maximum to the number of lines entered by the user. 17 | 18 | [TextArea] 19 | public string MyTextArea; 20 | 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/29.TextArea/TextAreaExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8613ac863ce9f49b18eeeb91f4ed7340 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/3.BeforeRenderOrder.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 01842c3bb52c7481e8b5ca1b2b5c427e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/3.BeforeRenderOrder/BeforeRenderOrderExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | public class BeforeRenderOrderExample : MonoBehaviour { 8 | 9 | void Start() { 10 | 11 | // Application.onBeforeRender will reorder all registered events recievers and call them in order, 12 | // from lowest to highest, based on this attribute. No attribute represents an order of 0. 13 | 14 | Application.onBeforeRender += StepC; 15 | Application.onBeforeRender += StepB; 16 | Application.onBeforeRender += StepA; 17 | } 18 | 19 | // Use this BeforeRenderOrderAttribute when you need to specify a custom callback order for Application.onBeforeRender. 20 | 21 | [BeforeRenderOrder(1)] 22 | void StepA() { 23 | Debug.LogWarning("Do somethings on step A."); 24 | } 25 | 26 | [BeforeRenderOrder(2)] 27 | //[BeforeRenderOrder(4)] 28 | void StepB() { 29 | Debug.LogWarning("Do somethings on step B."); 30 | } 31 | 32 | [BeforeRenderOrder(3)] 33 | void StepC() { 34 | Debug.LogWarning("Do somethings on step C."); 35 | } 36 | 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/3.BeforeRenderOrder/BeforeRenderOrderExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 884d03e181c134c9c80cd0c566f11cc4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/30.Tooltip.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7d9fc0bb67e8a439d806747846c02129 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/30.Tooltip/TooltipExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | public class TooltipExample : MonoBehaviour { 8 | 9 | [Tooltip("Health value between 0 and 100.")] 10 | [Range(0, 100)] 11 | public int health = 0; 12 | 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/30.Tooltip/TooltipExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dc7a1d8855f2546f18a4fedc6c9f6121 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/31.UnityAPICompatibilityVersion.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1cc15f6e03b7e46cf982bdc5b1d9dd8f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/31.UnityAPICompatibilityVersion/UnityAPICompatibilityVersionExample.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "UnityAPICompatibilityVersionExample" 3 | } 4 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/31.UnityAPICompatibilityVersion/UnityAPICompatibilityVersionExample.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 92e53c8ab892a43d497c2ce072dd8d5e 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/31.UnityAPICompatibilityVersion/UnityAPICompatibilityVersionExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | // Declares an assembly to be compatible (API wise) with a specific Unity API. 6 | // Used by internal tools to avoid processing the assembly in order to decide whether assemblies may be using old Unity API. 7 | 8 | // checkOnlyUnityVersion Must be set to true. 9 | 10 | [assembly: UnityAPICompatibilityVersion("2019.1.1f1", true)] 11 | 12 | namespace UnityAttributesExample { 13 | 14 | /// 15 | /// https://blog.csdn.net/akof1314/article/details/54141624 16 | /// https://blog.unity.com/technology/assemby-updater-faster-api-usage-detection 17 | /// https://support.unity.com/hc/en-us/articles/205931009-The-process-of-importing-DLL-s-between-Unity-4-and-Unity-5-is-slower- 18 | /// 19 | 20 | public class UnityAPICompatibilityVersionExample : MonoBehaviour { 21 | 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/31.UnityAPICompatibilityVersion/UnityAPICompatibilityVersionExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d161c6b84370c45c9a080f0ec4ac7b6b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/32.FormerlySerializedAs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 32817041dd13d414bbcd20e16dda020c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/32.FormerlySerializedAs/FormerlySerializedAsExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | using UnityEngine.Serialization; 6 | 7 | namespace UnityAttributesExample { 8 | 9 | public class FormerlySerializedAsExample : MonoBehaviour { 10 | 11 | [FormerlySerializedAs("myValue")] // Use this attribute to rename a field without losing its serialized value. 12 | [SerializeField] 13 | string m_MyValue; 14 | 15 | public string myValue { 16 | get { return m_MyValue; } 17 | set { m_MyValue = value; } 18 | } 19 | 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/32.FormerlySerializedAs/FormerlySerializedAsExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c1444586ea76f4277911d4e18a3d75ab 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/32.FormerlySerializedAs/FormerlySerializedAsExample.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &142805185515124762 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 1592865448225899565} 12 | - component: {fileID: 5448099416040562252} 13 | m_Layer: 0 14 | m_Name: FormerlySerializedAsExample 15 | m_TagString: Untagged 16 | m_Icon: {fileID: 0} 17 | m_NavMeshLayer: 0 18 | m_StaticEditorFlags: 0 19 | m_IsActive: 1 20 | --- !u!4 &1592865448225899565 21 | Transform: 22 | m_ObjectHideFlags: 0 23 | m_CorrespondingSourceObject: {fileID: 0} 24 | m_PrefabInstance: {fileID: 0} 25 | m_PrefabAsset: {fileID: 0} 26 | m_GameObject: {fileID: 142805185515124762} 27 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 28 | m_LocalPosition: {x: 0.7133937, y: 0.36818743, z: -2.2200348} 29 | m_LocalScale: {x: 1, y: 1, z: 1} 30 | m_ConstrainProportionsScale: 0 31 | m_Children: [] 32 | m_Father: {fileID: 0} 33 | m_RootOrder: 0 34 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 35 | --- !u!114 &5448099416040562252 36 | MonoBehaviour: 37 | m_ObjectHideFlags: 0 38 | m_CorrespondingSourceObject: {fileID: 0} 39 | m_PrefabInstance: {fileID: 0} 40 | m_PrefabAsset: {fileID: 0} 41 | m_GameObject: {fileID: 142805185515124762} 42 | m_Enabled: 1 43 | m_EditorHideFlags: 0 44 | m_Script: {fileID: 11500000, guid: c1444586ea76f4277911d4e18a3d75ab, type: 3} 45 | m_Name: 46 | m_EditorClassIdentifier: 47 | myValue: abcc 48 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/32.FormerlySerializedAs/FormerlySerializedAsExample.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 131b86ca3737d4fa984b4e45c27ff071 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/33.CanEditMultipleObjects.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 161b29a5b8f3c44d7bd5e67d70be9c69 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/33.CanEditMultipleObjects/CanEditMultipleObjectsExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | public class CanEditMultipleObjectsExample : MonoBehaviour { 8 | 9 | public int a; 10 | 11 | 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/33.CanEditMultipleObjects/CanEditMultipleObjectsExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ac629c6cc1f2f48419001529ae7dee67 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/33.CanEditMultipleObjects/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7ca0bc9aba7554ecd836f709d04cad1d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/33.CanEditMultipleObjects/Editor/CanEditMultipleObjectsExampleEditor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | using UnityEditor; 6 | 7 | namespace UnityAttributesExample { 8 | 9 | [CanEditMultipleObjects] // Attribute used to make a custom editor support multi-object editing. 10 | [CustomEditor(typeof(CanEditMultipleObjectsExample))] // Tells an Editor class which run-time type it's an editor for. 11 | public class CanEditMultipleObjectsExampleEditor : Editor { 12 | 13 | 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/33.CanEditMultipleObjects/Editor/CanEditMultipleObjectsExampleEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 11903f777b14045ff9c2a759f9e0e741 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/34.CustomPreview.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f301ec87e46d94736bb8e9b7b9a930c0 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/34.CustomPreview/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 90eba2ce44dea460981d2b3e594e595f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/34.CustomPreview/Editor/MyObjectPreview.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | using UnityEditor; 6 | 7 | namespace UnityAttributesExample { 8 | 9 | [CustomPreview(typeof(MyObject))] 10 | public class MyPreview : ObjectPreview { 11 | 12 | public override bool HasPreviewGUI() { 13 | return true; 14 | } 15 | 16 | public override void OnPreviewGUI(Rect r, GUIStyle background) { 17 | GUI.Label(r, target.name + " is being previewed"); 18 | } 19 | 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/34.CustomPreview/Editor/MyObjectPreview.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4954fa70682994d5d813a029cda2a67e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/34.CustomPreview/MyObject.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | public class MyObject : MonoBehaviour { 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/34.CustomPreview/MyObject.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aedb7d133065e4b62a11e6006dd93889 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/35.CustomPropertyDrawer.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0cb2647ebdf8543d19897908b686440a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/35.CustomPropertyDrawer/AttackBehaviour.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class AttackBehaviour : StateMachineBehaviour 6 | { 7 | //public GameObject particle; 8 | [Range(1, 5)] 9 | public float radius; 10 | [Range(0, 1999)] 11 | public float power; 12 | 13 | //protected GameObject clone; 14 | 15 | override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) 16 | { 17 | //clone = Instantiate(particle, animator.rootPosition, Quaternion.identity) as GameObject; 18 | //Rigidbody rb = clone.GetComponent(); 19 | //rb.AddExplosionForce(power, animator.rootPosition, radius, 3.0f); 20 | //Debug.Log("On Attack Enter "); 21 | } 22 | 23 | override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) 24 | { 25 | //Destroy(clone); 26 | //Debug.Log("On Attack Exit "); 27 | } 28 | 29 | override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) 30 | { 31 | //Debug.Log("On Attack Update "); 32 | } 33 | 34 | override public void OnStateMove(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) 35 | { 36 | //Debug.Log("On Attack Move "); 37 | } 38 | 39 | override public void OnStateIK(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) 40 | { 41 | //Debug.Log("On Attack IK "); 42 | } 43 | 44 | 45 | [BeforeRenderOrder(2000)] 46 | void BeforeRender() 47 | { 48 | Debug.LogWarning(2000); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/35.CustomPropertyDrawer/AttackBehaviour.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 493cb8f030b1340b9a4bf0cd9f621e2b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/35.CustomPropertyDrawer/Attributes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9232bb84fcc6c41b4b0d076dcd3cf0b8 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/35.CustomPropertyDrawer/Attributes/TabEnumAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using System; 5 | 6 | namespace UnityAttributesExample { 7 | 8 | public class TabEnumAttribute : PropertyAttribute { 9 | 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/35.CustomPropertyDrawer/Attributes/TabEnumAttribute.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 04c4e8c2d9d6649db8b78ed5eefdb356 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/35.CustomPropertyDrawer/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 689a421fe1b754807abc2ff63accb68b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/35.CustomPropertyDrawer/Editor/EquipmentAbilityDrawer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | 6 | namespace UnityAttributesExample { 7 | 8 | [CustomPropertyDrawer(typeof(EquipmentAbility))] 9 | public class EquipmentAbilityDrawer : PropertyDrawer { 10 | 11 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { 12 | EditorGUI.BeginProperty(position, label, property); 13 | 14 | position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label); 15 | 16 | var indent = EditorGUI.indentLevel; 17 | EditorGUI.indentLevel = 0; 18 | 19 | var typeRect = new Rect(position.x, position.y, position.width / 2, position.height); 20 | var amountRect = new Rect(position.x + position.width / 2 + 10, position.y, position.width / 2 - 10, position.height); 21 | 22 | EditorGUI.PropertyField(typeRect, property.FindPropertyRelative("type"), GUIContent.none); 23 | EditorGUI.PropertyField(amountRect, property.FindPropertyRelative("amount"), GUIContent.none); 24 | 25 | EditorGUI.indentLevel = indent; 26 | 27 | EditorGUI.EndProperty(); 28 | 29 | } 30 | 31 | } 32 | 33 | } 34 | 35 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/35.CustomPropertyDrawer/Editor/EquipmentAbilityDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c0d7232025db84816a0623b1192623ff 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/35.CustomPropertyDrawer/Editor/TabEnumAttributeDrawer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | using System; 6 | 7 | namespace UnityAttributesExample { 8 | 9 | [CustomPropertyDrawer(typeof(TabEnumAttribute))] 10 | public class TabEnumAttributeDrawer : PropertyDrawer { 11 | 12 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { 13 | GUI.Label(new Rect(position) { 14 | width = 50f 15 | }, label); 16 | property.enumValueIndex = GUI.Toolbar(new Rect(position) { 17 | x = position.x + 52f, 18 | width = position.width - 54f 19 | }, property.enumValueIndex, property.enumDisplayNames); 20 | } 21 | 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/35.CustomPropertyDrawer/Editor/TabEnumAttributeDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 911846d6cafff42c3aad96f854c6c6dd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/35.CustomPropertyDrawer/EquipmentSystem.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ff5498d014a3c423e9ff36dfa1e78a8a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/35.CustomPropertyDrawer/EquipmentSystem/Enums.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fea8fca6284dd450eb7e74f6b2428fca 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/35.CustomPropertyDrawer/EquipmentSystem/Enums/EquipmentAbilityType.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | public enum EquipmentAbilityType { 8 | HP, 9 | ATK, 10 | DEF 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/35.CustomPropertyDrawer/EquipmentSystem/Enums/EquipmentAbilityType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cb511518e2c024432ba0efe2414c9acd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/35.CustomPropertyDrawer/EquipmentSystem/Enums/EquipmentType.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | public enum EquipmentType { 8 | Head, 9 | Body, 10 | Arm, 11 | Hand, 12 | Leg, 13 | Foot 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/35.CustomPropertyDrawer/EquipmentSystem/Enums/EquipmentType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ddb1e56ea8f3545fa96261aeb1bc6c45 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/35.CustomPropertyDrawer/EquipmentSystem/Equipment.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | [System.Serializable] 8 | public class Equipment { 9 | 10 | public int id; 11 | 12 | [TabEnum] 13 | public EquipmentType type; 14 | public List ups = new List(); 15 | public List downs = new List(); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/35.CustomPropertyDrawer/EquipmentSystem/Equipment.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a541935efe6ff44718313723d33a96c5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/35.CustomPropertyDrawer/EquipmentSystem/EquipmentAbility.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | [System.Serializable] 8 | public class EquipmentAbility { 9 | [TabEnum] 10 | public EquipmentAbilityType type; 11 | public int amount; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/35.CustomPropertyDrawer/EquipmentSystem/EquipmentAbility.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 855751b8fce5b4914accb7c7b8e7ba25 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/35.CustomPropertyDrawer/EquipmentSystem/EquipmentEffect.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | [System.Serializable] 8 | public class EquipmentEffect { 9 | [Header("需要达到指定数量的套装猜能获得效果")] 10 | public int require = 3; 11 | [Header("增益效果")] 12 | public List ups = new List(); 13 | [Header("减益效果")] 14 | public List downs = new List(); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/35.CustomPropertyDrawer/EquipmentSystem/EquipmentEffect.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4bdb4deeebc1640f5bf352e5d260f0d9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/35.CustomPropertyDrawer/EquipmentSystem/EquipmentGroup.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | [System.Serializable] 8 | public class EquipmentGroup { 9 | [Header("套装效果")] 10 | public List effects = new List(); 11 | [Header("套装部件")] 12 | public List parts = new List(); 13 | } 14 | 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/35.CustomPropertyDrawer/EquipmentSystem/EquipmentGroup.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4c36603e2d6884a7ea75c5ea0836d6de 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/35.CustomPropertyDrawer/EquipmentSystem/EquipmentSystem.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | public class EquipmentSystem : MonoBehaviour { 8 | 9 | [Header("套装装备")] 10 | public List groups = new List(); 11 | [Header("散装装备")] 12 | public List normals = new List(); 13 | 14 | 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/35.CustomPropertyDrawer/EquipmentSystem/EquipmentSystem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9ed95e0d52f6c4377b0b7d9e59548a8a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/35.CustomPropertyDrawer/EquipmentSystem/EquipmentSystem.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9733325e3858a45e3bfc1d39cd8544ef 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/35.CustomPropertyDrawer/EquipmentSystem/EquipmentSystemSettings.lighting: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!850595691 &4890085278179872738 4 | LightingSettings: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_Name: EquipmentSystemSettings 10 | serializedVersion: 3 11 | m_GIWorkflowMode: 1 12 | m_EnableBakedLightmaps: 0 13 | m_EnableRealtimeLightmaps: 0 14 | m_RealtimeEnvironmentLighting: 1 15 | m_BounceScale: 1 16 | m_AlbedoBoost: 1 17 | m_IndirectOutputScale: 1 18 | m_UsingShadowmask: 1 19 | m_BakeBackend: 1 20 | m_LightmapMaxSize: 1024 21 | m_BakeResolution: 40 22 | m_Padding: 2 23 | m_TextureCompression: 1 24 | m_AO: 0 25 | m_AOMaxDistance: 1 26 | m_CompAOExponent: 1 27 | m_CompAOExponentDirect: 0 28 | m_ExtractAO: 0 29 | m_MixedBakeMode: 2 30 | m_LightmapsBakeMode: 1 31 | m_FilterMode: 1 32 | m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0} 33 | m_ExportTrainingData: 0 34 | m_TrainingDataDestination: TrainingData 35 | m_RealtimeResolution: 2 36 | m_ForceWhiteAlbedo: 0 37 | m_ForceUpdates: 0 38 | m_FinalGather: 0 39 | m_FinalGatherRayCount: 256 40 | m_FinalGatherFiltering: 1 41 | m_PVRCulling: 1 42 | m_PVRSampling: 1 43 | m_PVRDirectSampleCount: 32 44 | m_PVRSampleCount: 512 45 | m_PVREnvironmentSampleCount: 256 46 | m_PVREnvironmentReferencePointCount: 2048 47 | m_LightProbeSampleCountMultiplier: 4 48 | m_PVRBounces: 2 49 | m_PVRMinBounces: 2 50 | m_PVREnvironmentMIS: 1 51 | m_PVRFilteringMode: 1 52 | m_PVRDenoiserTypeDirect: 1 53 | m_PVRDenoiserTypeIndirect: 1 54 | m_PVRDenoiserTypeAO: 1 55 | m_PVRFilterTypeDirect: 0 56 | m_PVRFilterTypeIndirect: 0 57 | m_PVRFilterTypeAO: 0 58 | m_PVRFilteringGaussRadiusDirect: 1 59 | m_PVRFilteringGaussRadiusIndirect: 5 60 | m_PVRFilteringGaussRadiusAO: 2 61 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 62 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 63 | m_PVRFilteringAtrousPositionSigmaAO: 1 64 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/35.CustomPropertyDrawer/EquipmentSystem/EquipmentSystemSettings.lighting.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: de469bd946c7d4e28847906f7f3975b4 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 4890085278179872738 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/36.DrawGizmo.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7ca2f7a5bdcf04b66af374acc96cc80e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/36.DrawGizmo/DrawGizmoExample.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: DrawGizmoExample 11 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: _ALPHABLEND_ON 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: 3000 17 | stringTagMap: 18 | RenderType: Transparent 19 | disabledShaderPasses: [] 20 | m_SavedProperties: 21 | serializedVersion: 3 22 | m_TexEnvs: 23 | - _BumpMap: 24 | m_Texture: {fileID: 0} 25 | m_Scale: {x: 1, y: 1} 26 | m_Offset: {x: 0, y: 0} 27 | - _DetailAlbedoMap: 28 | m_Texture: {fileID: 0} 29 | m_Scale: {x: 1, y: 1} 30 | m_Offset: {x: 0, y: 0} 31 | - _DetailMask: 32 | m_Texture: {fileID: 0} 33 | m_Scale: {x: 1, y: 1} 34 | m_Offset: {x: 0, y: 0} 35 | - _DetailNormalMap: 36 | m_Texture: {fileID: 0} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | - _EmissionMap: 40 | m_Texture: {fileID: 0} 41 | m_Scale: {x: 1, y: 1} 42 | m_Offset: {x: 0, y: 0} 43 | - _MainTex: 44 | m_Texture: {fileID: 0} 45 | m_Scale: {x: 1, y: 1} 46 | m_Offset: {x: 0, y: 0} 47 | - _MetallicGlossMap: 48 | m_Texture: {fileID: 0} 49 | m_Scale: {x: 1, y: 1} 50 | m_Offset: {x: 0, y: 0} 51 | - _OcclusionMap: 52 | m_Texture: {fileID: 0} 53 | m_Scale: {x: 1, y: 1} 54 | m_Offset: {x: 0, y: 0} 55 | - _ParallaxMap: 56 | m_Texture: {fileID: 0} 57 | m_Scale: {x: 1, y: 1} 58 | m_Offset: {x: 0, y: 0} 59 | m_Floats: 60 | - _BumpScale: 1 61 | - _Cutoff: 0.5 62 | - _DetailNormalMapScale: 1 63 | - _DstBlend: 10 64 | - _GlossMapScale: 1 65 | - _Glossiness: 0.5 66 | - _GlossyReflections: 1 67 | - _Metallic: 0 68 | - _Mode: 2 69 | - _OcclusionStrength: 1 70 | - _Parallax: 0.02 71 | - _SmoothnessTextureChannel: 0 72 | - _SpecularHighlights: 1 73 | - _SrcBlend: 5 74 | - _UVSec: 0 75 | - _ZWrite: 0 76 | m_Colors: 77 | - _Color: {r: 1, g: 0, b: 0, a: 0.16862746} 78 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 79 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/36.DrawGizmo/DrawGizmoExample.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 39a2aaf99d4a0442a8da444b5ea7dd1d 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/36.DrawGizmo/DrawGizmoExample.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 590e2fc89f4d242d59e769c9e1379488 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/36.DrawGizmo/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 829db26b373264a35908aba4fbdb8774 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/36.DrawGizmo/Editor/MyScriptGizmoDrawer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | using UnityEditor; 6 | 7 | namespace UnityAttributesExample { 8 | 9 | public class MyScriptGizmoDrawer { 10 | 11 | [DrawGizmo(GizmoType.Selected | GizmoType.Active)] 12 | static void DrawGizmoForMyScript(MyScript scr, GizmoType gizmoType) { 13 | Vector3 position = scr.transform.position; 14 | 15 | if (Vector3.Distance(position, Camera.current.transform.position) > 10f) 16 | Gizmos.DrawIcon(position, "MyScript Gizmo.png", true); 17 | } 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/36.DrawGizmo/Editor/MyScriptGizmoDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a5cfbe6d4d5a140729b0dc40ba11c7ab 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/36.DrawGizmo/MyScript.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | public class MyScript : MonoBehaviour { 8 | 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/36.DrawGizmo/MyScript.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 244f966f4d749422b9310b6d050a2ce5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/37.InitializeOnLoad.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c41ab88f5754448278509fc4ac2f299e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/37.InitializeOnLoad/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 162d65905fdb2409795ff3b499f7b424 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/37.InitializeOnLoad/Editor/InitializeOnLoadExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | using UnityEditor; 6 | 7 | namespace UnityAttributesExample { 8 | 9 | /// 10 | /// https://docs.unity3d.com/ScriptReference/InitializeOnLoadAttribute.html 11 | /// 12 | /// Allows you to initialize an Editor class when Unity loads, 13 | /// and when your scripts are recompiled. 14 | /// Static constructors with this attribute are called 15 | /// when scripts in the project are recompiled (also known as a Domain Reload). 16 | /// when Unity first loads your project, 17 | /// but also when Unity detects modifications to scripts 18 | /// (depending on your Auto Refresh preferences), 19 | /// and when you enter Play Mode (depending on your Play Mode configuration). 20 | /// 21 | 22 | // Running Editor Script Code on Launch 23 | 24 | [InitializeOnLoad] 25 | public class InitializeOnLoadExample { 26 | 27 | static InitializeOnLoadExample() { 28 | 29 | /// https://docs.unity3d.com/Manual/RunningEditorCodeOnLaunch.html 30 | 31 | //Debug.Log("Up and running"); 32 | 33 | // editor frame update 34 | 35 | //EditorApplication.update += Update; 36 | 37 | } 38 | 39 | //static void Update() { 40 | // Debug.Log("Updating"); 41 | //} 42 | 43 | [InitializeOnLoadMethod] 44 | static void OnProjectLoadedInEditor() { 45 | 46 | /// https://docs.unity3d.com/ScriptReference/InitializeOnLoadMethodAttribute.html 47 | 48 | //Debug.Log("Project loaded in Unity Editor"); 49 | } 50 | 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/37.InitializeOnLoad/Editor/InitializeOnLoadExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3d1752556058341c4a5c623b58b07878 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/38.OnOpenAsset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 977378417d2054f3d9561719eaf54aab 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/38.OnOpenAsset/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dd6b01fbf2f4e41009b8dcc8db00ce7d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/38.OnOpenAsset/Editor/OnOpenAssetExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | using UnityEditor; 6 | using UnityEditor.Callbacks; 7 | 8 | namespace UnityAttributesExample { 9 | 10 | /// 11 | /// https://docs.unity3d.com/ScriptReference/Callbacks.OnOpenAssetAttribute.html 12 | /// 13 | 14 | public class OnOpenAssetExample { 15 | 16 | // Callback attribute for opening an asset in Unity (e.g the callback is fired when double clicking an asset in the Project Browser). 17 | 18 | // Adding this attribute to a static method will make the method be called when Unity is about to open an asset. 19 | // The method should have the following signature: 20 | 21 | // static bool OnOpenAsset(int instanceID, int line) 22 | // Return true if you handled the opening of the asset or false if an external tool should open it. 23 | 24 | [OnOpenAsset(1)] 25 | public static bool step1(int instanceID, int line) { 26 | string name = EditorUtility.InstanceIDToObject(instanceID).name; 27 | Debug.Log("Open Asset step: 1 (" + name + ")"); 28 | return false; // we did not handle the open 29 | } 30 | 31 | // OnOpenAssetAttribute has an option to provide an order index in the callback, starting at 0. 32 | // This is useful if you have more than one OnOpenAssetAttribute callback, and you would like them to be called in a certain order. 33 | // Callbacks are called in order, starting at zero. 34 | 35 | // step2 has an attribute with index 2, so will be called after step1 36 | [OnOpenAsset(2)] 37 | public static bool step2(int instanceID, int line) { 38 | Debug.Log("Open Asset step: 2 (" + instanceID + ")"); 39 | return false; // we did not handle the open 40 | } 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/38.OnOpenAsset/Editor/OnOpenAssetExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 42fc2ca087cb34040b9f4a991b90c010 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/39.PostProcessBuild.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 95c21c3d1a3a540f79200bcd8f706aa9 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/39.PostProcessBuild/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fdb8dd5e05b5c47daa4c94171d504c6f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/39.PostProcessBuild/Editor/PostProcessBuildExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | using UnityEditor; 6 | using UnityEditor.Callbacks; 7 | 8 | namespace UnityAttributesExample { 9 | 10 | public class PostProcessBuildExample { 11 | 12 | // Add this attribute to a method to get a notification just after building the player. 13 | 14 | // PostProcessBuildAttribute has an option to provide an order index in the callback, starting at 0. 15 | // This is useful if you have more than one PostProcessBuildAttribute callback, 16 | // and you would like them to be called in a certain order. Callbacks are called in order, starting at zero. 17 | 18 | [PostProcessBuild(1)] 19 | public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject) { 20 | // after build 21 | Debug.Log(target + ":" + pathToBuiltProject); 22 | } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/39.PostProcessBuild/Editor/PostProcessBuildExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 40f13bf2b46684782b7e5043dafe4a37 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/4.ColorUsage.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 79d7e4ff410284203bd9cd8151b7046c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/4.ColorUsage/ColorUsageExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | public class ColorUsageExample : MonoBehaviour { 8 | 9 | // Use this attribute on a Color to configure the Color Field and Color Picker 10 | // to show/hide the alpha value and whether to treat the color as a HDR color or as a normal LDR color. 11 | 12 | [ColorUsage(true, true)] 13 | public Color DHRColor; 14 | 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/4.ColorUsage/ColorUsageExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bfb12eb6ba6ef40109e998ea82ff2e2b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/40.PostProcessScene.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8eda90c2dbcc5434aaab48431a4713b6 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/40.PostProcessScene/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 590044c22cd834b71beb560031a80500 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/40.PostProcessScene/Editor/PostProcessSceneExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | using UnityEditor; 6 | using UnityEditor.Callbacks; 7 | 8 | namespace UnityAttributesExample { 9 | 10 | public class PostProcessSceneExample { 11 | 12 | // Add this attribute to a method to get a notification just after building the Scene. 13 | 14 | // A method with this attribute will also get called when entering Playmode, when SceneManager.LoadScene is called. 15 | 16 | // PostProcessSceneAttribute has an option to provide an order index in the callback, starting at 0. 17 | // This is useful if you have more than one OnPostprocessScene callback, 18 | // and you would like them to be called in a certain order. Callbacks are called in order, starting at zero. 19 | 20 | [PostProcessScene(2)] 21 | static void OnPostprocessScene() { 22 | OnBeforeSceneLoaded(); 23 | } 24 | 25 | static void OnBeforeSceneLoaded() { 26 | //var scene = UnityEngine.SceneManagement.SceneManager.GetActiveScene(); 27 | //Debug.LogWarning("OnBeforeSceneLoaded ======> " + scene.name + ".unity"); 28 | } 29 | 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/40.PostProcessScene/Editor/PostProcessSceneExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 576a5f8377bf74186a82785d2f93d54d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/40.PostProcessScene/PostProcessSceneExample.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e1c95754a1389469480543de6ba61b2c 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/40.PostProcessScene/TestLoadScene.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | public class TestLoadScene : MonoBehaviour { 8 | 9 | public int sceneIndex; 10 | 11 | void OnGUI() { 12 | 13 | if (GUILayout.Button("Load Scene")) { 14 | UnityEngine.SceneManagement.SceneManager.LoadScene(sceneIndex); 15 | } 16 | 17 | } 18 | 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/40.PostProcessScene/TestLoadScene.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ad1b57b47a0fd404f81e3ed5de7f9ef0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/41.GridPaintSorting.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7323fa1ff7dfc449faf912c04d305205 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/41.GridPaintSorting/README.md: -------------------------------------------------------------------------------- 1 | 2 | # GridPaintSortingAttribute 3 | 4 | 5 | 6 | Description 7 | Use this attribute to add an option to customize the sorting of Active Targets in the Active Tilemap list of the Tile Palette window. 8 | 9 | Append this attribute to a class which inherits from IComparer or to a method which creates an IComparer. The instance of IComparer generated with the attribute is used for comparing and sorting Active Target GameObjects in the Active Tilemaps list. 10 | 11 | ``` 12 | 13 | using System; 14 | using System.Collections.Generic; 15 | using UnityEngine; 16 | using UnityEditor; 17 | 18 | [GridPaintSorting] 19 | class Alphabetical : IComparer 20 | { 21 | public int Compare(GameObject go1, GameObject go2) 22 | { 23 | return String.Compare(go1.name, go2.name); 24 | } 25 | } 26 | 27 | class ReverseAlphabeticalComparer : IComparer 28 | { 29 | public int Compare(GameObject go1, GameObject go2) 30 | { 31 | return -String.Compare(go1.name, go2.name); 32 | } 33 | 34 | [GridPaintSorting] 35 | public static IComparer ReverseAlphabetical() 36 | { 37 | return new ReverseAlphabeticalComparer(); 38 | } 39 | } 40 | 41 | ``` 42 | 43 | ![gridpaintsorting](gridpaintsorting.jpg) 44 | 45 | Items appended with this attribute will be listed under the "Tile Palette Active Targets Sorting Mode" setting found in the 'Tile Palette' subcategory (menu: Edit > Preferences > 2D > Tile Palette). Select the desired sorting method from the drop-down menu to use your customized sorting in the Tile Palette window. -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/41.GridPaintSorting/README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 54e298ed2436a40ec85e293ce1b4e212 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/41.GridPaintSorting/gridpaintsorting.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/Assets/Unity-Attributes-Example/41.GridPaintSorting/gridpaintsorting.jpg -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/41.GridPaintSorting/gridpaintsorting.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 60601612781ce4341b7159bf6730cb22 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | vTOnly: 0 27 | ignoreMasterTextureLimit: 0 28 | grayScaleToAlpha: 0 29 | generateCubemap: 6 30 | cubemapConvolution: 0 31 | seamlessCubemap: 0 32 | textureFormat: 1 33 | maxTextureSize: 2048 34 | textureSettings: 35 | serializedVersion: 2 36 | filterMode: 1 37 | aniso: 1 38 | mipBias: 0 39 | wrapU: 1 40 | wrapV: 1 41 | wrapW: 1 42 | nPOTScale: 0 43 | lightmap: 0 44 | compressionQuality: 50 45 | spriteMode: 1 46 | spriteExtrude: 1 47 | spriteMeshType: 1 48 | alignment: 0 49 | spritePivot: {x: 0.5, y: 0.5} 50 | spritePixelsToUnits: 100 51 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 52 | spriteGenerateFallbackPhysicsShape: 1 53 | alphaUsage: 1 54 | alphaIsTransparency: 1 55 | spriteTessellationDetail: -1 56 | textureType: 8 57 | textureShape: 1 58 | singleChannelComponent: 0 59 | flipbookRows: 1 60 | flipbookColumns: 1 61 | maxTextureSizeSet: 0 62 | compressionQualitySet: 0 63 | textureFormatSet: 0 64 | ignorePngGamma: 0 65 | applyGammaDecoding: 1 66 | platformSettings: 67 | - serializedVersion: 3 68 | buildTarget: DefaultTexturePlatform 69 | maxTextureSize: 2048 70 | resizeAlgorithm: 0 71 | textureFormat: -1 72 | textureCompression: 0 73 | compressionQuality: 50 74 | crunchedCompression: 0 75 | allowsAlphaSplitting: 0 76 | overridden: 0 77 | androidETC2FallbackOverride: 0 78 | forceMaximumCompressionQuality_BC6H_BC7: 0 79 | - serializedVersion: 3 80 | buildTarget: Standalone 81 | maxTextureSize: 2048 82 | resizeAlgorithm: 0 83 | textureFormat: -1 84 | textureCompression: 0 85 | compressionQuality: 50 86 | crunchedCompression: 0 87 | allowsAlphaSplitting: 0 88 | overridden: 0 89 | androidETC2FallbackOverride: 0 90 | forceMaximumCompressionQuality_BC6H_BC7: 0 91 | spriteSheet: 92 | serializedVersion: 2 93 | sprites: [] 94 | outline: [] 95 | physicsShape: [] 96 | bones: [] 97 | spriteID: 5e97eb03825dee720800000000000000 98 | internalID: 0 99 | vertices: [] 100 | indices: 101 | edges: [] 102 | weights: [] 103 | secondaryTextures: [] 104 | nameFileIdTable: {} 105 | spritePackingTag: 106 | pSDRemoveMatte: 0 107 | pSDShowRemoveMatteOption: 0 108 | userData: 109 | assetBundleName: 110 | assetBundleVariant: 111 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/42.MenuItem.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 109fdc728230f4417881b4c92589fc9b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/42.MenuItem/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ab648568b485442b08b903d01125684a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/42.MenuItem/Editor/MenuTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9365f6d6c62da4624aaee759ca848e2b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/42.MenuItem/MenuItemExample.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6d51d97d12b9045388b1b010549cbd5c 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/42.MenuItem/MenuItemExampleSettings.lighting: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!850595691 &4890085278179872738 4 | LightingSettings: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_Name: MenuItemExampleSettings 10 | serializedVersion: 3 11 | m_GIWorkflowMode: 1 12 | m_EnableBakedLightmaps: 0 13 | m_EnableRealtimeLightmaps: 0 14 | m_RealtimeEnvironmentLighting: 1 15 | m_BounceScale: 1 16 | m_AlbedoBoost: 1 17 | m_IndirectOutputScale: 1 18 | m_UsingShadowmask: 1 19 | m_BakeBackend: 1 20 | m_LightmapMaxSize: 1024 21 | m_BakeResolution: 40 22 | m_Padding: 2 23 | m_TextureCompression: 1 24 | m_AO: 0 25 | m_AOMaxDistance: 1 26 | m_CompAOExponent: 1 27 | m_CompAOExponentDirect: 0 28 | m_ExtractAO: 0 29 | m_MixedBakeMode: 2 30 | m_LightmapsBakeMode: 1 31 | m_FilterMode: 1 32 | m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0} 33 | m_ExportTrainingData: 0 34 | m_TrainingDataDestination: TrainingData 35 | m_RealtimeResolution: 2 36 | m_ForceWhiteAlbedo: 0 37 | m_ForceUpdates: 0 38 | m_FinalGather: 0 39 | m_FinalGatherRayCount: 256 40 | m_FinalGatherFiltering: 1 41 | m_PVRCulling: 1 42 | m_PVRSampling: 1 43 | m_PVRDirectSampleCount: 32 44 | m_PVRSampleCount: 512 45 | m_PVREnvironmentSampleCount: 256 46 | m_PVREnvironmentReferencePointCount: 2048 47 | m_LightProbeSampleCountMultiplier: 4 48 | m_PVRBounces: 2 49 | m_PVRMinBounces: 2 50 | m_PVREnvironmentMIS: 1 51 | m_PVRFilteringMode: 1 52 | m_PVRDenoiserTypeDirect: 1 53 | m_PVRDenoiserTypeIndirect: 1 54 | m_PVRDenoiserTypeAO: 1 55 | m_PVRFilterTypeDirect: 0 56 | m_PVRFilterTypeIndirect: 0 57 | m_PVRFilterTypeAO: 0 58 | m_PVRFilteringGaussRadiusDirect: 1 59 | m_PVRFilteringGaussRadiusIndirect: 5 60 | m_PVRFilteringGaussRadiusAO: 2 61 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 62 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 63 | m_PVRFilteringAtrousPositionSigmaAO: 1 64 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/42.MenuItem/MenuItemExampleSettings.lighting.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6ee293a1250bf45d1921629f92268962 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 4890085278179872738 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/43.SettingsProvider.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a9a7004c9b672422e85f077ceb983e09 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/43.SettingsProvider/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e54126d0628c4476885866195d42d481 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/43.SettingsProvider/Editor/MyCustomSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: dfb2eb88e71db4197bc8ae6dfa4c25f2, type: 3} 13 | m_Name: MyCustomSettings 14 | m_EditorClassIdentifier: 15 | m_Number: 222 16 | m_SomeString: The answer to the universe 17 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/43.SettingsProvider/Editor/MyCustomSettings.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 367a3c355d19744d7bb36a82e24998a8 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/43.SettingsProvider/Editor/MyCustomSettings.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dfb2eb88e71db4197bc8ae6dfa4c25f2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/43.SettingsProvider/Editor/MyPreferencesProvider.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Linq; 3 | using UnityEditor; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | class MyPreferencesProvider : SettingsProvider { 8 | 9 | public MyPreferencesProvider(string path, SettingsScope scope) 10 | : base(path, scope) { } 11 | 12 | [SettingsProvider] 13 | public static SettingsProvider CreateMyCutomSettingsOnPreferencesWindowProvider() { 14 | return new MyPreferencesProvider("MyPreferences", SettingsScope.User); 15 | } 16 | 17 | public override void OnGUI(string searchContext) { 18 | base.OnGUI(searchContext); 19 | 20 | EditorGUILayout.LabelField("This is my preferences."); 21 | 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/43.SettingsProvider/Editor/MyPreferencesProvider.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2ce22978acc094ab1a099a6a4755ee08 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/43.SettingsProvider/Editor/settings_ui.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | using UnityEngine; 3 | using UnityEngine.UIElements; 4 | using UnityEditor.UIElements; 5 | 6 | 7 | public class settings_ui : EditorWindow 8 | { 9 | [MenuItem("Window/UIElements/settings_ui")] 10 | public static void ShowExample() 11 | { 12 | settings_ui wnd = GetWindow(); 13 | wnd.titleContent = new GUIContent("settings_ui"); 14 | } 15 | 16 | public void OnEnable() 17 | { 18 | // Each editor window contains a root VisualElement object 19 | VisualElement root = rootVisualElement; 20 | 21 | // VisualElements objects can contain other VisualElement following a tree hierarchy. 22 | VisualElement label = new Label("Hello World! From C#"); 23 | root.Add(label); 24 | 25 | // Import UXML 26 | var visualTree = AssetDatabase.LoadAssetAtPath("Assets/Unity Attributes Example/43.SettingsProvider/Editor/settings_ui.uxml"); 27 | VisualElement labelFromUXML = visualTree.CloneTree(); 28 | root.Add(labelFromUXML); 29 | 30 | // A stylesheet can be added to a VisualElement. 31 | // The style will be applied to the VisualElement and all of its children. 32 | var styleSheet = AssetDatabase.LoadAssetAtPath("Assets/Unity Attributes Example/43.SettingsProvider/Editor/settings_ui.uss"); 33 | VisualElement labelWithStyle = new Label("Hello World! With Style"); 34 | labelWithStyle.styleSheets.Add(styleSheet); 35 | root.Add(labelWithStyle); 36 | } 37 | } -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/43.SettingsProvider/Editor/settings_ui.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d91876ae84b314008855618c2d2471d9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/43.SettingsProvider/Editor/settings_ui.uss: -------------------------------------------------------------------------------- 1 | Label { 2 | font-size: 20px; 3 | -unity-font-style: bold; 4 | color: rgb(68, 138, 255); 5 | } -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/43.SettingsProvider/Editor/settings_ui.uss.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aa07881f21f1f4921b224a9ff6c6744c 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0} 11 | disableValidation: 0 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/43.SettingsProvider/Editor/settings_ui.uxml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/43.SettingsProvider/Editor/settings_ui.uxml.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b7c4de4f809ed400e805286ccdd2214a 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0} 11 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/44.Icon.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d286750e2283a473c8b4353b2caa4859 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/44.Icon/IconExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | 8 | /// 9 | /// https://docs.unity.cn/2021.2/Documentation/ScriptReference/IconAttribute.html 10 | /// 11 | 12 | [Icon("Assets/Unity-Attributes-Example/44.Icon/未标题-1.png")] 13 | public class IconExample : MonoBehaviour { 14 | 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/44.Icon/IconExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 453968c791c3c4b4aa634559d966b873 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/44.Icon/未标题-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/Assets/Unity-Attributes-Example/44.Icon/未标题-1.png -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/44.Icon/未标题-1.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 47d89623e9eac4503b9674b55e246d3c 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | vTOnly: 0 27 | ignoreMasterTextureLimit: 0 28 | grayScaleToAlpha: 0 29 | generateCubemap: 6 30 | cubemapConvolution: 0 31 | seamlessCubemap: 0 32 | textureFormat: 1 33 | maxTextureSize: 2048 34 | textureSettings: 35 | serializedVersion: 2 36 | filterMode: 1 37 | aniso: 1 38 | mipBias: 0 39 | wrapU: 1 40 | wrapV: 1 41 | wrapW: 1 42 | nPOTScale: 0 43 | lightmap: 0 44 | compressionQuality: 50 45 | spriteMode: 1 46 | spriteExtrude: 1 47 | spriteMeshType: 1 48 | alignment: 0 49 | spritePivot: {x: 0.5, y: 0.5} 50 | spritePixelsToUnits: 100 51 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 52 | spriteGenerateFallbackPhysicsShape: 1 53 | alphaUsage: 1 54 | alphaIsTransparency: 1 55 | spriteTessellationDetail: -1 56 | textureType: 8 57 | textureShape: 1 58 | singleChannelComponent: 0 59 | flipbookRows: 1 60 | flipbookColumns: 1 61 | maxTextureSizeSet: 0 62 | compressionQualitySet: 0 63 | textureFormatSet: 0 64 | ignorePngGamma: 0 65 | applyGammaDecoding: 0 66 | platformSettings: 67 | - serializedVersion: 3 68 | buildTarget: DefaultTexturePlatform 69 | maxTextureSize: 2048 70 | resizeAlgorithm: 0 71 | textureFormat: -1 72 | textureCompression: 1 73 | compressionQuality: 50 74 | crunchedCompression: 0 75 | allowsAlphaSplitting: 0 76 | overridden: 0 77 | androidETC2FallbackOverride: 0 78 | forceMaximumCompressionQuality_BC6H_BC7: 0 79 | spriteSheet: 80 | serializedVersion: 2 81 | sprites: [] 82 | outline: [] 83 | physicsShape: [] 84 | bones: [] 85 | spriteID: 5e97eb03825dee720800000000000000 86 | internalID: 0 87 | vertices: [] 88 | indices: 89 | edges: [] 90 | weights: [] 91 | secondaryTextures: [] 92 | nameFileIdTable: {} 93 | spritePackingTag: 94 | pSDRemoveMatte: 0 95 | pSDShowRemoveMatteOption: 0 96 | userData: 97 | assetBundleName: 98 | assetBundleVariant: 99 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/45.InspectorName.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 41242ab4f2a364bc28836ee6dd571d4d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/45.InspectorName/InspectorNameExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | public enum MyEnum { 8 | A, 9 | [InspectorName("B评分")] 10 | B, 11 | [InspectorName("C评分")] 12 | C, 13 | } 14 | 15 | 16 | public class InspectorNameExample : MonoBehaviour { 17 | 18 | public MyEnum myEnum; 19 | 20 | 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/45.InspectorName/InspectorNameExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b4c705f93c3ed4bcc8088ca794c92ae4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/46.Min.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b3546655de7444e1cadd7276c7b0dd5f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/46.Min/MinExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | public class MinExample : MonoBehaviour { 8 | 9 | [Min(20)] 10 | public int intMin = 20; 11 | [Min(1.2f)] 12 | public float floatMin = 1.2f; 13 | 14 | } 15 | 16 | } -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/46.Min/MinExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 28c2ff02a10bf4c94b5ca01e139ef644 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/47.NonReorderable.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d748821e7fb1a4b63b4fcebd78ba5c20 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/47.NonReorderable/NonReorderableExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | public class NonReorderableExample : MonoBehaviour { 8 | 9 | /// 10 | /// 不可排序 11 | /// 12 | [NonReorderable] 13 | public List nonReorderableList = new List { 1, 4, 2, 99 }; 14 | /// 15 | /// 可排序 16 | /// 17 | public List reorderableList = new List { "哈哈", "哈", "哈哈哈哈" }; 18 | 19 | 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/47.NonReorderable/NonReorderableExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 31959b4fa71c64a4c9289cdbf514a497 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/48.SearchContext.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9f2785c5863384b9c9be120b1934c58b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/48.SearchContext/SearchContextExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | using UnityEngine.Search; 6 | 7 | using Object = UnityEngine.Object; 8 | 9 | namespace UnityAttributesExample { 10 | 11 | /// 12 | /// https://docs.unity.cn/2021.2/Documentation/ScriptReference/Search.SearchContextAttribute.html 13 | /// https://docs.unity.cn/2021.2/Documentation/ScriptReference/Search.SearchContextAttribute-ctor.html 14 | /// 15 | 16 | public class SearchContextExample : MonoBehaviour { 17 | 18 | const string assetProviders = "adb;asset"; 19 | const string objectProviders = "adb,asset,scene,expression"; 20 | 21 | //[SearchContext("", "adb", SearchViewFlags.ListView)] public MonoScript myProjectScript; 22 | //[SearchContext("", "adb", SearchViewFlags.Packages | SearchViewFlags.CompactView)] public MonoScript myPackageScript; 23 | 24 | 25 | [SearchContext("", "adb", SearchViewFlags.ListView)] 26 | public Object myProjectScript; 27 | [SearchContext("", "adb", SearchViewFlags.Packages | SearchViewFlags.CompactView)] 28 | public Object myPackageScript; 29 | 30 | [SearchContext("t:texture", assetProviders, SearchViewFlags.GridView)] 31 | public Texture myTexture; 32 | [SearchContext("t:texture", "adb", SearchViewFlags.OpenInspectorPreview)] 33 | public Texture myTextureWithInspector; 34 | [SearchContext("Assets non_mobile", SearchViewFlags.Centered)] 35 | public Object myAnyObject; 36 | [SearchContext("Assets non_mobile", SearchViewFlags.Debug)] 37 | public Object myDebugObject; 38 | [SearchContext("t:mesh is:nested mesh", "asset")] 39 | public Object assetMesh; 40 | [SearchContext("h:cube", objectProviders)] 41 | public MeshFilter sceneMesh; 42 | [SearchContext("shader:standard", assetProviders, SearchViewFlags.HideSearchBar)] 43 | public Material materialNoSearchBar; 44 | [SearchContext("select{p:t:material, @label, @size}", objectProviders, SearchViewFlags.TableView)] 45 | public Material selectMaterial; 46 | [SearchContext("Assets/Queries/textures.asset", assetProviders)] 47 | public Texture searchQueryPathTexture; 48 | [SearchContext("3c7f5dff3fb5d724688dfcecfb131b2a", assetProviders)] 49 | public Texture searchQueryGuidTexture; 50 | [SearchContext("Assets non_mobile", SearchViewFlags.EnableSearchQuery)] 51 | public Object myObjectWithSearchQueryEnabled; 52 | [SearchContext("Assets non_mobile", SearchViewFlags.DisableInspectorPreview)] 53 | public Object myObjectWithInspectorDisabled; 54 | 55 | public Object noSearchContextObj; 56 | 57 | } 58 | 59 | } -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/48.SearchContext/SearchContextExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6043f371ae7aa4f5ea8dd3aa4b3a064c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/49.InitializeOnEnterPlay.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: da4efc438d4c04ee5af00d7274ba23a0 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/49.InitializeOnEnterPlay/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4c7978fb073ef473bb070bd22685c997 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/49.InitializeOnEnterPlay/Editor/InitializeOnEnterPlayExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | using UnityEditor; 6 | 7 | /// 8 | /// https://docs.unity.cn/2021.2/Documentation/ScriptReference/InitializeOnEnterPlayModeAttribute.html 9 | /// 10 | /// 11 | namespace UnityAttributesExample { 12 | 13 | /// 14 | /// Reset static fields in Editor classes on Enter Play Mode without Domain Reload. 15 | /// 16 | 17 | public class MyAnotherClass { 18 | public static int s_MySimpleValue = 0; 19 | 20 | /// 21 | /// Allow an editor class method to be initialized when Unity enters Play Mode. 22 | /// 23 | /// 24 | [InitializeOnEnterPlayMode] 25 | static void OnEnterPlaymodeInEditor(EnterPlayModeOptions options) { 26 | //Debug.Log("Entering PlayMode"); 27 | 28 | if (options.HasFlag(EnterPlayModeOptions.DisableDomainReload)) 29 | s_MySimpleValue = 0; 30 | } 31 | } 32 | 33 | /// 34 | /// Perform any other logic on Enter Play Mode. 35 | /// 36 | 37 | public class MyClass { 38 | public static int s_MyValue = 0; 39 | 40 | static void MyClassPlaymodeSetup() { 41 | s_MyValue = 1000; 42 | //... 43 | } 44 | 45 | [InitializeOnEnterPlayMode] 46 | static void OnEnterPlaymodeInEditor(EnterPlayModeOptions options) { 47 | //Debug.Log("Entering PlayMode"); 48 | MyClassPlaymodeSetup(); 49 | } 50 | } 51 | 52 | } 53 | 54 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/49.InitializeOnEnterPlay/Editor/InitializeOnEnterPlayExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 72fc86e34eace44058d117eaae503e12 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/5.ContextMenu.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 254395a9bd1d5444bb3d6f1dea0907b6 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/5.ContextMenu/ContextMenuExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | public class ContextMenuExample : MonoBehaviour { 8 | 9 | // The ContextMenu attribute allows you to add commands to the context menu. 10 | // In the inspector of the attached script. 11 | // When the user selects the context menu, the function will be executed. 12 | // This is most useful for automatically setting up Scene data from the script. 13 | // The function has to be non-static. 14 | 15 | // Add a context menu named "Do Something" in the inspector of the attached script. 16 | 17 | [ContextMenu("Do Something")] 18 | void DoSomething() { 19 | Debug.Log("Perform operation"); 20 | } 21 | 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/5.ContextMenu/ContextMenuExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fda65dd5948cf4a9589ce73b92cae73d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/50.FilePath.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eb7604441088d4e10911f7fe470bb126 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/50.FilePath/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 57ba3d6e4e83649679f5622d05e57da6 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/50.FilePath/Editor/FilePathExample.txt: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: fa4bf5f3dbcc34f728926dc39b7f0b7b, type: 3} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_Number: 1344 16 | m_Strings: 17 | - Foo84 18 | - Foo168 19 | - Foo336 20 | - Foo672 21 | - Foo1344 22 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/50.FilePath/Editor/FilePathExample.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b3f3d0c3426924775a6b1d9ab0637bc2 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/50.FilePath/Editor/MySingleton.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | using UnityEditor; 6 | 7 | 8 | namespace UnityAttributesExample { 9 | 10 | [FilePath("Assets/Unity-Attributes-Example/50.FilePath/Editor/FilePathExample.txt", FilePathAttribute.Location.ProjectFolder)] 11 | public class MySingleton : ScriptableSingleton { 12 | 13 | [SerializeField] 14 | float m_Number = 42; 15 | 16 | [SerializeField] 17 | List m_Strings = new List(); 18 | 19 | public void Modify() { 20 | m_Number *= 2; 21 | m_Strings.Add("Foo" + m_Number); 22 | 23 | Save(true); 24 | Debug.Log("Saved to: " + GetFilePath()); 25 | AssetDatabase.Refresh(); 26 | } 27 | 28 | public void Log() { 29 | Debug.Log("MySingleton state: " + JsonUtility.ToJson(this, true)); 30 | } 31 | 32 | } 33 | 34 | static class MySingletonMenuItems { 35 | [MenuItem("Unity-Attributes-Example/FilePathExample/SingletonTest/Log")] 36 | static void LogMySingletonState() { 37 | MySingleton.instance.Log(); 38 | } 39 | 40 | [MenuItem("Unity-Attributes-Example/FilePathExample/SingletonTest/Modify")] 41 | static void ModifyMySingletonState() { 42 | MySingleton.instance.Modify(); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/50.FilePath/Editor/MySingleton.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fa4bf5f3dbcc34f728926dc39b7f0b7b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/51.CustomEditor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b9fd348c8766049c6b9df015b3601943 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/51.CustomEditor/CustomEditorExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | 8 | public class CustomEditorExample : MonoBehaviour { 9 | 10 | 11 | public int aaa = 10; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/51.CustomEditor/CustomEditorExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d4c93cff7ee3044d08fc2338cce07018 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/51.CustomEditor/CustomEditorExample2.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | public class CustomEditorExample2 : CustomEditorExample { 8 | public bool bbb; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/51.CustomEditor/CustomEditorExample2.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 067d5c080dfd342f68d7de8b50cb5a17 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/51.CustomEditor/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1a2e8606267e3450c908731f34b51c21 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/51.CustomEditor/Editor/CustomEditorExampleEditor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | using UnityEditor; 6 | 7 | namespace UnityAttributesExample { 8 | 9 | [CustomEditor(typeof(CustomEditorExample), true)] 10 | public class CustomEditorExampleEditor : Editor { 11 | 12 | public override void OnInspectorGUI() { 13 | base.OnInspectorGUI(); 14 | 15 | if (GUILayout.Button("A button")) { 16 | 17 | } 18 | 19 | } 20 | 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/51.CustomEditor/Editor/CustomEditorExampleEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b89be01f7be2b445cb530be114e50f44 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/52.DidReloadScripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7f640aef8f5e64ff980038dfa636d755 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/52.DidReloadScripts/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7633bf4cba1aa4c9ba0be8e8fa881727 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/52.DidReloadScripts/Editor/DidReloadScriptsExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | using UnityEditor; 6 | using UnityEditor.Callbacks; 7 | 8 | namespace UnityAttributesExample { 9 | 10 | public class DidReloadScriptsExample { 11 | [DidReloadScripts] 12 | static void AfterReloadedScripts() { 13 | //Debug.LogWarning("AfterReloadedScripts"); 14 | } 15 | } 16 | 17 | } 18 | 19 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/52.DidReloadScripts/Editor/DidReloadScriptsExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3530a3490301a4b1baa1511f388db1dd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/6.ContextMenuItem.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 65202c26845d24ea1bee075dc325de99 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/6.ContextMenuItem/ContextMenuItemExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | public class ContextMenuItemExample : MonoBehaviour { 8 | 9 | const int DEFAULT_VALUE = 100; 10 | 11 | // Use this attribute to add a context menu to a field that calls a named method. 12 | 13 | [ContextMenuItem("Log", "LogValue", order = -1)] 14 | [ContextMenuItem("Reset", "ResetValue")] 15 | public int value = DEFAULT_VALUE; 16 | 17 | void LogValue() { 18 | Debug.LogWarning(value); 19 | } 20 | 21 | void ResetValue() { 22 | value = DEFAULT_VALUE; 23 | } 24 | 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/6.ContextMenuItem/ContextMenuItemExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4810db9226afa427abc972fff2747017 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/7.CreateAssetMenu.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a6a6749d913d948d4a57223a3c2a18b6 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/7.CreateAssetMenu/CreateAssetMenuExample.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: f3209469ccc7e4a0dbb15d0a75a06323, type: 3} 13 | m_Name: CreateAssetMenuExample 14 | m_EditorClassIdentifier: 15 | myInt: 222 16 | myString: this is a scriptable object asset 17 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/7.CreateAssetMenu/CreateAssetMenuExample.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b93a93ef9bbc84e5398095753b6c489a 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/7.CreateAssetMenu/CreateAssetMenuExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | // Mark a ScriptableObject-derived type to be automatically listed in the Assets/Create submenu, 8 | // so that instances of the type can be easily created and stored in the project as ".asset" files. 9 | 10 | [CreateAssetMenu(fileName = "CreateAssetMenuExample.asset", menuName = "Unity-Attributes-Example/CreateAssetMenuExample", order = -7020)] 11 | public class CreateAssetMenuExample : ScriptableObject { 12 | 13 | public int myInt = 222; 14 | 15 | public string myString = "this is a scriptable object asset"; 16 | 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/7.CreateAssetMenu/CreateAssetMenuExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f3209469ccc7e4a0dbb15d0a75a06323 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/8.CustomGridBrush.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1d90e0f9beced45858ecbaa7322c3a6d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/8.CustomGridBrush/CustomGridBrushExample.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: CustomGridBrushExample 14 | m_EditorClassIdentifier: 15 | m_Sprite: {fileID: 21300000, guid: ad0b9f44bbd9744bd8fcb11c131ac8d9, type: 3} 16 | m_Color: {r: 1, g: 0, b: 0, a: 1} 17 | m_Transform: 18 | e00: 1 19 | e01: 0 20 | e02: 0 21 | e03: 0 22 | e10: 0 23 | e11: 1 24 | e12: 0 25 | e13: 0 26 | e20: 0 27 | e21: 0 28 | e22: 1 29 | e23: 0 30 | e30: 0 31 | e31: 0 32 | e32: 0 33 | e33: 1 34 | m_InstancedGameObject: {fileID: 0} 35 | m_Flags: 1 36 | m_ColliderType: 2 37 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/8.CustomGridBrush/CustomGridBrushExample.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e3b7aee6898dd46719012dd8b5945ed9 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/8.CustomGridBrush/CustomGridBrushExample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/Assets/Unity-Attributes-Example/8.CustomGridBrush/CustomGridBrushExample.png -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/8.CustomGridBrush/CustomGridBrushExample.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c4cd33aa09a844de9868b060435d951b 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/8.CustomGridBrush/CustomGridBrushExampleSettings.lighting: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!850595691 &4890085278179872738 4 | LightingSettings: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_Name: CustomGridBrushExampleSettings 10 | serializedVersion: 3 11 | m_GIWorkflowMode: 1 12 | m_EnableBakedLightmaps: 0 13 | m_EnableRealtimeLightmaps: 0 14 | m_RealtimeEnvironmentLighting: 1 15 | m_BounceScale: 1 16 | m_AlbedoBoost: 1 17 | m_IndirectOutputScale: 1 18 | m_UsingShadowmask: 1 19 | m_BakeBackend: 1 20 | m_LightmapMaxSize: 1024 21 | m_BakeResolution: 40 22 | m_Padding: 2 23 | m_TextureCompression: 1 24 | m_AO: 0 25 | m_AOMaxDistance: 1 26 | m_CompAOExponent: 1 27 | m_CompAOExponentDirect: 0 28 | m_ExtractAO: 0 29 | m_MixedBakeMode: 2 30 | m_LightmapsBakeMode: 1 31 | m_FilterMode: 1 32 | m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0} 33 | m_ExportTrainingData: 0 34 | m_TrainingDataDestination: TrainingData 35 | m_RealtimeResolution: 2 36 | m_ForceWhiteAlbedo: 0 37 | m_ForceUpdates: 0 38 | m_FinalGather: 0 39 | m_FinalGatherRayCount: 256 40 | m_FinalGatherFiltering: 1 41 | m_PVRCulling: 1 42 | m_PVRSampling: 1 43 | m_PVRDirectSampleCount: 32 44 | m_PVRSampleCount: 512 45 | m_PVREnvironmentSampleCount: 256 46 | m_PVREnvironmentReferencePointCount: 2048 47 | m_LightProbeSampleCountMultiplier: 4 48 | m_PVRBounces: 2 49 | m_PVRMinBounces: 2 50 | m_PVREnvironmentMIS: 1 51 | m_PVRFilteringMode: 1 52 | m_PVRDenoiserTypeDirect: 1 53 | m_PVRDenoiserTypeIndirect: 1 54 | m_PVRDenoiserTypeAO: 1 55 | m_PVRFilterTypeDirect: 0 56 | m_PVRFilterTypeIndirect: 0 57 | m_PVRFilterTypeAO: 0 58 | m_PVRFilteringGaussRadiusDirect: 1 59 | m_PVRFilteringGaussRadiusIndirect: 5 60 | m_PVRFilteringGaussRadiusAO: 2 61 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 62 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 63 | m_PVRFilteringAtrousPositionSigmaAO: 1 64 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/8.CustomGridBrush/CustomGridBrushExampleSettings.lighting.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 89fc9c946b9094891af3dc7f13165bb3 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 4890085278179872738 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/8.CustomGridBrush/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f089fd6d9b3c648a6b66734fc6d65c0e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/8.CustomGridBrush/Editor/CustomGridBrushExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityEditor.Tilemaps { 6 | 7 | [CustomGridBrush(false, false, false, "CustomGridBrushExample")] 8 | public class CustomGridBrushExample : GridBrush { 9 | 10 | 11 | 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/8.CustomGridBrush/Editor/CustomGridBrushExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7e26afa48ead24c97b2078b2aa477ab2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/8.CustomGridBrush/New Palette.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4e6f2b6e2102f401bb83fdee28ec87a3 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/9.Delayed.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: af2c17cfd1e124fef8f6b96f69e24585 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/9.Delayed/DelayedExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityAttributesExample { 6 | 7 | public class DelayedExample : MonoBehaviour { 8 | 9 | // Attribute used to make a float, int, or string variable in a script be delayed. 10 | // When this attribute is used, the float, int, or text field will not return a new value 11 | // until the user has pressed enter or focus is moved away from the field. 12 | 13 | [Delayed] 14 | public int intValue = 22; 15 | [Delayed] 16 | public float floatValue = 0.618f; 17 | [Delayed] 18 | public string stringValue = "test delayed attribute"; 19 | 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/9.Delayed/DelayedExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2fc95b751e9ee42c2b63a5298b12d22f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/9.Delayed/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b3c9cc9baca8e4f9e873d4b0d2127e62 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/9.Delayed/Editor/DelayedExampleEditor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | using UnityEditor; 6 | 7 | namespace UnityAttributesExample { 8 | 9 | [CustomEditor(typeof(DelayedExample))] 10 | public class DelayedExampleEditor : Editor { 11 | 12 | public override void OnInspectorGUI() { 13 | base.OnInspectorGUI(); 14 | 15 | DelayedExample example = target as DelayedExample; 16 | 17 | GUILayout.Label("The new int value is " + example.intValue); 18 | GUILayout.Label("The new float value is " + example.floatValue); 19 | GUILayout.Label("The new string value is '" + example.stringValue + "'"); 20 | 21 | GUILayout.Box("" + 22 | "Attribute used to make a float, int, or string variable in a script be delayed. " + 23 | "When this attribute is used, the float, int, or text field will not return a new value " + 24 | "until the user has pressed enter or focus is moved away from the field."); 25 | } 26 | 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/9.Delayed/Editor/DelayedExampleEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cf245789767304a0f9f88d5318f10fd7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/Unity-Attributes-Example.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba1032d12a8ef4f59aa63c0d5134edbf 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/Unity-Attributes-ExampleSettings.lighting: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!850595691 &4890085278179872738 4 | LightingSettings: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_Name: Unity-Attributes-ExampleSettings 10 | serializedVersion: 3 11 | m_GIWorkflowMode: 1 12 | m_EnableBakedLightmaps: 0 13 | m_EnableRealtimeLightmaps: 0 14 | m_RealtimeEnvironmentLighting: 1 15 | m_BounceScale: 1 16 | m_AlbedoBoost: 1 17 | m_IndirectOutputScale: 1 18 | m_UsingShadowmask: 1 19 | m_BakeBackend: 1 20 | m_LightmapMaxSize: 1024 21 | m_BakeResolution: 40 22 | m_Padding: 2 23 | m_TextureCompression: 1 24 | m_AO: 0 25 | m_AOMaxDistance: 1 26 | m_CompAOExponent: 1 27 | m_CompAOExponentDirect: 0 28 | m_ExtractAO: 0 29 | m_MixedBakeMode: 2 30 | m_LightmapsBakeMode: 1 31 | m_FilterMode: 1 32 | m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0} 33 | m_ExportTrainingData: 0 34 | m_TrainingDataDestination: TrainingData 35 | m_RealtimeResolution: 2 36 | m_ForceWhiteAlbedo: 0 37 | m_ForceUpdates: 0 38 | m_FinalGather: 0 39 | m_FinalGatherRayCount: 256 40 | m_FinalGatherFiltering: 1 41 | m_PVRCulling: 1 42 | m_PVRSampling: 1 43 | m_PVRDirectSampleCount: 32 44 | m_PVRSampleCount: 500 45 | m_PVREnvironmentSampleCount: 500 46 | m_PVREnvironmentReferencePointCount: 2048 47 | m_LightProbeSampleCountMultiplier: 4 48 | m_PVRBounces: 2 49 | m_PVRMinBounces: 2 50 | m_PVREnvironmentMIS: 0 51 | m_PVRFilteringMode: 2 52 | m_PVRDenoiserTypeDirect: 0 53 | m_PVRDenoiserTypeIndirect: 0 54 | m_PVRDenoiserTypeAO: 0 55 | m_PVRFilterTypeDirect: 0 56 | m_PVRFilterTypeIndirect: 0 57 | m_PVRFilterTypeAO: 0 58 | m_PVRFilteringGaussRadiusDirect: 1 59 | m_PVRFilteringGaussRadiusIndirect: 5 60 | m_PVRFilteringGaussRadiusAO: 2 61 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 62 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 63 | m_PVRFilteringAtrousPositionSigmaAO: 1 64 | -------------------------------------------------------------------------------- /Assets/Unity-Attributes-Example/Unity-Attributes-ExampleSettings.lighting.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9a1e9061351f048d8949c141e260e778 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 4890085278179872738 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 assertorz 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.2d.sprite": "1.0.0", 4 | "com.unity.2d.tilemap": "1.0.0", 5 | "com.unity.2d.tilemap.extras": "2.0.0", 6 | "com.unity.ide.visualstudio": "2.0.9", 7 | "com.unity.ugui": "1.0.0", 8 | "com.unity.modules.ai": "1.0.0", 9 | "com.unity.modules.androidjni": "1.0.0", 10 | "com.unity.modules.animation": "1.0.0", 11 | "com.unity.modules.assetbundle": "1.0.0", 12 | "com.unity.modules.audio": "1.0.0", 13 | "com.unity.modules.cloth": "1.0.0", 14 | "com.unity.modules.director": "1.0.0", 15 | "com.unity.modules.imageconversion": "1.0.0", 16 | "com.unity.modules.imgui": "1.0.0", 17 | "com.unity.modules.jsonserialize": "1.0.0", 18 | "com.unity.modules.nvidia": "1.0.0", 19 | "com.unity.modules.particlesystem": "1.0.0", 20 | "com.unity.modules.physics": "1.0.0", 21 | "com.unity.modules.physics2d": "1.0.0", 22 | "com.unity.modules.ui": "1.0.0", 23 | "com.unity.modules.uielements": "1.0.0", 24 | "com.unity.modules.umbra": "1.0.0", 25 | "com.unity.modules.unitywebrequest": "1.0.0", 26 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 27 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 28 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 29 | "com.unity.modules.unitywebrequestwww": "1.0.0", 30 | "com.unity.modules.video": "1.0.0", 31 | "com.unity.modules.vr": "1.0.0", 32 | "com.unity.modules.xr": "1.0.0" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | m_Volume: 1 7 | Rolloff Scale: 1 8 | Doppler Factor: 1 9 | Default Speaker Mode: 2 10 | m_SampleRate: 0 11 | m_DSPBufferSize: 1024 12 | m_VirtualVoiceCount: 512 13 | m_RealVoiceCount: 32 14 | m_SpatializerPlugin: 15 | m_AmbisonicDecoderPlugin: 16 | m_DisableAudio: 0 17 | m_VirtualizeEffects: 1 18 | -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 7 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 1 23 | m_ClothInterCollisionSettingsToggle: 0 24 | m_ContactPairsMode: 0 25 | m_BroadphaseType: 0 26 | m_WorldBounds: 27 | m_Center: {x: 0, y: 0, z: 0} 28 | m_Extent: {x: 250, y: 250, z: 250} 29 | m_WorldSubdivisions: 8 30 | -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: 8 | - enabled: 1 9 | path: Assets/Unity-Attributes-Example/Unity-Attributes-Example.unity 10 | guid: ba1032d12a8ef4f59aa63c0d5134edbf 11 | m_configObjects: {} 12 | -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 11 7 | m_SerializationMode: 2 8 | m_LineEndingsForNewScripts: 1 9 | m_DefaultBehaviorMode: 1 10 | m_PrefabRegularEnvironment: {fileID: 0} 11 | m_PrefabUIEnvironment: {fileID: 0} 12 | m_SpritePackerMode: 4 13 | m_SpritePackerPaddingPower: 1 14 | m_Bc7TextureCompressor: 0 15 | m_EtcTextureCompressorBehavior: 1 16 | m_EtcTextureFastCompressor: 1 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 4 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmref 20 | m_ProjectGenerationRootNamespace: 21 | m_EnableTextureStreamingInEditMode: 1 22 | m_EnableTextureStreamingInPlayMode: 1 23 | m_AsyncShaderCompilation: 1 24 | m_CachingShaderPreprocessor: 1 25 | m_PrefabModeAllowAutoSave: 1 26 | m_EnterPlayModeOptionsEnabled: 0 27 | m_EnterPlayModeOptions: 3 28 | m_GameObjectNamingDigits: 1 29 | m_GameObjectNamingScheme: 0 30 | m_AssetNamingUsesSpace: 1 31 | m_UseLegacyProbeSampleCount: 1 32 | m_SerializeInlineMappingsOnOneLine: 0 33 | m_DisableCookiesInLightmapper: 1 34 | m_AssetPipelineMode: 1 35 | m_RefreshImportMode: 0 36 | m_CacheServerMode: 0 37 | m_CacheServerEndpoint: 38 | m_CacheServerNamespacePrefix: default 39 | m_CacheServerEnableDownload: 1 40 | m_CacheServerEnableUpload: 1 41 | m_CacheServerEnableAuth: 0 42 | m_CacheServerEnableTls: 0 43 | -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 13 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 16002, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} 38 | m_PreloadedShaders: [] 39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 40 | type: 0} 41 | m_CustomRenderPipeline: {fileID: 0} 42 | m_TransparencySortMode: 0 43 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 44 | m_DefaultRenderingPath: 1 45 | m_DefaultMobileRenderingPath: 1 46 | m_TierSettings: [] 47 | m_LightmapStripping: 0 48 | m_FogStripping: 0 49 | m_InstancingStripping: 0 50 | m_LightmapKeepPlain: 1 51 | m_LightmapKeepDirCombined: 1 52 | m_LightmapKeepDynamicPlain: 1 53 | m_LightmapKeepDynamicDirCombined: 1 54 | m_LightmapKeepShadowMask: 1 55 | m_LightmapKeepSubtractive: 1 56 | m_FogKeepLinear: 1 57 | m_FogKeepExp: 1 58 | m_FogKeepExp2: 1 59 | m_AlbedoSwatchInfos: [] 60 | m_LightsUseLinearIntensity: 0 61 | m_LightsUseColorTemperature: 0 62 | m_LogWhenShaderIsCompiled: 0 63 | m_AllowEnlightenSupportForUpgradedProject: 1 64 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!149 &1 4 | NetworkManager: 5 | m_ObjectHideFlags: 0 6 | m_DebugLevel: 0 7 | m_Sendrate: 15 8 | m_AssetToPrefab: {} 9 | -------------------------------------------------------------------------------- /ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreReleasePackages: 0 16 | m_EnablePackageDependencies: 0 17 | m_AdvancedSettingsExpanded: 1 18 | m_ScopedRegistriesSettingsExpanded: 1 19 | m_SeeAllPackageVersions: 0 20 | oneTimeWarningShown: 0 21 | m_Registries: 22 | - m_Id: main 23 | m_Name: 24 | m_Url: https://packages.unity.com 25 | m_Scopes: [] 26 | m_IsDefault: 1 27 | m_Capabilities: 7 28 | m_UserSelectedRegistryName: 29 | m_UserAddingNewScopedRegistry: 0 30 | m_RegistryInfoDraft: 31 | m_Modified: 0 32 | m_ErrorMessage: 33 | m_UserModificationsInstanceId: -844 34 | m_OriginalInstanceId: -846 35 | m_LoadAssets: 0 36 | -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 3 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_AutoSyncTransforms: 1 46 | m_AlwaysShowColliders: 0 47 | m_ShowColliderSleep: 1 48 | m_ShowColliderContacts: 0 49 | m_ShowColliderAABB: 0 50 | m_ContactArrowScale: 0.2 51 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 52 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 53 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 54 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 55 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 56 | -------------------------------------------------------------------------------- /ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_DefaultPresets: 8 | - first: 9 | m_NativeTypeID: 114 10 | m_ManagedTypePPtr: {fileID: 11500000, guid: 529d8809aa69848c0adc07d9c1b2e741, 11 | type: 3} 12 | m_ManagedTypeFallback: 13 | second: 14 | - m_Preset: {fileID: 2655988077585873504, guid: e53dd1cf132244657aa954fe7303809e, 15 | type: 2} 16 | m_Filter: 17 | m_Disabled: 0 18 | - first: 19 | m_NativeTypeID: 114 20 | m_ManagedTypePPtr: {fileID: 11500000, guid: 692b8690426894fb2a9f5a5f05e72640, 21 | type: 3} 22 | m_ManagedTypeFallback: 23 | second: 24 | - m_Preset: {fileID: 2655988077585873504, guid: 3ece2b50ef87a46eb9e24f7c9a3a58b2, 25 | type: 2} 26 | m_Filter: 27 | m_Disabled: 0 28 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2021.2.0a21 2 | m_EditorVersionWithRevision: 2021.2.0a21 (75138d5880a6) 3 | -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.1 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 1 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_TestInitMode: 0 13 | CrashReportingSettings: 14 | m_EventUrl: https://perf-events.cloud.unity3d.com 15 | m_Enabled: 0 16 | m_LogBufferSize: 10 17 | m_CaptureEditorExceptions: 1 18 | UnityPurchasingSettings: 19 | m_Enabled: 0 20 | m_TestMode: 0 21 | UnityAnalyticsSettings: 22 | m_Enabled: 0 23 | m_TestMode: 0 24 | m_InitializeOnStartup: 1 25 | UnityAdsSettings: 26 | m_Enabled: 0 27 | m_InitializeOnStartup: 1 28 | m_TestMode: 0 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | -------------------------------------------------------------------------------- /ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_RenderPipeSettingsPath: 10 | m_FixedTimeStep: 0.016666668 11 | m_MaxDeltaTime: 0.05 12 | -------------------------------------------------------------------------------- /ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_CollabEditorSettings: 8 | inProgressEnabled: 1 9 | -------------------------------------------------------------------------------- /ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /img/11.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/11.gif -------------------------------------------------------------------------------- /img/12.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/12.gif -------------------------------------------------------------------------------- /img/16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/16.gif -------------------------------------------------------------------------------- /img/21.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/21.gif -------------------------------------------------------------------------------- /img/22.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/22.gif -------------------------------------------------------------------------------- /img/23.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/23.gif -------------------------------------------------------------------------------- /img/25.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/25.gif -------------------------------------------------------------------------------- /img/27.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/27.gif -------------------------------------------------------------------------------- /img/30.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/30.gif -------------------------------------------------------------------------------- /img/32.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/32.gif -------------------------------------------------------------------------------- /img/33.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/33.gif -------------------------------------------------------------------------------- /img/34.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/34.gif -------------------------------------------------------------------------------- /img/36.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/36.gif -------------------------------------------------------------------------------- /img/38.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/38.gif -------------------------------------------------------------------------------- /img/46.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/46.gif -------------------------------------------------------------------------------- /img/47.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/47.gif -------------------------------------------------------------------------------- /img/50.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/50.gif -------------------------------------------------------------------------------- /img/Xnip2021-06-20_14-16-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/Xnip2021-06-20_14-16-01.png -------------------------------------------------------------------------------- /img/Xnip2021-06-20_14-25-19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/Xnip2021-06-20_14-25-19.png -------------------------------------------------------------------------------- /img/Xnip2021-06-20_14-52-41.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/Xnip2021-06-20_14-52-41.png -------------------------------------------------------------------------------- /img/Xnip2021-06-20_15-10-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/Xnip2021-06-20_15-10-29.png -------------------------------------------------------------------------------- /img/Xnip2021-06-20_15-24-35.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/Xnip2021-06-20_15-24-35.png -------------------------------------------------------------------------------- /img/Xnip2021-06-20_15-31-15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/Xnip2021-06-20_15-31-15.png -------------------------------------------------------------------------------- /img/Xnip2021-06-20_15-35-28.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/Xnip2021-06-20_15-35-28.png -------------------------------------------------------------------------------- /img/Xnip2021-06-20_15-39-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/Xnip2021-06-20_15-39-03.png -------------------------------------------------------------------------------- /img/Xnip2021-06-20_17-04-13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/Xnip2021-06-20_17-04-13.png -------------------------------------------------------------------------------- /img/Xnip2021-06-20_17-24-22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/Xnip2021-06-20_17-24-22.png -------------------------------------------------------------------------------- /img/Xnip2021-06-20_17-26-33.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/Xnip2021-06-20_17-26-33.png -------------------------------------------------------------------------------- /img/Xnip2021-06-20_18-07-44.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/Xnip2021-06-20_18-07-44.png -------------------------------------------------------------------------------- /img/Xnip2021-06-20_19-44-08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/Xnip2021-06-20_19-44-08.png -------------------------------------------------------------------------------- /img/Xnip2021-06-20_19-59-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/Xnip2021-06-20_19-59-50.png -------------------------------------------------------------------------------- /img/Xnip2021-06-20_20-36-37.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/Xnip2021-06-20_20-36-37.png -------------------------------------------------------------------------------- /img/Xnip2021-06-20_21-45-19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/Xnip2021-06-20_21-45-19.png -------------------------------------------------------------------------------- /img/Xnip2021-06-20_22-27-49.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/Xnip2021-06-20_22-27-49.png -------------------------------------------------------------------------------- /img/assemblyIseditorassembly.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/assemblyIseditorassembly.gif -------------------------------------------------------------------------------- /img/beforerenderorder.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/beforerenderorder.jpg -------------------------------------------------------------------------------- /img/colorusage1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/colorusage1.jpg -------------------------------------------------------------------------------- /img/colorusage2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/colorusage2.jpg -------------------------------------------------------------------------------- /img/contextmenu.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/contextmenu.gif -------------------------------------------------------------------------------- /img/contextmenuitem.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/contextmenuitem.gif -------------------------------------------------------------------------------- /img/createassetmenu.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/createassetmenu.gif -------------------------------------------------------------------------------- /img/customgridbrush.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/customgridbrush.gif -------------------------------------------------------------------------------- /img/delayed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/delayed.gif -------------------------------------------------------------------------------- /img/disallowmultiplecomponent.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/disallowmultiplecomponent.gif -------------------------------------------------------------------------------- /img/gridpaintsorting1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/gridpaintsorting1.jpg -------------------------------------------------------------------------------- /img/gridpaintsorting2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/gridpaintsorting2.jpg -------------------------------------------------------------------------------- /img/gridpaintsorting3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LastAssertor/Unity-Attributes-Example/1281612fe9afd694574055b380c5f26401734924/img/gridpaintsorting3.jpg --------------------------------------------------------------------------------