├── Editor
├── Filters.meta
├── Reflection.meta
├── Interface
│ ├── Colors.meta
│ ├── Inspectors.meta
│ ├── TreeViews.meta
│ ├── DaiGUIStyles.cs.meta
│ ├── EditorTexture.meta
│ ├── PropertyDrawers.meta
│ ├── DaiGUIUtility.cs.meta
│ ├── Colors
│ │ ├── ColorPalette.cs.meta
│ │ ├── SkinnedColor.cs.meta
│ │ ├── SkinnedColor.cs
│ │ └── ColorPalette.cs
│ ├── EditorTexture
│ │ ├── EditorTexture.cs.meta
│ │ ├── EditorTextures.cs.meta
│ │ ├── EditorTextures.cs
│ │ └── EditorTexture.cs
│ ├── TreeViews
│ │ ├── ImportProfileTableItem.cs.meta
│ │ ├── ImportProfileTableView.cs.meta
│ │ ├── AssetTableItem.cs.meta
│ │ ├── AAssetTableView.cs.meta
│ │ ├── AssetSearchTableItem.cs.meta
│ │ ├── AssetSearchTableView.cs.meta
│ │ ├── ImportProfileAssetTableItem.cs.meta
│ │ ├── ImportProfileAssetTableView.cs.meta
│ │ ├── ImportProfileTableItem.cs
│ │ └── AssetTableItem.cs
│ ├── Inspectors
│ │ ├── AssetImportProfileInspector.cs.meta
│ │ ├── AssetFilterInspector.cs.meta
│ │ ├── AssetFilterInspector.cs
│ │ └── AssetImportProfileInspector.cs
│ ├── PropertyDrawers
│ │ ├── PathFilterPropertyDrawer.cs.meta
│ │ ├── MaterialSetupPropertyDrawer.cs.meta
│ │ ├── StringTokenFilterPropertyDrawer.cs.meta
│ │ ├── NamingConventionRulePropertyDrawer.cs.meta
│ │ ├── PathFilterPropertyDrawer.cs
│ │ ├── NamingConventionRulePropertyDrawer.cs
│ │ └── StringTokenFilterPropertyDrawer.cs
│ ├── DaiGUIContent.cs.meta
│ └── DaiGUIUtility.cs
├── PathConvention
│ ├── Anchor.cs.meta
│ ├── Template.cs.meta
│ ├── GenericResolver.cs.meta
│ ├── ITemplateResolver.cs.meta
│ ├── ResolveException.cs.meta
│ ├── NamingConventionRule.cs.meta
│ ├── DuplicatePlaceholderMode.cs.meta
│ ├── DuplicatePlaceholderMode.cs
│ ├── ITemplateResolver.cs
│ ├── Anchor.cs
│ ├── ResolveException.cs
│ └── GenericResolver.cs
├── Processors
│ ├── ApplyPreset.cs.meta
│ ├── Inspectors.meta
│ ├── AddToSpriteAtlas.cs.meta
│ ├── AssetProcessor.cs.meta
│ ├── CreatePrefab.cs.meta
│ ├── ExtractMaterials.cs.meta
│ ├── PackTexture2D.cs.meta
│ ├── SetAssetBundle.cs.meta
│ ├── SetAssetLabels.cs.meta
│ ├── SetupMaterials.cs.meta
│ ├── StripMeshData.cs.meta
│ ├── SetAtlasAllSettings.cs.meta
│ ├── SetTextureAllSettings.cs.meta
│ ├── Inspectors
│ │ ├── ApplyPresetInspector.cs.meta
│ │ ├── AddToSpriteAtlasInspector.cs.meta
│ │ ├── AssetProcessorInspector.cs.meta
│ │ ├── CreatePrefabInspector.cs.meta
│ │ ├── ExtractMaterialsInspector.cs.meta
│ │ ├── PackTexture2DInspector.cs.meta
│ │ ├── SetAssetBundleInspector.cs.meta
│ │ ├── SetAssetLabelsInspector.cs.meta
│ │ ├── SetupMaterialsInspector.cs.meta
│ │ ├── StripMeshDataInspector.cs.meta
│ │ ├── ResetTransformInspector.cs.meta
│ │ ├── SetTextureFormatInspector.cs.meta
│ │ ├── SetTextureMipmapsInspector.cs.meta
│ │ ├── SetTextureMipmapsInspector.cs
│ │ ├── SetAssetBundleInspector.cs
│ │ ├── ResetTransformInspector.cs
│ │ ├── SetAssetLabelsInspector.cs
│ │ ├── ExtractMaterialsInspector.cs
│ │ ├── SetupMaterialsInspector.cs
│ │ ├── ApplyPresetInspector.cs
│ │ ├── AssetProcessorInspector.cs
│ │ ├── PackTexture2DInspector.cs
│ │ ├── AddToSpriteAtlasInspector.cs
│ │ └── SetTextureFormatInspector.cs
│ ├── AssetProcessorDescriptionAttribute.cs.meta
│ ├── TargetPathType.cs
│ ├── MaterialPathType.cs
│ ├── AnimCompression.cs.meta
│ ├── MaterialPathType.cs.meta
│ ├── ResetTransform.cs.meta
│ ├── SetTextureFormat.cs.meta
│ ├── SetTextureMipmaps.cs.meta
│ ├── TargetPathType.cs.meta
│ ├── SetAssetLabels.cs
│ ├── ResetTransform.cs
│ ├── SetAssetBundle.cs
│ ├── SetTextureMipmaps.cs
│ ├── AnimCompression.cs
│ ├── AssetProcessorDescriptionAttribute.cs
│ ├── ExtractMaterials.cs
│ └── CreatePrefab.cs
├── Utility
│ ├── ColorUtility.cs.meta
│ ├── LinqUtility.cs.meta
│ ├── ObjectUtility.cs.meta
│ ├── PathUtility.cs.meta
│ ├── RectUtility.cs.meta
│ ├── StringUtility.cs.meta
│ ├── TextureUtility.cs.meta
│ ├── EditorWindowUtility.cs.meta
│ ├── AssetDatabaseUtility.cs.meta
│ ├── AssetProcessorUtility.cs.meta
│ ├── AssetReferenceUtility.cs.meta
│ ├── ImportAssetTypeUtility.cs.meta
│ ├── ReorderableListUtility.cs.meta
│ ├── TargetPathTypeUtility.cs.meta
│ ├── SerializedPropertyUtility.cs.meta
│ ├── FileExistsAction.cs
│ ├── FileExistsAction.cs.meta
│ ├── StringConvention.cs.meta
│ ├── AssetImportPipeline.cs.meta
│ ├── AssetModificationMonitor.cs.meta
│ ├── TextureUtility.cs
│ ├── StringConvention.cs
│ ├── PathUtility.cs
│ ├── RectUtility.cs
│ ├── ReorderableListUtility.cs
│ ├── ObjectUtility.cs
│ ├── LinqUtility.cs
│ ├── AssetModificationMonitor.cs
│ ├── AssetProcessorUtility.cs
│ ├── ImportAssetTypeUtility.cs
│ ├── ColorUtility.cs
│ ├── TargetPathTypeUtility.cs
│ ├── EditorWindowUtility.cs
│ └── AssetDatabaseUtility.cs
├── Profiles
│ ├── Import
│ │ ├── AssetFilter.cs.meta
│ │ ├── ImportAssetType.cs.meta
│ │ ├── AssetImportProfile.cs.meta
│ │ ├── ImportProfileUserData.cs.meta
│ │ ├── ImportAssetType.cs
│ │ ├── AssetFilter.cs
│ │ └── AssetImportProfile.cs
│ └── Import.meta
├── Windows
│ ├── AssetSearchWindow.cs.meta
│ ├── ImportProfileWindow.cs.meta
│ ├── ImportProfilesWindow.cs.meta
│ ├── ImportProfileAssetsViewerWindow.cs.meta
│ └── AssetSearchWindow.cs
├── Config
│ ├── AssetPipelineSettings.cs.meta
│ ├── AssetTypeFileExtensions.cs.meta
│ ├── AssetPipelineSettingsProvider.cs.meta
│ ├── AssetTypeFileExtensions.cs
│ └── AssetPipelineSettings.cs
├── Assets
│ ├── __importeraudiodummy__.wav
│ ├── __importerfontsdummy__.ttf
│ ├── __importervideosdummy__.m4v
│ ├── __importertexturesdummy__.png
│ ├── GUIIcon.shader.meta
│ ├── __importerspriteatlasesdummy__.spriteatlas.meta
│ ├── __importermodelsdummy__.obj
│ ├── __importervideosdummy__.m4v.meta
│ ├── __importeraudiodummy__.wav.meta
│ ├── __importerfontsdummy__.ttf.meta
│ ├── GUIIcon.shader
│ ├── __importerspriteatlasesdummy__.spriteatlas
│ ├── __importermodelsdummy__.obj.meta
│ └── __importertexturesdummy__.png.meta
├── Dependencies
│ ├── ReflectionMagic
│ │ ├── LICENSE.txt.meta
│ │ ├── DynamicField.cs.meta
│ │ ├── DynamicProperty.cs.meta
│ │ ├── IDynamicMember.cs.meta
│ │ ├── PrivateReflectionDynamicObjectBase.cs.meta
│ │ ├── PrivateReflectionDynamicObjectInstance.cs.meta
│ │ ├── PrivateReflectionDynamicObjectStatic.cs.meta
│ │ ├── PrivateReflectionUsingDynamicExtensions.cs.meta
│ │ ├── DynamicField.cs
│ │ ├── DynamicProperty.cs
│ │ ├── IDynamicMember.cs
│ │ ├── PrivateReflectionDynamicObjectInstance.cs
│ │ ├── PrivateReflectionUsingDynamicExtensions.cs
│ │ └── PrivateReflectionDynamicObjectStatic.cs
│ └── ReflectionMagic.meta
├── Resources
│ ├── Icons
│ │ ├── IgnoreCaseOff.png
│ │ ├── IgnoreCaseOn.png
│ │ ├── AssetBundleIcon.png
│ │ ├── IgnoreCaseOff@2x.png
│ │ ├── IgnoreCaseOn@2x.png
│ │ └── IgnoreCaseOff.png.meta
│ └── Icons.meta
├── Postprocessors
│ ├── AssetImportPostprocessor.cs.meta
│ └── TexturePostprocess.cs.meta
├── Assets.meta
├── Config.meta
├── Utility.meta
├── Windows.meta
├── Dependencies.meta
├── Interface.meta
├── Processors.meta
├── Profiles.meta
├── Resources.meta
├── AssetPipeline.Editor.asmdef.meta
├── PathConvention.meta
├── Postprocessors.meta
├── Filters
│ ├── PathFilter.cs.meta
│ ├── StringTokenFilter.cs.meta
│ ├── PathFilter.cs
│ └── StringTokenFilter.cs
├── Reflection
│ ├── UnityEditorDynamic.cs.meta
│ └── UnityEditorDynamic.cs
└── AssetPipeline.Editor.asmdef
├── README.md.meta
├── README_EN.md.meta
├── Editor.meta
├── Settings.meta
├── Settings
├── Atlas.asset.meta
├── UIRaw.asset.meta
├── UI2Atlas.asset.meta
├── AssetPipelineSettings.asset.meta
├── Atlas.asset
├── UI2Atlas.asset
├── AssetPipelineSettings.asset
└── UIRaw.asset
└── README.md
/Editor/Filters.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e6e955c6ff334c57a1e3671e32b7f701
3 | timeCreated: 1618158505
--------------------------------------------------------------------------------
/Editor/Reflection.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0dd5ffcda6624e36ab13c42f5e3ec3d6
3 | timeCreated: 1617182411
--------------------------------------------------------------------------------
/Editor/Interface/Colors.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 314f30297d154cda9077530892ddcd0f
3 | timeCreated: 1617183332
--------------------------------------------------------------------------------
/Editor/Interface/Inspectors.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 863ce9a551fa4a9fbb0c55f036d4ecf3
3 | timeCreated: 1617184259
--------------------------------------------------------------------------------
/Editor/Interface/TreeViews.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7e3997ac330e475bb8cb2b1cf12501d0
3 | timeCreated: 1617184237
--------------------------------------------------------------------------------
/Editor/Interface/DaiGUIStyles.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4394526e40b7400498fd48b8b476139b
3 | timeCreated: 1617185252
--------------------------------------------------------------------------------
/Editor/Interface/EditorTexture.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b995df06b0804b89b165c29f0e84fe8d
3 | timeCreated: 1617443618
--------------------------------------------------------------------------------
/Editor/Interface/PropertyDrawers.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3896a7c7815f40b5813d25794fa12a29
3 | timeCreated: 1615614037
--------------------------------------------------------------------------------
/Editor/PathConvention/Anchor.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 78946748c4524f5a8a909c2579597464
3 | timeCreated: 1616436725
--------------------------------------------------------------------------------
/Editor/Processors/ApplyPreset.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0ac655ef70114397af4946274b0afd78
3 | timeCreated: 1615028083
--------------------------------------------------------------------------------
/Editor/Processors/Inspectors.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 394ba7a4311243519a74d56585c8f78d
3 | timeCreated: 1615190426
--------------------------------------------------------------------------------
/Editor/Utility/ColorUtility.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 77d49c4b780c49bbb8987b964db9f672
3 | timeCreated: 1617183159
--------------------------------------------------------------------------------
/Editor/Utility/LinqUtility.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4cd4b63853874649ad7ac7fc4eb6090c
3 | timeCreated: 1617182292
--------------------------------------------------------------------------------
/Editor/Utility/ObjectUtility.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 43b880995b9245f481e596d920a8618c
3 | timeCreated: 1617519756
--------------------------------------------------------------------------------
/Editor/Utility/PathUtility.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a693a5c7df294fa88729756449f268a1
3 | timeCreated: 1617182139
--------------------------------------------------------------------------------
/Editor/Utility/RectUtility.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3f1e28f7958f4081bcdb825360ef3d52
3 | timeCreated: 1617519497
--------------------------------------------------------------------------------
/Editor/Utility/StringUtility.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d793c256289e4d5bb9b191ab17bbf416
3 | timeCreated: 1617182109
--------------------------------------------------------------------------------
/Editor/Utility/TextureUtility.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 85d9423f8b6f454eb7544bd5501f9ec5
3 | timeCreated: 1617444238
--------------------------------------------------------------------------------
/Editor/Interface/DaiGUIUtility.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 8e0e39cd0c644b6b9856ce63356ddf92
3 | timeCreated: 1617183591
--------------------------------------------------------------------------------
/Editor/PathConvention/Template.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4708374c98c048a6b17335115696f011
3 | timeCreated: 1616436279
--------------------------------------------------------------------------------
/Editor/Processors/AddToSpriteAtlas.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a87ab1fb8e3346d59931ee8b71822f6c
3 | timeCreated: 1616231539
--------------------------------------------------------------------------------
/Editor/Processors/AssetProcessor.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 190bb9261b8947089d9d9245c97eebc4
3 | timeCreated: 1615025544
--------------------------------------------------------------------------------
/Editor/Processors/CreatePrefab.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 8cf615fc668e4330a43eea8107d3b91e
3 | timeCreated: 1615028647
--------------------------------------------------------------------------------
/Editor/Processors/ExtractMaterials.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 5ff3abca03d143b0a6593c83cf04061f
3 | timeCreated: 1615316084
--------------------------------------------------------------------------------
/Editor/Processors/PackTexture2D.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: dba5970f2e674607b90753051722c5fb
3 | timeCreated: 1616239179
--------------------------------------------------------------------------------
/Editor/Processors/SetAssetBundle.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 08513f42c23d40348750ab4cf9867586
3 | timeCreated: 1615027951
--------------------------------------------------------------------------------
/Editor/Processors/SetAssetLabels.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 6686c1fa1408445db3d8c8e9aa9cb50a
3 | timeCreated: 1615027867
--------------------------------------------------------------------------------
/Editor/Processors/SetupMaterials.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c1b41e7dba22416390aaebee904d4551
3 | timeCreated: 1615392585
--------------------------------------------------------------------------------
/Editor/Processors/StripMeshData.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a26be12f6d9c4026814d13b079fa7b95
3 | timeCreated: 1616249653
--------------------------------------------------------------------------------
/Editor/Profiles/Import/AssetFilter.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2833c50f97654ad2b8034ab06a4dee5a
3 | timeCreated: 1615036240
--------------------------------------------------------------------------------
/Editor/Utility/EditorWindowUtility.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4dfbbe52ba2c4728b941c1e677b4a5f5
3 | timeCreated: 1617207195
--------------------------------------------------------------------------------
/Editor/Windows/AssetSearchWindow.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: af467c149d7541dd8aadbdd26f8725c3
3 | timeCreated: 1616509364
--------------------------------------------------------------------------------
/Editor/Windows/ImportProfileWindow.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3decbb1e47e34de49cf769ab6cbf3e88
3 | timeCreated: 1616084437
--------------------------------------------------------------------------------
/Editor/Config/AssetPipelineSettings.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f780564f37454ff78ed14f6648c0379e
3 | timeCreated: 1615307033
--------------------------------------------------------------------------------
/Editor/Config/AssetTypeFileExtensions.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 24e1b1fd1e1d441c9d6138fe871b4cfc
3 | timeCreated: 1615489668
--------------------------------------------------------------------------------
/Editor/Interface/Colors/ColorPalette.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 5dad3b922b414aab829cf17fcba2fd03
3 | timeCreated: 1617183338
--------------------------------------------------------------------------------
/Editor/Interface/Colors/SkinnedColor.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1f304d676db94a8886c241a1adb49e38
3 | timeCreated: 1617185622
--------------------------------------------------------------------------------
/Editor/PathConvention/GenericResolver.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2f8a24e4155f4e6e86532beef2145b12
3 | timeCreated: 1616436716
--------------------------------------------------------------------------------
/Editor/PathConvention/ITemplateResolver.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c849845e49b24a5aa5d74f5279c93266
3 | timeCreated: 1616418611
--------------------------------------------------------------------------------
/Editor/PathConvention/ResolveException.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 9f1a5ed88cc14c1a8daba653d2781c90
3 | timeCreated: 1616436729
--------------------------------------------------------------------------------
/Editor/Processors/SetAtlasAllSettings.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 210cde82adde479b9d1f6b6f5757fe61
3 | timeCreated: 1743607449
--------------------------------------------------------------------------------
/Editor/Processors/SetTextureAllSettings.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1fe6242d75f94bfcb454b3d50cba1494
3 | timeCreated: 1736932535
--------------------------------------------------------------------------------
/Editor/Profiles/Import/ImportAssetType.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: bb15bb990b76430a92af99814407930a
3 | timeCreated: 1615036220
--------------------------------------------------------------------------------
/Editor/Utility/AssetDatabaseUtility.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 6a715c71c455410db68950f1e9713faa
3 | timeCreated: 1617182692
--------------------------------------------------------------------------------
/Editor/Utility/AssetProcessorUtility.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ca6057f7b13d4abc909c4d6e1ba36a7a
3 | timeCreated: 1615190037
--------------------------------------------------------------------------------
/Editor/Utility/AssetReferenceUtility.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b8fe5a618b604025a15ecd189da29ccc
3 | timeCreated: 1616586854
--------------------------------------------------------------------------------
/Editor/Utility/ImportAssetTypeUtility.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0b0e460162b24e8a85d2fcb2db1e5648
3 | timeCreated: 1615190022
--------------------------------------------------------------------------------
/Editor/Utility/ReorderableListUtility.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 83717b6978e147338041f03f6fa99673
3 | timeCreated: 1617183296
--------------------------------------------------------------------------------
/Editor/Utility/TargetPathTypeUtility.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7caf801f3a2c4f6b922cfd6265fb0c94
3 | timeCreated: 1615318501
--------------------------------------------------------------------------------
/Editor/Windows/ImportProfilesWindow.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 14c6fafd5e884fe7ae62eed2c96cd20d
3 | timeCreated: 1615041007
--------------------------------------------------------------------------------
/Editor/Assets/__importeraudiodummy__.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alex-Rachel/AssetPipeline/HEAD/Editor/Assets/__importeraudiodummy__.wav
--------------------------------------------------------------------------------
/Editor/Assets/__importerfontsdummy__.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alex-Rachel/AssetPipeline/HEAD/Editor/Assets/__importerfontsdummy__.ttf
--------------------------------------------------------------------------------
/Editor/Assets/__importervideosdummy__.m4v:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alex-Rachel/AssetPipeline/HEAD/Editor/Assets/__importervideosdummy__.m4v
--------------------------------------------------------------------------------
/Editor/Config/AssetPipelineSettingsProvider.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f919f9b96ee247a79d1e89e86bcb862d
3 | timeCreated: 1615489663
--------------------------------------------------------------------------------
/Editor/Dependencies/ReflectionMagic/LICENSE.txt.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b3d673404955490faca307606d7654c7
3 | timeCreated: 1617184685
--------------------------------------------------------------------------------
/Editor/Interface/EditorTexture/EditorTexture.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d3f6cc70b9ae482f9c52949fa19ae538
3 | timeCreated: 1617443624
--------------------------------------------------------------------------------
/Editor/PathConvention/NamingConventionRule.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 852dabe8d45540d3908d61fc2ab3aeb2
3 | timeCreated: 1616693690
--------------------------------------------------------------------------------
/Editor/Profiles/Import/AssetImportProfile.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4c962c1226e043caa066ec79a5193cc0
3 | timeCreated: 1615040537
--------------------------------------------------------------------------------
/Editor/Profiles/Import/ImportProfileUserData.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f866ff3e8a984a469dea8d7b0e984dd5
3 | timeCreated: 1617730786
--------------------------------------------------------------------------------
/Editor/Resources/Icons/IgnoreCaseOff.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alex-Rachel/AssetPipeline/HEAD/Editor/Resources/Icons/IgnoreCaseOff.png
--------------------------------------------------------------------------------
/Editor/Resources/Icons/IgnoreCaseOn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alex-Rachel/AssetPipeline/HEAD/Editor/Resources/Icons/IgnoreCaseOn.png
--------------------------------------------------------------------------------
/Editor/Utility/SerializedPropertyUtility.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 76b48fdf665b42cbb6a6844d1f3d3a11
3 | timeCreated: 1617183495
--------------------------------------------------------------------------------
/Editor/Assets/__importertexturesdummy__.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alex-Rachel/AssetPipeline/HEAD/Editor/Assets/__importertexturesdummy__.png
--------------------------------------------------------------------------------
/Editor/Dependencies/ReflectionMagic/DynamicField.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 68dbb5f54eb14253806da5a36a5af101
3 | timeCreated: 1614412669
--------------------------------------------------------------------------------
/Editor/Interface/EditorTexture/EditorTextures.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: acd92934309a434bb0a89cb5b3c69e4e
3 | timeCreated: 1617446936
--------------------------------------------------------------------------------
/Editor/Interface/TreeViews/ImportProfileTableItem.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a3e5feaf71ce4a46af10b5065915d852
3 | timeCreated: 1616084957
--------------------------------------------------------------------------------
/Editor/Interface/TreeViews/ImportProfileTableView.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c39b828c4b6c476aba87c4c08fb71522
3 | timeCreated: 1616084925
--------------------------------------------------------------------------------
/Editor/PathConvention/DuplicatePlaceholderMode.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a3bb49ffe7344db49fe261c68916ecfa
3 | timeCreated: 1616436722
--------------------------------------------------------------------------------
/Editor/Postprocessors/AssetImportPostprocessor.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4ec9464932754f08ba356c654d7422db
3 | timeCreated: 1615035188
--------------------------------------------------------------------------------
/Editor/Processors/Inspectors/ApplyPresetInspector.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ae819641f1424a9ab4c112f95924f754
3 | timeCreated: 1615190416
--------------------------------------------------------------------------------
/Editor/Resources/Icons/AssetBundleIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alex-Rachel/AssetPipeline/HEAD/Editor/Resources/Icons/AssetBundleIcon.png
--------------------------------------------------------------------------------
/Editor/Resources/Icons/IgnoreCaseOff@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alex-Rachel/AssetPipeline/HEAD/Editor/Resources/Icons/IgnoreCaseOff@2x.png
--------------------------------------------------------------------------------
/Editor/Resources/Icons/IgnoreCaseOn@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alex-Rachel/AssetPipeline/HEAD/Editor/Resources/Icons/IgnoreCaseOn@2x.png
--------------------------------------------------------------------------------
/Editor/Dependencies/ReflectionMagic/DynamicProperty.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d5faf10d9dcb4edebb2b42b18bd6cd20
3 | timeCreated: 1614412580
--------------------------------------------------------------------------------
/Editor/Dependencies/ReflectionMagic/IDynamicMember.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 9d7038a4fc7d4cb4a6b7b0c7d55e4915
3 | timeCreated: 1614412434
--------------------------------------------------------------------------------
/Editor/Processors/AssetProcessorDescriptionAttribute.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0f924e112f994097827661f9242f2499
3 | timeCreated: 1615189995
--------------------------------------------------------------------------------
/Editor/Processors/Inspectors/AddToSpriteAtlasInspector.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 43adedbd9a3d47b4916ae236d18023a2
3 | timeCreated: 1616234410
--------------------------------------------------------------------------------
/Editor/Processors/Inspectors/AssetProcessorInspector.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 46f9f96e46e2450a86d8e3838635278d
3 | timeCreated: 1616930534
--------------------------------------------------------------------------------
/Editor/Processors/Inspectors/CreatePrefabInspector.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: fb09168db41e4861abc1349cc8f1f7ea
3 | timeCreated: 1615191622
--------------------------------------------------------------------------------
/Editor/Processors/Inspectors/ExtractMaterialsInspector.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d45cd76307f34ebdbd8031af16bfd16e
3 | timeCreated: 1615318094
--------------------------------------------------------------------------------
/Editor/Processors/Inspectors/PackTexture2DInspector.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7df496528a6b49aea9233a89e26324af
3 | timeCreated: 1616245680
--------------------------------------------------------------------------------
/Editor/Processors/Inspectors/SetAssetBundleInspector.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: dc870b4bbd4d47ca988f5f991f53b92b
3 | timeCreated: 1615191812
--------------------------------------------------------------------------------
/Editor/Processors/Inspectors/SetAssetLabelsInspector.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 78c4de3bf5824fc483ffd759629382ca
3 | timeCreated: 1615191860
--------------------------------------------------------------------------------
/Editor/Processors/Inspectors/SetupMaterialsInspector.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: adb83e4c654b40a9b22a34cf19783ae7
3 | timeCreated: 1615402808
--------------------------------------------------------------------------------
/Editor/Processors/Inspectors/StripMeshDataInspector.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 9cdf7570570f4783af576b744d05382d
3 | timeCreated: 1616251725
--------------------------------------------------------------------------------
/Editor/Interface/Inspectors/AssetImportProfileInspector.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d33a69b0b3894097ba20fe4343c453cf
3 | timeCreated: 1615118474
--------------------------------------------------------------------------------
/Editor/Interface/PropertyDrawers/PathFilterPropertyDrawer.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 69636062684b4bbbba9c02f82a9a45cc
3 | timeCreated: 1615614054
--------------------------------------------------------------------------------
/Editor/Interface/PropertyDrawers/MaterialSetupPropertyDrawer.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c4426de23c4d42609023b980b1fe1922
3 | timeCreated: 1615630205
--------------------------------------------------------------------------------
/Editor/Interface/PropertyDrawers/StringTokenFilterPropertyDrawer.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 02d203835c04466ab488d285805823cd
3 | timeCreated: 1616007050
--------------------------------------------------------------------------------
/Editor/Interface/PropertyDrawers/NamingConventionRulePropertyDrawer.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a9b329a1c63b4cbfb9497d5aca1733a9
3 | timeCreated: 1616837940
--------------------------------------------------------------------------------
/Editor/Dependencies/ReflectionMagic/PrivateReflectionDynamicObjectBase.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2039252c10e9433bb79370a85f8c57bc
3 | timeCreated: 1614412751
--------------------------------------------------------------------------------
/Editor/Dependencies/ReflectionMagic/PrivateReflectionDynamicObjectInstance.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1b67f645197141d3b0b97f241795d86e
3 | timeCreated: 1614412855
--------------------------------------------------------------------------------
/Editor/Dependencies/ReflectionMagic/PrivateReflectionDynamicObjectStatic.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0d265b6ac6eb4cf79a0cd19522cc0048
3 | timeCreated: 1614412884
--------------------------------------------------------------------------------
/Editor/Dependencies/ReflectionMagic/PrivateReflectionUsingDynamicExtensions.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d4d754840c2f4483840378ce4e47cfce
3 | timeCreated: 1614412927
--------------------------------------------------------------------------------
/Editor/Utility/FileExistsAction.cs:
--------------------------------------------------------------------------------
1 | namespace AssetPipeline
2 | {
3 | public enum FileExistsAction
4 | {
5 | Skip,
6 | Overwrite,
7 | UniquePath
8 | }
9 | }
--------------------------------------------------------------------------------
/README.md.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 020a912985304e84b983ce87119ea177
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/README_EN.md.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 67b9f434d01373749a904891e0c02df8
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Editor.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f584a1ca13e1eeb41ab58acdc663b221
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Editor/PathConvention/DuplicatePlaceholderMode.cs:
--------------------------------------------------------------------------------
1 | namespace AssetPipeline.NamingConvention
2 | {
3 | public enum DuplicatePlaceholderMode
4 | {
5 | Relaxed = 0,
6 | Strict = 1
7 | }
8 | }
--------------------------------------------------------------------------------
/Settings.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ce4ca4e838b15914881031d7d3851e68
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Editor/Assets.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e26ef95de44842241b67f5283a4b3cac
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Editor/Config.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 9883881e3ea9b1f44be841f2a8683b3f
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Editor/Utility.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0c837062ef269974d961528dc25619f0
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Editor/Windows.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c2522b913f900244ba8ca084359d4686
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Editor/Dependencies.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 78e8d3bb4c3ff2d4e8fbc491c4d23b44
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Editor/Interface.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 503d0a05d15bc4b409cb716609e8888f
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Editor/Processors.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0fc4e8e3078e1c243987264546b28fef
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Editor/Profiles.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 9ce2e5d34c137764aaef36a7003cfb39
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Editor/Resources.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 943052ade1106184cb4c54f5ca4b7296
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Editor/AssetPipeline.Editor.asmdef.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 78deed8cd4a24224ba974ce4dd031303
3 | AssemblyDefinitionImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Editor/PathConvention.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 40c2ad6919913a2449f58d25ec9d888d
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Editor/Postprocessors.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f104796c275a18f449058c6954d7f61c
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Editor/Profiles/Import.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: cf9cfc134db5eea4591da79f9a8fd5d7
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Editor/Resources/Icons.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 13d514edbe5e29943aeeeaf88e23fb5c
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Editor/PathConvention/ITemplateResolver.cs:
--------------------------------------------------------------------------------
1 | namespace AssetPipeline.NamingConvention
2 | {
3 | public interface ITemplateResolver
4 | {
5 | Template Get(string templateName, Template defaultValue = null);
6 | }
7 | }
--------------------------------------------------------------------------------
/Editor/Dependencies/ReflectionMagic.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 5e5f3940eb4d9a94999b47c4136f00db
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Settings/Atlas.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 62450739c39c48641afbfb386925dd93
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 11400000
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Settings/UIRaw.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e7023ed9609818e4fb819f52d9d9fcb6
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 11400000
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Settings/UI2Atlas.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 06b2505c9ed5700428904d6cb25c072f
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 11400000
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Settings/AssetPipelineSettings.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d0d1d0d675ba21145a0eccd4706f9b2b
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 11400000
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Editor/Assets/GUIIcon.shader.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2fea759951566524c9db7aa2a7d3c7b1
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Editor/PathConvention/Anchor.cs:
--------------------------------------------------------------------------------
1 | namespace AssetPipeline.NamingConvention
2 | {
3 | public enum Anchor
4 | {
5 | Contains = 0,
6 | Start = 1,
7 | End = 2,
8 | Exact = 3,
9 | AllPaths = 4,
10 | Regex= 5,
11 | }
12 | }
--------------------------------------------------------------------------------
/Editor/Processors/TargetPathType.cs:
--------------------------------------------------------------------------------
1 | namespace AssetPipeline.Processors
2 | {
3 | public enum TargetPathType
4 | {
5 | SameAsAsset = 0,
6 | ParentFolder = 1,
7 | Relative = 2,
8 | Absolute = 3,
9 | TargetFolder = 4
10 | }
11 | }
--------------------------------------------------------------------------------
/Editor/Assets/__importerspriteatlasesdummy__.spriteatlas.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1c65521958b39b64fb6a45166bbef886
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 4343727234628468602
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Editor/Processors/MaterialPathType.cs:
--------------------------------------------------------------------------------
1 | namespace AssetPipeline.Processors
2 | {
3 | internal enum MaterialPathType
4 | {
5 | SameAsAsset = 0,
6 | MaterialFolderWithAsset = 1,
7 | Relative = 2,
8 | Absolute = 3,
9 | TargetFolder = 4
10 | }
11 | }
--------------------------------------------------------------------------------
/Editor/Filters/PathFilter.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d509822c272619f41a58e0474dbcce83
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Editor/Interface/DaiGUIContent.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ae9cc3ba878bbc143b75161358fce0ea
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Editor/Utility/FileExistsAction.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3e938bf92d2371042bb19aebcc47aba9
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Editor/Utility/StringConvention.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 806dac78bed05324887834c4ee9da2df
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Editor/Filters/StringTokenFilter.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 691b0457121abd44889a38bffa687d7a
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Editor/Processors/AnimCompression.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b1795ae128aa7cd4dbaa3c5428ab07c2
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Editor/Processors/MaterialPathType.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 5db835fa9e5aa124c8ac63f39fce1924
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Editor/Processors/ResetTransform.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d5f6f178b99bb0f4095e2bb6ee7f0ecb
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Editor/Processors/SetTextureFormat.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 707336b546597574a98d78d0e02c7b14
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Editor/Processors/SetTextureMipmaps.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c610b5c40b622d448a1aecd79243a513
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Editor/Processors/TargetPathType.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 57bf8661e38b4e6418749202b9ba2895
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Editor/Reflection/UnityEditorDynamic.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4f18575055ba5824486633bdc0a50d6e
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Editor/Utility/AssetImportPipeline.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 194c41233c576df4b9330fb4e5663645
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Editor/Interface/TreeViews/AssetTableItem.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e19647b9bd61f8543b07a3c067d37484
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Editor/Postprocessors/TexturePostprocess.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b3a03a52035dd694a98cf194dad859f2
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Editor/Utility/AssetModificationMonitor.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f5d96dca40d210f48a6fc7c95e0ed639
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Editor/Interface/TreeViews/AAssetTableView.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 32585b95a2162944697d98195fd33888
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Editor/Windows/ImportProfileAssetsViewerWindow.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: db8ae286ebf57434e9c200a5b356ff09
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Editor/Interface/Inspectors/AssetFilterInspector.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 70c2260d984d4c945a04baca6c7d91b6
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Editor/Interface/TreeViews/AssetSearchTableItem.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: fec106a2c13ea934aa898814ce825438
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Editor/Interface/TreeViews/AssetSearchTableView.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a962def1a3b55f845b4840ce1aca075a
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Editor/Interface/TreeViews/ImportProfileAssetTableItem.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7b318fd23cdc65046a6516bb060737f2
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Editor/Interface/TreeViews/ImportProfileAssetTableView.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d2e6e5e969d67914b96494599e1854cd
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Editor/Processors/Inspectors/ResetTransformInspector.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 8bc8698bded6b26429d862e2392c5e8a
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Editor/Processors/Inspectors/SetTextureFormatInspector.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c54c51a2c19280f4eb20bf7c010ffc71
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Editor/Processors/Inspectors/SetTextureMipmapsInspector.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4cf0f85ddfaf8b043bcec9738e859e34
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Editor/Assets/__importermodelsdummy__.obj:
--------------------------------------------------------------------------------
1 | # Blender v2.79 (sub 0) OBJ File: ''
2 | # www.blender.org
3 | mtllib __importerdummy__.mtl
4 | o Plane
5 | v -1.002917 -0.012019 1.021426
6 | v 0.997083 -0.012019 1.021426
7 | v -1.002917 -0.012019 -0.978574
8 | v 0.997083 -0.012019 -0.978574
9 | vn 0.0000 1.0000 0.0000
10 | usemtl None
11 | s off
12 | f 1//1 2//1 4//1 3//1
13 |
--------------------------------------------------------------------------------
/Editor/Assets/__importervideosdummy__.m4v.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e55dc86e52ae26747a26b33bb077a601
3 | VideoClipImporter:
4 | externalObjects: {}
5 | serializedVersion: 3
6 | frameRange: 0
7 | startFrame: -1
8 | endFrame: -1
9 | colorSpace: 0
10 | deinterlace: 0
11 | encodeAlpha: 0
12 | flipVertical: 0
13 | flipHorizontal: 0
14 | importAudio: 1
15 | targetSettings: {}
16 | userData:
17 | assetBundleName:
18 | assetBundleVariant:
19 |
--------------------------------------------------------------------------------
/Editor/AssetPipeline.Editor.asmdef:
--------------------------------------------------------------------------------
1 | {
2 | "name": "AssetPipeline.Editor",
3 | "rootNamespace": "",
4 | "references": [
5 | "GUID:343deaaf83e0cee4ca978e7df0b80d21",
6 | "GUID:2bafac87e7f4b9b418d9448d219b01ab"
7 | ],
8 | "includePlatforms": [
9 | "Editor"
10 | ],
11 | "excludePlatforms": [],
12 | "allowUnsafeCode": true,
13 | "overrideReferences": false,
14 | "precompiledReferences": [],
15 | "autoReferenced": true,
16 | "defineConstraints": [],
17 | "versionDefines": [],
18 | "noEngineReferences": false
19 | }
--------------------------------------------------------------------------------
/Editor/Assets/__importeraudiodummy__.wav.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3bc3da92ea2ad0c4ba85b4251ce81817
3 | timeCreated: 1494625790
4 | licenseType: Pro
5 | AudioImporter:
6 | serializedVersion: 6
7 | defaultSettings:
8 | loadType: 0
9 | sampleRateSetting: 0
10 | sampleRateOverride: 44100
11 | compressionFormat: 1
12 | quality: 1
13 | conversionMode: 0
14 | platformSettingOverrides: {}
15 | forceToMono: 0
16 | normalize: 1
17 | preloadAudioData: 1
18 | loadInBackground: 0
19 | 3D: 1
20 | userData:
21 | assetBundleName:
22 | assetBundleVariant:
23 |
--------------------------------------------------------------------------------
/Editor/Assets/__importerfontsdummy__.ttf.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 8190485d3da66ce4783cee6ff099dfa4
3 | timeCreated: 1509347474
4 | licenseType: Pro
5 | TrueTypeFontImporter:
6 | externalObjects: {}
7 | serializedVersion: 4
8 | fontSize: 16
9 | forceTextureCase: -2
10 | characterSpacing: 0
11 | characterPadding: 1
12 | includeFontData: 1
13 | fontName: LCDMono2
14 | fontNames:
15 | -
16 | fallbackFontReferences: []
17 | customCharacters:
18 | fontRenderingMode: 0
19 | ascentCalculationMode: 1
20 | userData:
21 | assetBundleName:
22 | assetBundleVariant:
23 |
--------------------------------------------------------------------------------
/Editor/Reflection/UnityEditorDynamic.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 | using UnityEditor;
4 | using AssetPipeline.ReflectionMagic;
5 |
6 | namespace AssetPipeline
7 | {
8 | internal static class UnityEditorDynamic
9 | {
10 | public static readonly Assembly UnityEditorAssembly;
11 | public static readonly dynamic EditorGUIUtility;
12 |
13 | static UnityEditorDynamic()
14 | {
15 | UnityEditorAssembly = typeof(Editor).Assembly;
16 | EditorGUIUtility = typeof(EditorGUIUtility).AsDynamicType();
17 | }
18 | }
19 |
20 | }
--------------------------------------------------------------------------------
/Editor/PathConvention/ResolveException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace AssetPipeline.NamingConvention
4 | {
5 | public class ResolveException : Exception
6 | {
7 | public ResolveException(string message) : base(message)
8 | {
9 | }
10 | }
11 |
12 | public class ValueException : Exception
13 | {
14 | public ValueException(string message) : base(message)
15 | {
16 | }
17 | }
18 |
19 | public class ParseException : Exception
20 | {
21 | public ParseException(string message) : base(message)
22 | {
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/Editor/Interface/TreeViews/ImportProfileTableItem.cs:
--------------------------------------------------------------------------------
1 | using AssetPipeline.Import;
2 | using UnityEditor;
3 | using UnityEditor.IMGUI.Controls;
4 |
5 | namespace AssetPipeline
6 | {
7 | internal class ImportProfileTableItem : TreeViewItem
8 | {
9 | public readonly AssetImportProfile Profile;
10 | public readonly SerializedObject SerializedObject;
11 |
12 | public ImportProfileTableItem(int id, int depth, AssetImportProfile profile)
13 | : base(id, depth, profile.name)
14 | {
15 | Profile = profile;
16 | SerializedObject = new SerializedObject(Profile);
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/Editor/Utility/TextureUtility.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 |
3 | namespace AssetPipeline
4 | {
5 | internal static class TextureUtility
6 | {
7 | public static Texture2D LoadImage(int width, int height, byte[] bytes)
8 | {
9 | try
10 | {
11 | var t = new Texture2D(width, height, TextureFormat.ARGB32, false, true);
12 | t.LoadImage(bytes);
13 | return t;
14 | }
15 | catch
16 | {
17 | var t = new Texture2D(1, 1);
18 | t.SetPixel(0, 0, Color.magenta);
19 | t.Apply();
20 | return t;
21 | }
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/Editor/Utility/StringConvention.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace AssetPipeline
4 | {
5 | public enum StringConvention
6 | {
7 | None = 0,
8 | CamelCase = 1 << 0,
9 | PascalCase = 1 << 1,
10 | SnakeCase = 1 << 2,
11 | UpperSnakeCase = 1 << 3,
12 | KebabCase = 1 << 4,
13 | LowerCase = 1 << 5,
14 | UpperCase = 1 << 6,
15 | }
16 |
17 | [Flags]
18 | public enum StringConventionFlags
19 | {
20 | None = 0,
21 | CamelCase = 1 << 0,
22 | PascalCase = 1 << 1,
23 | SnakeCase = 1 << 2,
24 | UpperSnakeCase = 1 << 3,
25 | KebabCase = 1 << 4,
26 | LowerCase = 1 << 5,
27 | UpperCase = 1 << 6,
28 | }
29 | }
--------------------------------------------------------------------------------
/Editor/Utility/PathUtility.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 |
3 | namespace AssetPipeline
4 | {
5 | internal static class PathUtility
6 | {
7 | public static void CreateParentDirectoryIfNeeded(string path)
8 | {
9 | CreateDirectoryIfNeeded(Directory.GetParent(path).FullName);
10 | }
11 |
12 | public static void CreateDirectoryIfNeeded(string path)
13 | {
14 | if (!Directory.Exists(path))
15 | {
16 | Directory.CreateDirectory(path);
17 | }
18 | }
19 |
20 | public static string FixPathSeparators(this string path)
21 | {
22 | return path.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/Editor/Utility/RectUtility.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 |
3 | namespace AssetPipeline
4 | {
5 | internal static class RectUtility
6 | {
7 | public static Rect Pad(this Rect rect, float left, float right, float top, float bottom)
8 | {
9 | rect.xMin += left;
10 | rect.xMax -= right;
11 | rect.yMin += top;
12 | rect.yMax -= bottom;
13 | return rect;
14 | }
15 |
16 | public static Rect Pad(this Rect rect, float horizontal, float vertical)
17 | {
18 | return Pad(rect, horizontal, horizontal, vertical, vertical);
19 | }
20 |
21 | public static Rect Pad(this Rect rect, float padding)
22 | {
23 | return Pad(rect, padding, padding, padding, padding);
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/Editor/Processors/SetAssetLabels.cs:
--------------------------------------------------------------------------------
1 | using System.Linq;
2 | using AssetPipeline.Import;
3 | using UnityEditor;
4 | using UnityEngine;
5 |
6 | namespace AssetPipeline.Processors
7 | {
8 | [AssetProcessorDescription("FilterByLabel@2x")]
9 | public class SetAssetLabels : AssetProcessor
10 | {
11 | [SerializeField] string[] labels;
12 |
13 | public override void OnPostprocess(Object asset, string assetPath)
14 | {
15 | var assetLabels = AssetDatabase.GetLabels(asset).ToHashSet();
16 | assetLabels.AddRange(labels);
17 | AssetDatabase.SetLabels(asset, assetLabels.ToArray());
18 | ImportProfileUserData.AddOrUpdateProcessor(assetPath, this);
19 | Debug.Log($"[{GetName()}] Labels \"{string.Join("\", \"", labels)}\" set for {assetPath}");
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/Editor/Utility/ReorderableListUtility.cs:
--------------------------------------------------------------------------------
1 | using UnityEditor;
2 |
3 | namespace AssetPipeline
4 | {
5 | internal static class ReorderableListUtility
6 | {
7 | public static bool HasSelection(this UnityEditorInternal.ReorderableList list)
8 | {
9 | return list.index > -1 && ((list.serializedProperty != null && list.serializedProperty.arraySize > list.index) || (list.list != null && list.list.Count > list.index));
10 | }
11 |
12 | public static SerializedProperty GetArrayElement(this UnityEditorInternal.ReorderableList list, int index)
13 | {
14 | if (list.serializedProperty != null && list.serializedProperty.arraySize > index)
15 | {
16 | return list.serializedProperty.GetArrayElementAtIndex(index);
17 | }
18 |
19 | return null;
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/Editor/Config/AssetTypeFileExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using AssetPipeline.Import;
4 | using UnityEngine;
5 |
6 | namespace AssetPipeline
7 | {
8 | [Serializable]
9 | public class AssetTypeFileExtensions
10 | {
11 | [SerializeField] ImportAssetType m_AssetType;
12 | [SerializeField] List m_FileExtensions = new List();
13 |
14 | public AssetTypeFileExtensions(ImportAssetType assetType, params string[] fileExtensions)
15 | {
16 | m_AssetType = assetType;
17 | m_FileExtensions.AddRange(fileExtensions);
18 | }
19 |
20 | public ImportAssetType AssetType
21 | {
22 | get => m_AssetType;
23 | set => m_AssetType = value;
24 | }
25 |
26 | public List FileExtensions => m_FileExtensions;
27 | }
28 | }
--------------------------------------------------------------------------------
/Editor/PathConvention/GenericResolver.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace AssetPipeline.NamingConvention
4 | {
5 | public class GenericResolver : ITemplateResolver
6 | {
7 | public List templates = new List();
8 |
9 | public GenericResolver()
10 | {
11 | }
12 |
13 | public GenericResolver(List templates)
14 | {
15 | this.templates.AddRange(templates);
16 | }
17 |
18 | public Template Get(string templateName, Template defaultValue = null)
19 | {
20 | foreach (var template in templates)
21 | {
22 | if (template.Name == templateName)
23 | {
24 | return template;
25 | }
26 | }
27 |
28 | return defaultValue;
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/Editor/Processors/Inspectors/SetTextureMipmapsInspector.cs:
--------------------------------------------------------------------------------
1 | using AssetPipeline.Import;
2 | using UnityEditor;
3 |
4 | namespace AssetPipeline.Processors
5 | {
6 | [CustomEditor(typeof(SetTextureMipmaps))]
7 | internal class SetTextureMipmapsInspector : AssetProcessorInspector
8 | {
9 | SerializedProperty m_EnableMipmaps;
10 |
11 | protected override void OnEnable()
12 | {
13 | base.OnEnable();
14 | m_EnableMipmaps = serializedObject.FindProperty(nameof(SetTextureMipmaps.enableMipmaps));
15 | }
16 |
17 | public override void OnInspectorGUI()
18 | {
19 | serializedObject.Update();
20 | DrawBaseProperties();
21 | EditorGUILayout.PropertyField(m_EnableMipmaps);
22 | serializedObject.ApplyModifiedProperties();
23 |
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/Editor/Profiles/Import/ImportAssetType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace AssetPipeline.Import
4 | {
5 | public enum ImportAssetType
6 | {
7 | Textures = 0,
8 | Models = 1,
9 | Audio = 2,
10 | Videos = 3,
11 | Fonts = 4,
12 | Animations = 5,
13 | Materials = 6,
14 | Prefabs = 7,
15 | SpriteAtlases = 8,
16 | Other = 9
17 | }
18 |
19 | [Flags]
20 | public enum ImportAssetTypeFlag
21 | {
22 | Textures = 1 << 0,
23 | Models = 1 << 1,
24 | Audio = 1 << 2,
25 | Videos = 1 << 3,
26 | Fonts = 1 << 4,
27 | Animations = 1 << 5,
28 | Materials = 1 << 6,
29 | Prefabs = 1 << 7,
30 | SpriteAtlases = 1 << 8,
31 | Other = 1 << 9,
32 | All = Textures | Models | Audio | Animations | Materials | Prefabs | SpriteAtlases | Fonts | Videos | Other
33 | }
34 | }
--------------------------------------------------------------------------------
/Editor/Utility/ObjectUtility.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 |
3 | namespace AssetPipeline
4 | {
5 | internal static class ObjectUtility
6 | {
7 | public static void SafeDestroy(this Object obj)
8 | {
9 | if (Application.isPlaying)
10 | {
11 | Object.Destroy(obj);
12 | }
13 | else
14 | {
15 | Object.DestroyImmediate(obj);
16 | }
17 | }
18 |
19 | public static void SetLayer(this GameObject parent, int layer, bool recursive = true)
20 | {
21 | parent.layer = layer;
22 | if (!recursive)
23 | {
24 | return;
25 | }
26 |
27 | foreach (var transform in parent.transform.GetComponentsInChildren(true))
28 | {
29 | transform.gameObject.layer = layer;
30 | }
31 | }
32 | }
33 | }
--------------------------------------------------------------------------------
/Editor/Interface/TreeViews/AssetTableItem.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using UnityEditor;
3 | using UnityEditor.IMGUI.Controls;
4 | using UnityEngine;
5 |
6 | namespace AssetPipeline
7 | {
8 | public class AssetTableItem : TreeViewItem
9 | {
10 | public string assetPath;
11 | public Type assetType;
12 | public bool isAsset;
13 |
14 | public AssetTableItem(int id, int depth, string displayName, string assetPath, bool isAsset) : base(id, depth, displayName)
15 | {
16 | this.assetPath = assetPath;
17 | this.isAsset = isAsset;
18 | icon = AssetDatabase.GetCachedIcon(assetPath) as Texture2D ?? Color.clear.GetPixel();
19 | assetType = AssetDatabase.GetMainAssetTypeAtPath(assetPath);
20 | }
21 |
22 | public virtual void Refresh()
23 | {
24 | icon = AssetDatabase.GetCachedIcon(assetPath) as Texture2D ?? Color.clear.GetPixel();
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/Editor/Utility/LinqUtility.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 |
5 | namespace AssetPipeline
6 | {
7 | internal static class LinqUtility
8 | {
9 | public static HashSet ToHashSet(this IEnumerable enumerable)
10 | {
11 | return new HashSet(enumerable);
12 | }
13 |
14 | public static void AddRange(this HashSet hashSet, IEnumerable items)
15 | {
16 | foreach (var item in items)
17 | {
18 | hashSet.Add(item);
19 | }
20 | }
21 |
22 | public static IOrderedEnumerable Order(this IEnumerable source, Func selector, bool ascending)
23 | {
24 | return ascending ? source.OrderBy(selector) : source.OrderByDescending(selector);
25 | }
26 |
27 | public static IOrderedEnumerable ThenBy(this IOrderedEnumerable source, Func selector, bool ascending)
28 | {
29 | return ascending ? source.ThenBy(selector) : source.ThenByDescending(selector);
30 | }
31 | }
32 | }
--------------------------------------------------------------------------------
/Editor/Processors/ResetTransform.cs:
--------------------------------------------------------------------------------
1 | using AssetPipeline.Import;
2 | using UnityEditor;
3 | using UnityEngine;
4 |
5 | namespace AssetPipeline.Processors
6 | {
7 | [AssetProcessorDescription("Transform Icon", ImportAssetTypeFlag.Models)]
8 | public class ResetTransform : AssetProcessor
9 | {
10 | public override int Priority => 1;
11 |
12 | [SerializeField] bool position;
13 | [SerializeField] bool rotation;
14 | [SerializeField] bool scale;
15 |
16 | public override void OnPostprocessModel (string assetPath, ModelImporter importer, GameObject root)
17 | {
18 | if (position) {
19 | root.transform.position = Vector3.zero;
20 | }
21 |
22 | if (rotation) {
23 | root.transform.rotation = Quaternion.identity;
24 | }
25 |
26 | if (scale) {
27 | root.transform.localScale = Vector3.one;
28 | }
29 | ImportProfileUserData.AddOrUpdateProcessor(assetPath, this);
30 | Debug.Log($"[{GetName()}] Reset Transform for \"{assetPath}\"");
31 | }
32 | }
33 | }
--------------------------------------------------------------------------------
/Editor/Processors/Inspectors/SetAssetBundleInspector.cs:
--------------------------------------------------------------------------------
1 | /*using AssetPipeline.Import;
2 | using UnityEditor;
3 |
4 | namespace AssetPipeline.Processors
5 | {
6 | [CustomEditor(typeof(SetAssetBundle))]
7 | internal class SetAssetBundleInspector : AssetProcessorInspector
8 | {
9 | SerializedProperty m_AssetBundleName;
10 | SerializedProperty m_AssetBundleVariant;
11 |
12 | protected override void OnEnable()
13 | {
14 | m_AssetBundleName = serializedObject.FindProperty("assetBundleName");
15 | m_AssetBundleVariant = serializedObject.FindProperty("assetBundleVariant");
16 | base.OnEnable();
17 | }
18 |
19 | public override void OnInspectorGUI()
20 | {
21 | serializedObject.Update();
22 | DrawBaseProperties();
23 | EditorGUILayout.LabelField("Asset Bundle", DaiGUIStyles.boldLabel);
24 | EditorGUILayout.PropertyField(m_AssetBundleName);
25 | DrawTemplateVariables();
26 | EditorGUILayout.Space();
27 | EditorGUILayout.PropertyField(m_AssetBundleVariant);
28 | serializedObject.ApplyModifiedProperties();
29 | }
30 | }
31 | }*/
--------------------------------------------------------------------------------
/Editor/Utility/AssetModificationMonitor.cs:
--------------------------------------------------------------------------------
1 | using AssetPipeline.Import;
2 | using UnityEditor;
3 |
4 | namespace AssetPipeline
5 | {
6 | internal class AssetModificationMonitor : UnityEditor.AssetModificationProcessor
7 | {
8 | static string[] OnWillSaveAssets(string[] paths)
9 | {
10 | foreach (var path in paths)
11 | {
12 | if (AssetDatabase.GetMainAssetTypeAtPath(path) == typeof(AssetProcessor))
13 | {
14 | AssetImportProfile.InvalidateCachedProfiles();
15 | break;
16 | }
17 | }
18 |
19 | return paths;
20 | }
21 |
22 | static AssetDeleteResult OnWillDeleteAsset(string assetPath, RemoveAssetOptions options)
23 | {
24 | var asset = AssetDatabase.LoadMainAssetAtPath(assetPath);
25 | if (asset is AssetImportProfile)
26 | {
27 | ImportProfilesWindow.ReloadTreeViewAfterFileDeletion(assetPath);
28 | }
29 | else if (asset is AssetProcessor)
30 | {
31 | AssetImportProfile.InvalidateCachedProfiles();
32 | }
33 |
34 | return AssetDeleteResult.DidNotDelete;
35 | }
36 | }
37 | }
--------------------------------------------------------------------------------
/Editor/Processors/Inspectors/ResetTransformInspector.cs:
--------------------------------------------------------------------------------
1 | using AssetPipeline.Import;
2 | using UnityEditor;
3 |
4 | namespace AssetPipeline.Processors
5 | {
6 | [CustomEditor(typeof(ResetTransform))]
7 | internal class ResetTransformInspector : AssetProcessorInspector
8 | {
9 | SerializedProperty m_Position;
10 | SerializedProperty m_Rotation;
11 | SerializedProperty m_Scale;
12 |
13 | protected override void OnEnable()
14 | {
15 | m_Position = serializedObject.FindProperty("position");
16 | m_Rotation = serializedObject.FindProperty("rotation");
17 | m_Scale = serializedObject.FindProperty("scale");
18 | base.OnEnable();
19 | }
20 |
21 | public override void OnInspectorGUI()
22 | {
23 | serializedObject.Update();
24 | DrawBaseProperties();
25 | m_Position.boolValue = EditorGUILayout.ToggleLeft(m_Position.displayName, m_Position.boolValue);
26 | m_Rotation.boolValue = EditorGUILayout.ToggleLeft(m_Rotation.displayName, m_Rotation.boolValue);
27 | m_Scale.boolValue = EditorGUILayout.ToggleLeft(m_Scale.displayName, m_Scale.boolValue);
28 |
29 | serializedObject.ApplyModifiedProperties();
30 | }
31 | }
32 | }
--------------------------------------------------------------------------------
/Editor/Processors/SetAssetBundle.cs:
--------------------------------------------------------------------------------
1 | /*using AssetPipeline.Import;
2 | using UnityEditor;
3 | using UnityEngine;
4 |
5 | namespace AssetPipeline.Processors
6 | {
7 | [AssetProcessorDescription("Assets/AssetPipline/Editor/Resources/Icons/AssetBundleIcon.png")]
8 | public class SetAssetBundle : AssetProcessor
9 | {
10 | [SerializeField] string assetBundleName;
11 | [SerializeField] string assetBundleVariant;
12 |
13 | public override void OnPreprocessAsset(string assetPath, AssetImporter importer)
14 | {
15 | var bundleNameSet = !string.IsNullOrWhiteSpace(importer.assetBundleName);
16 | var bundleVariantSet = !string.IsNullOrWhiteSpace(importer.assetBundleVariant) || string.IsNullOrWhiteSpace(assetBundleVariant);
17 | if (bundleNameSet && bundleVariantSet && !ShouldImport(importer))
18 | {
19 | return;
20 | }
21 |
22 | var bundleName = ReplaceVariables(assetBundleName, assetPath);
23 | importer.SetAssetBundleNameAndVariant(bundleName, assetBundleVariant);
24 | ImportProfileUserData.AddOrUpdateProcessor(assetPath, this);
25 | Debug.Log($"[{GetName()}] AssetBundle name: \"{bundleName}\" variant: \"{assetBundleVariant}\" set for {assetPath}");
26 | }
27 | }
28 | }*/
--------------------------------------------------------------------------------
/Settings/Atlas.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!114 &-2390203388639209130
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: 2833c50f97654ad2b8034ab06a4dee5a, type: 3}
13 | m_Name: Filter_SpriteAtlases
14 | m_EditorClassIdentifier:
15 | enabled: 1
16 | showOptions: 1
17 | file:
18 | name: assetFilter
19 | pattern:
20 | anchor: 4
21 | assetType: 8
22 | otherAssetExtensions: []
23 | subPaths: []
24 | fileExclusions: []
25 | assetProcessors: []
26 | parent: {fileID: 11400000}
27 | --- !u!114 &11400000
28 | MonoBehaviour:
29 | m_ObjectHideFlags: 0
30 | m_CorrespondingSourceObject: {fileID: 0}
31 | m_PrefabInstance: {fileID: 0}
32 | m_PrefabAsset: {fileID: 0}
33 | m_GameObject: {fileID: 0}
34 | m_Enabled: 1
35 | m_EditorHideFlags: 0
36 | m_Script: {fileID: 11500000, guid: 4c962c1226e043caa066ec79a5193cc0, type: 3}
37 | m_Name: Atlas
38 | m_EditorClassIdentifier:
39 | enabled: 1
40 | path:
41 | name: atlas
42 | pattern: Assets/AssetArt/Atlas
43 | anchor: 1
44 | pathExclusions: []
45 | assetFilters:
46 | - {fileID: -2390203388639209130}
47 |
--------------------------------------------------------------------------------
/Editor/Dependencies/ReflectionMagic/DynamicField.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 |
4 | namespace AssetPipeline.ReflectionMagic
5 | {
6 | ///
7 | /// Provides a mechanism to access fields through the abstraction.
8 | ///
9 | internal class DynamicField : IDynamicMember
10 | {
11 | readonly FieldInfo m_FieldInfo;
12 |
13 | ///
14 | /// Initializes a new instance of the class wrapping the specified field.
15 | ///
16 | /// The field info to wrap.
17 | /// Thrown when is null.
18 | internal DynamicField(FieldInfo field)
19 | {
20 | m_FieldInfo = field ?? throw new ArgumentNullException(nameof(field));
21 | }
22 |
23 | public Type PropertyType => m_FieldInfo.FieldType;
24 |
25 | string IDynamicMember.Name => m_FieldInfo.Name;
26 |
27 | object IDynamicMember.GetValue(object obj, object[] index)
28 | {
29 | return m_FieldInfo.GetValue(obj);
30 | }
31 |
32 | void IDynamicMember.SetValue(object obj, object value, object[] index)
33 | {
34 | m_FieldInfo.SetValue(obj, value);
35 | }
36 | }
37 | }
--------------------------------------------------------------------------------
/Editor/Processors/Inspectors/SetAssetLabelsInspector.cs:
--------------------------------------------------------------------------------
1 | using AssetPipeline.Import;
2 | using UnityEditor;
3 | using UnityEditorInternal;
4 | using UnityEngine;
5 |
6 | namespace AssetPipeline.Processors
7 | {
8 | [CustomEditor(typeof(SetAssetLabels))]
9 | internal class SetAssetLabelsInspector : AssetProcessorInspector
10 | {
11 | ReorderableList m_List;
12 |
13 | protected override void OnEnable()
14 | {
15 | m_List = new ReorderableList(serializedObject, serializedObject.FindProperty("labels"), true, true, true, true);
16 | m_List.drawHeaderCallback = rect => EditorGUI.LabelField(rect, "Asset Labels");
17 | m_List.drawElementCallback = (rect, index, active, focused) =>
18 | {
19 | var element = m_List.serializedProperty.GetArrayElementAtIndex(index);
20 | rect.y += 2;
21 | rect.height = EditorGUIUtility.singleLineHeight;
22 | EditorGUI.PropertyField(rect, element, GUIContent.none);
23 | };
24 | base.OnEnable();
25 | }
26 |
27 | public override void OnInspectorGUI()
28 | {
29 | serializedObject.Update();
30 | DrawBaseProperties();
31 | GUI.enabled = true;
32 | m_List.DoLayoutList();
33 | serializedObject.ApplyModifiedProperties();
34 | }
35 | }
36 | }
--------------------------------------------------------------------------------
/Editor/Dependencies/ReflectionMagic/DynamicProperty.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 |
4 | namespace AssetPipeline.ReflectionMagic
5 | {
6 | ///
7 | /// Provides an mechanism to access properties through the abstraction.
8 | ///
9 | internal class DynamicProperty : IDynamicMember
10 | {
11 | readonly PropertyInfo m_PropertyInfo;
12 |
13 | ///
14 | /// Initializes a new instance of the class wrapping the specified property.
15 | ///
16 | /// The property info to wrap.
17 | /// Thrown when is null.
18 | internal DynamicProperty(PropertyInfo property)
19 | {
20 | m_PropertyInfo = property ?? throw new ArgumentNullException(nameof(property));
21 | }
22 |
23 | public Type PropertyType => m_PropertyInfo.PropertyType;
24 |
25 | string IDynamicMember.Name => m_PropertyInfo.Name;
26 |
27 | object IDynamicMember.GetValue(object obj, object[] index)
28 | {
29 | return m_PropertyInfo.GetValue(obj, index);
30 | }
31 |
32 | void IDynamicMember.SetValue(object obj, object value, object[] index)
33 | {
34 | m_PropertyInfo.SetValue(obj, value, index);
35 | }
36 | }
37 | }
--------------------------------------------------------------------------------
/Editor/Interface/Inspectors/AssetFilterInspector.cs:
--------------------------------------------------------------------------------
1 | using AssetPipeline.Import;
2 | using UnityEditor;
3 | using UnityEngine;
4 |
5 | namespace AssetPipeline.Inspectors
6 | {
7 | [CustomEditor(typeof(AssetFilter))]
8 | internal class AssetFilterInspector : Editor
9 | {
10 | AssetFilter m_Target;
11 |
12 | void OnEnable()
13 | {
14 | m_Target = (AssetFilter) target;
15 | }
16 |
17 | public override void OnInspectorGUI()
18 | {
19 | GUILayout.BeginVertical();
20 | GUILayout.Space(50);
21 |
22 | GUILayout.BeginHorizontal();
23 | GUILayout.FlexibleSpace();
24 | GUILayout.Label("Import Profile", DaiGUIStyles.sectionHeader);
25 | GUILayout.FlexibleSpace();
26 | GUILayout.EndHorizontal();
27 |
28 | GUILayout.BeginHorizontal();
29 | GUILayout.FlexibleSpace();
30 | GUILayout.Label(m_Target.parent.name, DaiGUIStyles.sectionSubHeader);
31 | GUILayout.FlexibleSpace();
32 | GUILayout.EndHorizontal();
33 |
34 | GUILayout.Space(24);
35 | GUILayout.BeginHorizontal();
36 | GUILayout.FlexibleSpace();
37 |
38 | if (GUILayout.Button("Open Import Profile Editor", DaiGUIStyles.buttonLarge))
39 | {
40 | ImportProfileWindow.ShowWindow(m_Target.parent);
41 | }
42 |
43 | GUILayout.FlexibleSpace();
44 | GUILayout.EndHorizontal();
45 | GUILayout.EndVertical();
46 | }
47 | }
48 | }
--------------------------------------------------------------------------------
/Editor/Interface/Inspectors/AssetImportProfileInspector.cs:
--------------------------------------------------------------------------------
1 | using AssetPipeline.Import;
2 | using UnityEditor;
3 | using UnityEngine;
4 |
5 | namespace AssetPipeline.Inspectors
6 | {
7 | [CustomEditor(typeof(AssetImportProfile))]
8 | internal class AssetImportProfileInspector : Editor
9 | {
10 | AssetImportProfile m_Target;
11 |
12 | void OnEnable()
13 | {
14 | m_Target = (AssetImportProfile) target;
15 | }
16 |
17 | public override void OnInspectorGUI()
18 | {
19 | GUILayout.BeginVertical();
20 | GUILayout.Space(50);
21 |
22 | GUILayout.BeginHorizontal();
23 | GUILayout.FlexibleSpace();
24 | GUILayout.Label("Import Profile", DaiGUIStyles.sectionHeader);
25 | GUILayout.FlexibleSpace();
26 | GUILayout.EndHorizontal();
27 |
28 | GUILayout.BeginHorizontal();
29 | GUILayout.FlexibleSpace();
30 | GUILayout.Label(m_Target.name, DaiGUIStyles.sectionSubHeader);
31 | GUILayout.FlexibleSpace();
32 | GUILayout.EndHorizontal();
33 |
34 | GUILayout.Space(24);
35 | GUILayout.BeginHorizontal();
36 | GUILayout.FlexibleSpace();
37 |
38 | if (GUILayout.Button("Open Import Profile Editor", DaiGUIStyles.buttonLarge))
39 | {
40 | ImportProfileWindow.ShowWindow(m_Target);
41 | }
42 |
43 | GUILayout.FlexibleSpace();
44 | GUILayout.EndHorizontal();
45 | GUILayout.EndVertical();
46 | }
47 | }
48 | }
--------------------------------------------------------------------------------
/Editor/Interface/PropertyDrawers/PathFilterPropertyDrawer.cs:
--------------------------------------------------------------------------------
1 | using AssetPipeline.Filters;
2 | using UnityEditor;
3 | using UnityEngine;
4 |
5 | namespace AssetPipeline.PropertyDrawers
6 | {
7 | [CustomPropertyDrawer(typeof(PathFilter))]
8 | internal class PathFilterPropertyDrawer : PropertyDrawer
9 | {
10 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
11 | {
12 | EditorGUI.BeginProperty(position, label, property);
13 | position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label);
14 | var ignoreCaseProp = property.FindPropertyRelative("ignoreCase");
15 |
16 | var dropdownRect = position;
17 | dropdownRect.width = 80;
18 | var textFieldRect = position;
19 | textFieldRect.xMin += 83;
20 | textFieldRect.xMax -= 24;
21 | var toggleRect = position;
22 | toggleRect.xMin = toggleRect.xMax - 20;
23 | toggleRect.height = 20;
24 | toggleRect.y -= 1;
25 |
26 | EditorGUI.PropertyField(dropdownRect, property.FindPropertyRelative("matchType"), GUIContent.none);
27 | EditorGUI.PropertyField(textFieldRect, property.FindPropertyRelative("pattern"), GUIContent.none);
28 | var ignoreCase = ignoreCaseProp.boolValue;
29 | if (GUI.Button(toggleRect, DaiGUIContent.ignoreCase, ignoreCase ? DaiGUIStyles.ignoreCaseOn : DaiGUIStyles.ignoreCaseOff))
30 | {
31 | ignoreCaseProp.boolValue = !ignoreCase;
32 | }
33 |
34 | EditorGUI.EndProperty();
35 | }
36 | }
37 | }
--------------------------------------------------------------------------------
/Editor/Dependencies/ReflectionMagic/IDynamicMember.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace AssetPipeline.ReflectionMagic
4 | {
5 | ///
6 | /// Defines an mechanism to access members (e.g. fields or properties) of objects in a consistent way.
7 | ///
8 | public interface IDynamicMember
9 | {
10 | ///
11 | /// Gets the name of the property.
12 | ///
13 | string Name { get; }
14 |
15 | ///
16 | /// Gets the type of the property.
17 | ///
18 | Type PropertyType { get; }
19 |
20 | ///
21 | /// Returns the property value of a specified object with optional index values for indexed properties.
22 | ///
23 | /// The object whose property value will be returned.
24 | /// Optional index values for indexed properties. The indexes of indexed properties are zero-based. This value should be null for non-indexed properties.
25 | /// The member value of the specified object.
26 | object GetValue(object obj, object[] index);
27 |
28 | ///
29 | /// Sets the property value of a specified object with optional index values for index properties.
30 | ///
31 | /// The object whose property value will be set.
32 | /// The new property value.
33 | /// Optional index values for indexed properties. This value should be null for non-indexed properties.
34 | void SetValue(object obj, object value, object[] index);
35 | }
36 | }
--------------------------------------------------------------------------------
/Editor/Processors/SetTextureMipmaps.cs:
--------------------------------------------------------------------------------
1 | using AssetPipeline.Import;
2 | using UnityEditor;
3 | using UnityEngine;
4 |
5 | namespace AssetPipeline.Processors
6 | {
7 | [AssetProcessorDescription("FilterByLabel@2x", ImportAssetTypeFlag.Textures)]
8 | public class SetTextureMipmaps : AssetProcessor
9 | {
10 | [SerializeField] public bool enableMipmaps;
11 |
12 | public override bool IsConfigOK(AssetImporter importer)
13 | {
14 | if (importer == null) return false;
15 | var ti = importer as TextureImporter;
16 | if (ti == null) return false;
17 |
18 | if (ti.mipmapEnabled != enableMipmaps || ti.streamingMipmaps != enableMipmaps)
19 | return false;
20 | return true;
21 | }
22 |
23 | void OnPostprocessTexture(string assetPath, TextureImporter importer)
24 | {
25 | if (importer.mipmapEnabled == enableMipmaps && importer.streamingMipmaps == enableMipmaps)
26 | return;
27 |
28 | importer.mipmapEnabled = enableMipmaps;
29 | importer.streamingMipmaps = enableMipmaps;
30 |
31 | ImportProfileUserData.AddOrUpdateProcessor(assetPath, this);
32 | Debug.Log($"[{GetName()}] Preset applied for {assetPath}");
33 | }
34 |
35 | public override void OnPostprocessTexture(string assetPath, TextureImporter importer, Texture2D tex)
36 | {
37 | OnPostprocessTexture(assetPath, importer);
38 | }
39 |
40 | public override void OnPostprocessCubemap(string assetPath, TextureImporter importer, Cubemap texture)
41 | {
42 | OnPostprocessTexture(assetPath, importer);
43 | }
44 | }
45 | }
--------------------------------------------------------------------------------
/Editor/Dependencies/ReflectionMagic/PrivateReflectionDynamicObjectInstance.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Concurrent;
3 | using System.Collections.Generic;
4 | using System.Reflection;
5 |
6 | namespace AssetPipeline.ReflectionMagic
7 | {
8 | public class PrivateReflectionDynamicObjectInstance : PrivateReflectionDynamicObjectBase
9 | {
10 | static readonly ConcurrentDictionary> s_PropertiesOnType = new ConcurrentDictionary>();
11 |
12 | readonly object m_Instance;
13 |
14 | ///
15 | /// Initializes a new instance of the class, wrapping the specified object.
16 | ///
17 | /// The object to wrap.
18 | /// Thrown when is null.
19 | public PrivateReflectionDynamicObjectInstance(object instance)
20 | {
21 | m_Instance = instance ?? throw new ArgumentNullException(nameof(instance));
22 | }
23 |
24 | protected override IDictionary> PropertiesOnType => s_PropertiesOnType;
25 |
26 | // For instance calls, we get the type from the instance
27 | protected override Type TargetType => m_Instance.GetType();
28 |
29 | protected override object Instance => m_Instance;
30 |
31 | ///
32 | /// The object that the wraps.
33 | ///
34 | public override object RealObject => Instance;
35 |
36 | protected override BindingFlags BindingFlags => BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;
37 | }
38 | }
--------------------------------------------------------------------------------
/Editor/Processors/Inspectors/ExtractMaterialsInspector.cs:
--------------------------------------------------------------------------------
1 | using AssetPipeline.Import;
2 | using UnityEditor;
3 | using UnityEngine;
4 |
5 | namespace AssetPipeline.Processors
6 | {
7 | [CustomEditor(typeof(ExtractMaterials))]
8 | internal class ExtractMaterialsInspector : AssetProcessorInspector
9 | {
10 | SerializedProperty m_PathType;
11 | SerializedProperty m_Destination;
12 | SerializedProperty m_TargetFolder;
13 | SerializedProperty m_FileExistsAction;
14 |
15 | protected override void OnEnable()
16 | {
17 | m_PathType = serializedObject.FindProperty("pathType");
18 | m_Destination = serializedObject.FindProperty("destination");
19 | m_TargetFolder = serializedObject.FindProperty("targetFolder");
20 | m_FileExistsAction = serializedObject.FindProperty("fileExistsAction");
21 | base.OnEnable();
22 | }
23 |
24 | public override void OnInspectorGUI()
25 | {
26 | serializedObject.Update();
27 | DrawBaseProperties();
28 | EditorGUILayout.PropertyField(m_PathType);
29 | var enumValueIndex = m_PathType.enumValueIndex;
30 | if (enumValueIndex == (int) MaterialPathType.Relative || enumValueIndex == (int) MaterialPathType.Absolute)
31 | {
32 | EditorGUILayout.PropertyField(m_Destination);
33 | DrawTemplateVariables();
34 | }
35 | else if (enumValueIndex == (int) MaterialPathType.TargetFolder)
36 | {
37 | EditorGUILayout.PropertyField(m_TargetFolder, DaiGUIContent.destination);
38 | }
39 |
40 | EditorGUILayout.PropertyField(m_FileExistsAction, new GUIContent("Material Exists Action"));
41 |
42 | serializedObject.ApplyModifiedProperties();
43 | }
44 | }
45 | }
--------------------------------------------------------------------------------
/Editor/Utility/AssetProcessorUtility.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Reflection;
5 | using UnityEditor;
6 | using UnityEngine;
7 |
8 | namespace AssetPipeline
9 | {
10 | internal static class AssetProcessorUtility
11 | {
12 | public static Texture GetIcon(this Type processorType)
13 | {
14 | var attr = processorType.GetCustomAttribute();
15 | return attr != null ? attr.Icon : EditorGUIUtility.FindTexture("_Popup@2x");
16 | }
17 |
18 | public static string GetProcessorName(this Type processorType, bool useFullName = false)
19 | {
20 | var processorNameAttribute = processorType.GetCustomAttribute();
21 | if (processorNameAttribute != null)
22 | {
23 | return string.IsNullOrEmpty(processorNameAttribute.Name) ? ObjectNames.NicifyVariableName(processorType.Name) : processorNameAttribute.Name;
24 | }
25 |
26 | var name = ObjectNames.NicifyVariableName(processorType.Name);
27 | return useFullName ? processorType.FullName.Replace(processorType.Name, name).Replace(".", "/") : name;
28 | }
29 |
30 | internal static bool HasOverriddenMethod(this Type type, string methodName, BindingFlags bindingFlags = BindingFlags.Instance | BindingFlags.Public)
31 | {
32 | return type.GetMethods(bindingFlags).Any(x => x.Name == methodName && x.DeclaringType == type);
33 | }
34 |
35 | internal static bool HasOverriddenMethods(this Type type, IList methodNames, BindingFlags bindingFlags = BindingFlags.Instance | BindingFlags.Public)
36 | {
37 | return type.GetMethods(bindingFlags).Any(x => methodNames.Contains(x.Name) && x.DeclaringType == type);
38 | }
39 | }
40 | }
--------------------------------------------------------------------------------
/Editor/Assets/GUIIcon.shader:
--------------------------------------------------------------------------------
1 | // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
2 |
3 | Shader "Hidden/AssetPipeline/Editor/GUIIcon"
4 | {
5 | Properties
6 | {
7 | _MainTex("Texture", 2D) = "white" {}
8 | _Color("Color", Color) = (1,1,1,1)
9 | }
10 | SubShader
11 | {
12 | Blend SrcAlpha Zero
13 | Pass
14 | {
15 | CGPROGRAM
16 | #pragma vertex vert
17 | #pragma fragment frag
18 | #include "UnityCG.cginc"
19 |
20 | struct appdata
21 | {
22 | float4 vertex : POSITION;
23 | float2 uv : TEXCOORD0;
24 | };
25 |
26 | struct v2f
27 | {
28 | float2 uv : TEXCOORD0;
29 | float4 vertex : SV_POSITION;
30 | };
31 |
32 | sampler2D _MainTex;
33 | float4 _Color;
34 |
35 | v2f vert(appdata v)
36 | {
37 | v2f o;
38 | o.vertex = UnityObjectToClipPos(v.vertex);
39 | o.uv = v.uv;
40 | return o;
41 | }
42 |
43 | fixed4 frag(v2f i) : SV_Target
44 | {
45 | // drop shadow:
46 | // float texelSize = 1.0 / 34.0;
47 | // float2 shadowUv = clamp(i.uv + float2(-texelSize, texelSize * 2), float2(0, 0), float2(1, 1));
48 | // fixed4 shadow = fixed4(0, 0, 0, tex2D(_MainTex, shadowUv).a);
49 |
50 | fixed4 col = _Color;
51 | col.a *= tex2D(_MainTex, i.uv).a;
52 |
53 | // drop shadow:
54 | // col = lerp(shadow, col, col.a);
55 |
56 | return col;
57 | }
58 | ENDCG
59 | }
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/Editor/Assets/__importerspriteatlasesdummy__.spriteatlas:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!687078895 &4343727234628468602
4 | SpriteAtlas:
5 | m_ObjectHideFlags: 0
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInstance: {fileID: 0}
8 | m_PrefabAsset: {fileID: 0}
9 | m_Name: __importerspriteatlasesdummy__
10 | m_EditorData:
11 | serializedVersion: 2
12 | textureSettings:
13 | serializedVersion: 2
14 | anisoLevel: 1
15 | compressionQuality: 50
16 | maxTextureSize: 2048
17 | textureCompression: 0
18 | filterMode: 1
19 | generateMipMaps: 0
20 | readable: 0
21 | crunchedCompression: 0
22 | sRGB: 1
23 | platformSettings:
24 | - serializedVersion: 3
25 | m_BuildTarget: Android
26 | m_MaxTextureSize: 2048
27 | m_ResizeAlgorithm: 0
28 | m_TextureFormat: 50
29 | m_TextureCompression: 1
30 | m_CompressionQuality: 50
31 | m_CrunchedCompression: 0
32 | m_AllowsAlphaSplitting: 0
33 | m_Overridden: 0
34 | m_AndroidETC2FallbackOverride: 0
35 | m_ForceMaximumCompressionQuality_BC6H_BC7: 0
36 | - serializedVersion: 3
37 | m_BuildTarget: iPhone
38 | m_MaxTextureSize: 2048
39 | m_ResizeAlgorithm: 0
40 | m_TextureFormat: 50
41 | m_TextureCompression: 1
42 | m_CompressionQuality: 50
43 | m_CrunchedCompression: 0
44 | m_AllowsAlphaSplitting: 0
45 | m_Overridden: 0
46 | m_AndroidETC2FallbackOverride: 0
47 | m_ForceMaximumCompressionQuality_BC6H_BC7: 0
48 | packingSettings:
49 | serializedVersion: 2
50 | padding: 4
51 | blockOffset: 1
52 | allowAlphaSplitting: 0
53 | enableRotation: 1
54 | enableTightPacking: 1
55 | enableAlphaDilation: 0
56 | secondaryTextureSettings: {}
57 | variantMultiplier: 1
58 | packables: []
59 | bindAsDefault: 1
60 | isAtlasV2: 0
61 | cachedData: {fileID: 0}
62 | m_MasterAtlas: {fileID: 0}
63 | m_PackedSprites: []
64 | m_PackedSpriteNamesToIndex: []
65 | m_RenderDataMap: {}
66 | m_Tag: __importerspriteatlasesdummy__
67 | m_IsVariant: 0
68 |
--------------------------------------------------------------------------------
/Editor/Utility/ImportAssetTypeUtility.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Reflection;
6 | using AssetPipeline.Import;
7 |
8 | namespace AssetPipeline
9 | {
10 | internal static class ImportAssetTypeUtility
11 | {
12 | internal static ImportAssetType GetImportType(this string assetPath)
13 | {
14 | var extension = Path.GetExtension(assetPath);
15 | var assetTypeFileExtensions = AssetPipelineSettings.Settings.assetTypeFileExtensions;
16 | foreach (var typeExtensions in assetTypeFileExtensions.Where(typeExtensions => typeExtensions.FileExtensions.Contains(extension) || typeExtensions.FileExtensions.Contains(extension.Substring(1))))
17 | {
18 | return typeExtensions.AssetType;
19 | }
20 |
21 | return ImportAssetType.Other;
22 | }
23 |
24 | internal static bool IsValidFileExtension(this ImportAssetType assetType, string assetPath, IEnumerable otherExtensions = null)
25 | {
26 | var assetExtension = Path.GetExtension(assetPath).ToLowerInvariant();
27 | if (AssetPipelineSettings.Settings.assetTypeFileExtensions.Count > (int) assetType)
28 | {
29 | var extensions = AssetPipelineSettings.Settings.assetTypeFileExtensions[(int) assetType].FileExtensions.Where(x => !string.IsNullOrWhiteSpace(x));
30 | return extensions.Contains(assetExtension) || assetExtension.StartsWith(".") && extensions.Contains(assetExtension.Substring(1));
31 | }
32 |
33 | return assetType == ImportAssetType.Other && otherExtensions != null && (otherExtensions.Contains(assetExtension) || (assetExtension.StartsWith(".") && otherExtensions.Contains(assetExtension.Substring(1))));
34 | }
35 |
36 | internal static bool IsValidAssetType(this Type type, ImportAssetType assetType)
37 | {
38 | var attr = type.GetCustomAttribute();
39 | return attr == null || attr.ValidAssetTypes.HasFlag((ImportAssetTypeFlag) (1 << (int) assetType));
40 | }
41 | }
42 | }
--------------------------------------------------------------------------------
/Editor/Processors/Inspectors/SetupMaterialsInspector.cs:
--------------------------------------------------------------------------------
1 | using System.Linq;
2 | using AssetPipeline.Import;
3 | using UnityEditor;
4 | using UnityEditorInternal;
5 | using UnityEngine;
6 |
7 | namespace AssetPipeline.Processors
8 | {
9 | [CustomEditor(typeof(SetupMaterials))]
10 | internal class SetupMaterialsInspector : AssetProcessorInspector
11 | {
12 | SerializedProperty m_MaterialSetups;
13 | ReorderableList m_MaterialSetupList;
14 | internal static string[] m_ShaderNames;
15 |
16 | protected override void OnEnable()
17 | {
18 | m_MaterialSetups = serializedObject.FindProperty("materialSetups");
19 | m_MaterialSetupList = new ReorderableList(serializedObject, m_MaterialSetups, false, true, true, true);
20 | m_MaterialSetupList.drawHeaderCallback = rect => EditorGUI.LabelField(rect, "Material Setups", DaiGUIStyles.boldLabel);
21 | m_MaterialSetupList.elementHeightCallback = elementIndex => EditorGUI.GetPropertyHeight(m_MaterialSetups.GetArrayElementAtIndex(elementIndex));
22 | m_MaterialSetupList.drawElementCallback = DrawMaterialSetupElement;
23 | m_ShaderNames = ShaderUtil.GetAllShaderInfo().Where(x => x.name != "Hidden/AssetPipeline/Editor/ColoredTexture").Select(x => x.name).ToArray();
24 | base.OnEnable();
25 | }
26 |
27 | public override void OnInspectorGUI()
28 | {
29 | serializedObject.Update();
30 | DrawBaseProperties();
31 | m_MaterialSetupList.DoLayoutList();
32 | serializedObject.ApplyModifiedProperties();
33 | }
34 |
35 | void DrawMaterialSetupElement(Rect rect, int index, bool active, bool focused)
36 | {
37 | EditorGUI.PropertyField(rect, m_MaterialSetups.GetArrayElementAtIndex(index), GUIContent.none);
38 | DrawSeparatorLine(rect);
39 | rect.y += rect.height - 1;
40 | DrawSeparatorLine(rect);
41 | }
42 |
43 | static void DrawSeparatorLine(Rect rect)
44 | {
45 | EditorGUI.DrawRect(new Rect(rect.x - 6, rect.y, rect.width + 12, 1), ColorPalette.BackgroundDarker);
46 | }
47 | }
48 | }
--------------------------------------------------------------------------------
/Settings/UI2Atlas.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!114 &-8810039213761580640
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: 2833c50f97654ad2b8034ab06a4dee5a, type: 3}
13 | m_Name: Filter_Textures
14 | m_EditorClassIdentifier:
15 | enabled: 1
16 | showOptions: 0
17 | file:
18 | name: assetFilter
19 | pattern:
20 | anchor: 4
21 | assetType: 0
22 | otherAssetExtensions: []
23 | subPaths: []
24 | fileExclusions: []
25 | assetProcessors:
26 | - {fileID: -5288639228502289621}
27 | parent: {fileID: 11400000}
28 | --- !u!114 &-5288639228502289621
29 | MonoBehaviour:
30 | m_ObjectHideFlags: 0
31 | m_CorrespondingSourceObject: {fileID: 0}
32 | m_PrefabInstance: {fileID: 0}
33 | m_PrefabAsset: {fileID: 0}
34 | m_GameObject: {fileID: 0}
35 | m_Enabled: 1
36 | m_EditorHideFlags: 0
37 | m_Script: {fileID: 11500000, guid: a87ab1fb8e3346d59931ee8b71822f6c, type: 3}
38 | m_Name: Textures_AddToSpriteAtlas
39 | m_EditorClassIdentifier:
40 | parent: {fileID: -8810039213761580640}
41 | enabled: 1
42 | runOnImport: 1
43 | addFolderToSpriteAtlas: 1
44 | pathType: 0
45 | destination:
46 | targetFolder: {fileID: 0}
47 | spriteAtlasName: (assetParentFolderName)
48 | includeInBuild: 1
49 | createVariantAtlas: 0
50 | variantSuffix: -SD
51 | includeVariantInBuild: 1
52 | variantScale: 0.5
53 | --- !u!114 &11400000
54 | MonoBehaviour:
55 | m_ObjectHideFlags: 0
56 | m_CorrespondingSourceObject: {fileID: 0}
57 | m_PrefabInstance: {fileID: 0}
58 | m_PrefabAsset: {fileID: 0}
59 | m_GameObject: {fileID: 0}
60 | m_Enabled: 1
61 | m_EditorHideFlags: 0
62 | m_Script: {fileID: 11500000, guid: 4c962c1226e043caa066ec79a5193cc0, type: 3}
63 | m_Name: UI2Atlas
64 | m_EditorClassIdentifier:
65 | enabled: 1
66 | path:
67 | name: u_i_2_atlas
68 | pattern: Assets/AssetRaw/UIRaw/Atlas
69 | anchor: 1
70 | pathExclusions: []
71 | assetFilters:
72 | - {fileID: -8810039213761580640}
73 |
--------------------------------------------------------------------------------
/Editor/Utility/ColorUtility.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using UnityEngine;
3 |
4 | namespace AssetPipeline
5 | {
6 | internal static class ColorUtility
7 | {
8 | static ColorUtility()
9 | {
10 | pixels = new Dictionary();
11 | }
12 |
13 | static readonly Dictionary pixels;
14 |
15 | public static Color Gray(float brightness)
16 | {
17 | return new Color(brightness, brightness, brightness, 1f);
18 | }
19 |
20 | public static Color WithAlpha(this Color color, float alpha)
21 | {
22 | color.a = alpha;
23 | return color;
24 | }
25 |
26 | public static Color WithAlphaMultiplied(this Color color, float alphaMultiplier)
27 | {
28 | color.a *= alphaMultiplier;
29 | return color;
30 | }
31 |
32 |
33 | public static Texture2D GetPixel(this SkinnedColor color)
34 | {
35 | return GetPixel(color.color);
36 | }
37 |
38 | public static Texture2D GetPixel(this Color color)
39 | {
40 | if (!pixels.ContainsKey(color))
41 | {
42 | var pixel = new Texture2D(1, 1, TextureFormat.ARGB32, false, false);
43 | pixel.SetPixel(0, 0, color);
44 | pixel.hideFlags = HideFlags.HideAndDontSave;
45 | pixel.filterMode = FilterMode.Point;
46 | pixel.Apply();
47 | pixels.Add(color, pixel);
48 | }
49 |
50 | return pixels[color];
51 | }
52 |
53 | public static string ToHexString(this Color color)
54 | {
55 | return string.Format("{0:X2}{1:X2}{2:X2}{3:X2}", (byte) (color.r * 255), (byte) (color.g * 255), (byte) (color.b * 255), (byte) (color.a * 255));
56 | }
57 |
58 | public static GUIStyle CreateBackground(this Color color)
59 | {
60 | return new GUIStyle {normal = {background = color.GetPixel()}};
61 | }
62 |
63 | public static GUIStyle CreateBackground(this SkinnedColor skinnedColor)
64 | {
65 | return skinnedColor.color.CreateBackground();
66 | }
67 | }
68 | }
--------------------------------------------------------------------------------
/Editor/Utility/TargetPathTypeUtility.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 | using AssetPipeline.Processors;
3 | using UnityEditor;
4 |
5 | namespace AssetPipeline
6 | {
7 | internal static class TargetPathTypeUtility
8 | {
9 | public static string GetFolderPath(this MaterialPathType pathType, string source, string destination, DefaultAsset targetFolder = null)
10 | {
11 | if (pathType == MaterialPathType.TargetFolder && targetFolder)
12 | {
13 | return AssetDatabase.GetAssetPath(targetFolder);
14 | }
15 |
16 | if (pathType == MaterialPathType.Absolute) {
17 | return destination.FixPathSeparators();
18 | }
19 |
20 | var destinationPath = File.Exists(source) ? Path.GetDirectoryName(source) : source;
21 | if (pathType == MaterialPathType.Relative)
22 | {
23 | destinationPath = Path.Combine(destinationPath, destination).FixPathSeparators();
24 | }
25 | else if (pathType == MaterialPathType.MaterialFolderWithAsset)
26 | {
27 | destinationPath = Path.Combine(destinationPath, "Materials").FixPathSeparators();
28 | }
29 |
30 | return destinationPath;
31 | }
32 |
33 | public static string GetFolderPath(this TargetPathType pathType, string source, string destination, DefaultAsset targetFolder = null)
34 | {
35 | if (pathType == TargetPathType.TargetFolder && targetFolder)
36 | {
37 | return AssetDatabase.GetAssetPath(targetFolder);
38 | }
39 |
40 | if (pathType == TargetPathType.Absolute) {
41 | return destination.FixPathSeparators();
42 | }
43 |
44 | var destinationPath = File.Exists(source) ? Path.GetDirectoryName(source) : source;
45 | if (pathType == TargetPathType.Relative)
46 | {
47 | destinationPath = Path.Combine(destinationPath, destination).FixPathSeparators();
48 | }
49 | else if (pathType == TargetPathType.ParentFolder)
50 | {
51 | destinationPath = Path.Combine(destinationPath, "..").FixPathSeparators();
52 | }
53 |
54 | return destinationPath;
55 | }
56 | }
57 | }
--------------------------------------------------------------------------------
/Editor/Filters/PathFilter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Text.RegularExpressions;
3 |
4 | namespace AssetPipeline.Filters
5 | {
6 | public enum StringMatchType
7 | {
8 | Equals = 0,
9 | Contains = 1,
10 | StartsWith = 2,
11 | EndsWith = 3,
12 | Wildcard = 4,
13 | Regex = 5
14 | }
15 |
16 | [Serializable]
17 | public class PathFilter : StringFilter
18 | {
19 | }
20 |
21 | [Serializable]
22 | public class StringFilter
23 | {
24 | public StringMatchType matchType;
25 | public string pattern;
26 | public bool ignoreCase;
27 |
28 | public StringFilter() : this(StringMatchType.Wildcard, "*")
29 | {
30 | }
31 |
32 | public StringFilter(StringMatchType matchType, string pattern, bool ignoreCase = false)
33 | {
34 | this.matchType = matchType;
35 | this.pattern = pattern;
36 | this.ignoreCase = ignoreCase;
37 | }
38 |
39 | public bool IsMatch(string input)
40 | {
41 | if (string.IsNullOrEmpty(input) || string.IsNullOrEmpty(pattern))
42 | {
43 | return false;
44 | }
45 |
46 | var comparisonType = ignoreCase ? StringComparison.OrdinalIgnoreCase : StringComparison.CurrentCulture;
47 | switch (matchType)
48 | {
49 | case StringMatchType.Equals:
50 | return string.Equals(input, pattern, comparisonType);
51 | case StringMatchType.Contains:
52 | return input.Contains(pattern, comparisonType);
53 | case StringMatchType.StartsWith:
54 | return input.StartsWith(pattern, comparisonType);
55 | case StringMatchType.EndsWith:
56 | return input.EndsWith(pattern, comparisonType);
57 | case StringMatchType.Wildcard:
58 | return Regex.Match(input, pattern.WildcardToRegex(false), ignoreCase ? RegexOptions.IgnoreCase : RegexOptions.None).Success;
59 | case StringMatchType.Regex:
60 | return Regex.Match(input, pattern, ignoreCase ? RegexOptions.IgnoreCase : RegexOptions.None).Success;
61 | }
62 |
63 | return false;
64 | }
65 | }
66 | }
--------------------------------------------------------------------------------
/Editor/Filters/StringTokenFilter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Text.RegularExpressions;
4 |
5 | namespace AssetPipeline.Filters
6 | {
7 | [Serializable]
8 | public class StringTokenFilter
9 | {
10 | public string name;
11 | public string rulePattern;
12 |
13 | public int[] GetRegexGroups()
14 | {
15 | return new Regex(name).GetGroupNumbers();
16 | }
17 |
18 | public string GetName(string assetPath, string pattern = "")
19 | {
20 | rulePattern = pattern;
21 | var nameStr = name;
22 | nameStr = nameStr.Replace("(.)", Path.GetFileName(Path.GetDirectoryName(assetPath)));
23 | nameStr = nameStr.Replace("(assetName)", Path.GetFileNameWithoutExtension(assetPath));
24 | nameStr = nameStr.Replace("(assetExt)", Path.GetExtension(assetPath));
25 | var rulePathRegex = Regex.Match(assetPath, rulePattern);
26 | if (rulePathRegex.Success)
27 | {
28 | for (var i = 1; i < rulePathRegex.Groups.Count; i++)
29 | {
30 | nameStr = nameStr.Replace($"(${i})", rulePathRegex.Groups[i].Value);
31 | }
32 | }
33 |
34 | var relativePathRegex = Regex.Match(nameStr, @"(\([\.\/]+\))");
35 | if (relativePathRegex.Success)
36 | {
37 | for (var i = 1; i < relativePathRegex.Groups.Count; i++)
38 | {
39 | var test = relativePathRegex.Groups[i].Value;
40 | test = test.Substring(1, test.Length - 2);
41 | var testSplit = test.Split(new[] {@"/"}, StringSplitOptions.RemoveEmptyEntries);
42 | var replacement = GetRelativeParentName(assetPath, testSplit.Length);
43 | nameStr = nameStr.Replace(relativePathRegex.Groups[i].Value, replacement);
44 | }
45 | }
46 |
47 | return nameStr;
48 | }
49 |
50 | string GetRelativeParentName(string assetPath, int depth)
51 | {
52 | var dirInfo = new DirectoryInfo(Path.GetDirectoryName(assetPath));
53 | for (var i = 0; i < depth; i++)
54 | {
55 | dirInfo = dirInfo.Parent;
56 | }
57 |
58 | return dirInfo.Name;
59 | }
60 | }
61 | }
--------------------------------------------------------------------------------
/Editor/Processors/Inspectors/ApplyPresetInspector.cs:
--------------------------------------------------------------------------------
1 | using AssetPipeline.Import;
2 | using UnityEditor;
3 | using UnityEngine;
4 |
5 | namespace AssetPipeline.Processors
6 | {
7 | [CustomEditor(typeof(ApplyPreset))]
8 | internal class ApplyPresetInspector : AssetProcessorInspector
9 | {
10 | SerializedProperty m_Preset;
11 | Editor m_CachedEditor;
12 |
13 | protected SerializedProperty m_IgnoreBuildSettingsOrderProperty;
14 |
15 | public static readonly GUIContent guiIgnoreBuildSettingsOrder = new GUIContent("忽略BuildSettings顺序");
16 |
17 | protected override void OnEnable()
18 | {
19 | m_Preset = serializedObject.FindProperty("preset");
20 | m_IgnoreBuildSettingsOrderProperty = serializedObject.FindProperty("IgnoreBuildSettingsOrder");
21 |
22 | base.OnEnable();
23 | }
24 |
25 | public override void OnInspectorGUI()
26 | {
27 | serializedObject.Update();
28 | #if false
29 | // EditorGUILayout.HelpBox("This processor will only execute when a new asset is added.", MessageType.Warning);
30 | // EditorGUILayout.Space();
31 | #else
32 | EditorGUILayout.PropertyField(m_RunOnImportProperty, DaiGUIContent.runOnEveryImport);
33 | if (!m_RunOnImportProperty.boolValue)
34 | {
35 | EditorGUILayout.HelpBox("This processor will only execute when a new asset is added.\nTo run on every import, tick the Run On Every Import toggle above.", MessageType.Warning);
36 | }
37 |
38 | EditorGUILayout.PropertyField(m_IgnoreBuildSettingsOrderProperty, guiIgnoreBuildSettingsOrder);
39 | if (!m_IgnoreBuildSettingsOrderProperty.boolValue)
40 | {
41 | EditorGUILayout.HelpBox("开启此选型会忽略BuildSetting顺序", MessageType.Warning);
42 | }
43 |
44 | EditorGUILayout.Space();
45 | #endif
46 |
47 | if (!m_CachedEditor)
48 | {
49 | CreateCachedEditor(m_Preset.objectReferenceValue, System.Type.GetType("UnityEditor.Presets.PresetEditor, UnityEditor"), ref m_CachedEditor);
50 | }
51 |
52 | m_CachedEditor.OnInspectorGUI();
53 |
54 | if (serializedObject.ApplyModifiedProperties())
55 | {
56 | EditorUtility.SetDirty(target);
57 | }
58 | }
59 | }
60 | }
--------------------------------------------------------------------------------
/Editor/Processors/AnimCompression.cs:
--------------------------------------------------------------------------------
1 | using System.Linq;
2 | using AssetPipeline.Import;
3 | using UnityEditor;
4 | using UnityEngine;
5 |
6 | namespace AssetPipeline.Processors
7 | {
8 | [AssetProcessorDescription("FilterByLabel@2x", ImportAssetTypeFlag.Models)]
9 | public class AnimCompression : AssetProcessor
10 | {
11 | [SerializeField] private ModelImporterAnimationCompression animationCompression;
12 | [SerializeField] private float animationRotationError;
13 | [SerializeField] private float animationPositionError;
14 | [SerializeField] private float animationScaleError;
15 | [SerializeField] private bool resampleCurve=false;
16 | public override bool IsConfigOK (AssetImporter importer)
17 | {
18 | if (importer == null) return false;
19 | var mi= importer as ModelImporter;
20 | if (mi == null) return false;
21 | if (!mi.importAnimation) return true;
22 | if (mi.animationCompression != animationCompression)
23 | {
24 | return false;
25 | }
26 | if (mi.animationRotationError != animationRotationError)
27 | {
28 | return false;
29 | }
30 | if (mi.animationPositionError != animationPositionError)
31 | {
32 | return false;
33 | }
34 | if (mi.animationScaleError != animationScaleError)
35 | {
36 | return false;
37 | }
38 | if (mi.resampleCurves != resampleCurve)
39 | {
40 | return false;
41 | }
42 | return true;
43 | }
44 | public override void OnPostprocessModel(string assetPath, ModelImporter importer, GameObject go)
45 | {
46 | if (importer.importAnimation&& !IsConfigOK(importer))
47 | {
48 | importer.animationCompression = animationCompression;
49 | importer.animationRotationError = animationRotationError;
50 | importer.animationPositionError = animationPositionError;
51 | importer.animationScaleError = animationScaleError;
52 | importer.resampleCurves = resampleCurve;
53 | ImportProfileUserData.AddOrUpdateProcessor(assetPath, this);
54 | Debug.Log($"[{GetName()}] Preset applied for {assetPath}");
55 | }
56 | }
57 |
58 | }
59 | }
--------------------------------------------------------------------------------
/Editor/Processors/Inspectors/AssetProcessorInspector.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using AssetPipeline.NamingConvention;
3 | using UnityEditor;
4 |
5 | namespace AssetPipeline.Import
6 | {
7 | public class AssetProcessorInspector : Editor
8 | {
9 | protected AssetProcessor m_ProcessorTarget;
10 | protected SerializedProperty m_RunOnImportProperty;
11 |
12 | protected virtual void OnEnable()
13 | {
14 | m_ProcessorTarget = (AssetProcessor) target;
15 | m_RunOnImportProperty = serializedObject.FindProperty("runOnImport");
16 | }
17 |
18 | protected void DrawBaseProperties()
19 | {
20 | EditorGUILayout.PropertyField(m_RunOnImportProperty, DaiGUIContent.runOnEveryImport);
21 | if (!m_RunOnImportProperty.boolValue)
22 | {
23 | EditorGUILayout.HelpBox("This processor will only execute when a new asset is added.\nTo run on every import, tick the Run On Every Import toggle above.", MessageType.Warning);
24 | }
25 |
26 | EditorGUILayout.Space();
27 | }
28 |
29 | protected void DrawTemplateVariables()
30 | {
31 | List profileVariables;
32 | List filterVariables;
33 | try
34 | {
35 | profileVariables = m_ProcessorTarget.parent.parent.path.Variables;
36 | }
37 | catch (ValueException)
38 | {
39 | profileVariables = new List();
40 | }
41 |
42 | try
43 | {
44 | filterVariables = m_ProcessorTarget.parent.file.Variables;
45 | }
46 | catch (ValueException)
47 | {
48 | filterVariables = new List();
49 | }
50 |
51 | var message = "The following tokens can be used:\n{assetFilename}\t\t\tAsset Filename\n{assetFileExtension}\t\tAsset File Extension\n{assetFolderName}\t\t\tAsset Folder Name\n{assetParentFolderName}\t\tAsset Parent Folder Name\n{assetParentParentFolderName}\tAsset Parent Parent Folder Name";
52 | foreach (var variable in profileVariables)
53 | {
54 | message += $"\n{{{variable}}}";
55 | }
56 |
57 | foreach (var variable in filterVariables)
58 | {
59 | message += $"\n{{{variable}}}";
60 | }
61 |
62 | EditorGUILayout.HelpBox(message, MessageType.None);
63 | }
64 | }
65 | }
--------------------------------------------------------------------------------
/Editor/Profiles/Import/AssetFilter.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.IO;
3 | using AssetPipeline.Filters;
4 | using UnityEngine;
5 |
6 | namespace AssetPipeline.Import
7 | {
8 | public class AssetFilter : ScriptableObject
9 | {
10 | public bool enabled;
11 | public bool showOptions;
12 | public NamingConventionRule file;
13 | public ImportAssetType assetType;
14 | public List otherAssetExtensions;
15 | public List subPaths = new List();
16 | public List fileExclusions = new List();
17 | public List assetProcessors;
18 | public AssetImportProfile parent;
19 |
20 | public bool IsMatch(string assetPath, bool mustBeEnabled = true)
21 | {
22 | var dirname = Path.GetDirectoryName(assetPath).FixPathSeparators();
23 | var filename = Path.GetFileNameWithoutExtension(assetPath);
24 | var filenameWithExtension = Path.GetFileName(assetPath);
25 |
26 | var isEnabled = !mustBeEnabled || enabled;
27 | var isValidFileExtension = assetType.IsValidFileExtension(assetPath, otherAssetExtensions);
28 | var isNotExcluded = IsValidSubPath(dirname) && !IsExcludedFile(filename);
29 | var isFileValid = file.IsValid && file.IsMatch(filenameWithExtension);
30 | //Debug.LogError("assetPath "+ assetPath+" isEnabled " + isEnabled+ " isValidFileExtension "+ isValidFileExtension+ " isNotExcluded "+ isNotExcluded+ " isFileValid "+ isFileValid);
31 | return isEnabled && isValidFileExtension && isNotExcluded && isFileValid;
32 | }
33 |
34 | bool IsValidSubPath(string assetPath)
35 | {
36 | if (subPaths.Count == 0) return true;
37 | foreach (var subPath in subPaths)
38 | {
39 | if (assetPath.Contains(subPath))
40 | {
41 | return true;
42 | }
43 | }
44 |
45 | return false;
46 | }
47 |
48 | bool IsExcludedFile(string assetPath)
49 | {
50 | foreach (var exclusion in fileExclusions)
51 | {
52 | if (exclusion.IsMatch(assetPath))
53 | {
54 | return true;
55 | }
56 | }
57 |
58 | return false;
59 | }
60 |
61 | public void RemoveNullProcessors()
62 | {
63 | assetProcessors.RemoveAll(x => x == null);
64 | }
65 | }
66 | }
--------------------------------------------------------------------------------
/Editor/Interface/EditorTexture/EditorTextures.cs:
--------------------------------------------------------------------------------
1 | namespace AssetPipeline
2 | {
3 | internal static class EditorTextures
4 | {
5 | static EditorTexture s_TriangleDown;
6 | static EditorTexture s_TriangleUp;
7 | static EditorTexture s_X;
8 |
9 | public static EditorTexture Down
10 | {
11 | get
12 | {
13 | if (s_TriangleDown == null)
14 | {
15 | s_TriangleDown = new EditorTexture(34, 34,
16 | "iVBORw0KGgoAAAANSUhEUgAAACIAAAAiCAYAAAA6RwvCAAAA/ElEQVRYCe3VMQ7CMAyFYcrKxm04Ir0GXA9G1uJ/QEJWQp6dpUiu1KHB7zV8RWXZtu2wh+O4h02wh9qIfxIlUiJewF//1W/kZrvnrZc9r/7bt64X4c16tuCjFRbXTjb3Gs0qj+ZpJfdRUefz1daHmyCriDCXVZE0uIEiwlxGRdbgBqoIs1EVWYNyVYTZiEpIg/KICPOqSkiD4ogI84pKWIPiqAiZkUpYg9KoCJlfKikNSjMi5HoqKQ0KMyLkWippDQqzImS9SlqDsqwI2W+VKQ3KZkTIf1SmNCiaESGPysVO6R+WQO+YFen1htdnRcI37AVqI16mRErEC/jrN6YOVdWgTQ39AAAAAElFTkSuQmCC");
17 | }
18 |
19 | return s_TriangleDown;
20 | }
21 | }
22 |
23 | public static EditorTexture Up
24 | {
25 | get
26 | {
27 | if (s_TriangleUp == null)
28 | {
29 | s_TriangleUp = new EditorTexture(34, 34,
30 | "iVBORw0KGgoAAAANSUhEUgAAACIAAAAiCAYAAAA6RwvCAAABGklEQVRYCe2WQQrCQAxFraAL3bnWhbrSE3gEPYN4A+/gYfRMutOFXkEXCtYfaKGEoUlmKnSRgaFNJpP/+zqUZnmed9owum0wQR7cCH8TTsSJcAI89jPyLyIjNKYZPbKGPvHHwsEu1kkTRsYQvxcGJrg+Ysw0cVhPFeHqfSUt36YSWUDizGSWiC8sJ4apRq5QmDKVG+IZy4lhyqtZoTs3QYKUozXTSCESolGKE5U5pvqvK5bIBiIhGqURWluXgeYaQyRD46+mOWroQVVUYohslSaoTF1rJdJD87fBCJX2MT/SHiuRvdQwsK7aYyEygMgzIKRJDVH0qiu0EDnUNRLWxL0WIoJW2rKFSJqSsNuNcEBOxIlwAjxuzRn5AeVIM5pI9JapAAAAAElFTkSuQmCC");
31 | }
32 |
33 | return s_TriangleUp;
34 | }
35 | }
36 |
37 | public static EditorTexture X
38 | {
39 | get
40 | {
41 | if (s_X == null)
42 | {
43 | s_X = new EditorTexture(34, 34,
44 | "iVBORw0KGgoAAAANSUhEUgAAACIAAAAiCAYAAAA6RwvCAAABTklEQVRYCe2WUQ7CIAyGnaeaR9CbeY7dwee96a1mf0IT0rVd2RaDCU0I0vKXj7I5hmVZLi3YtQUIMHQQeRK9InsqMpBooobXa5QJnDHmQgMtcviG19dpA8VmaqXdaeBpEMOc0pADuUydGchCJNDMg5EQrHdhPJCJMxi9BmNBcIon/VDXVJ15Mou9voTZguA86prp3IynCA/b24iV7kcevEqn8ftG/o8ay7tXKSkW3SXv1uvL6q3WWzkUsDNgXAisGQHBnCMwmxA1IHthQhC1ILUwYQiANPPRiz4jtdWgTSYLVyUKgoR7LQQTATkCwfCbMFsgZ0CEYP7iL5534vVlyaPVU09BddLK8DdzDdBuZ1ydshJyM1ZlZhKbtzSZRI41GA+C9RLGhcAJsNDrAcPHNEIUbJgLg9asBMVSvjRBvaj82NnMt6aDyJPvFZEV+QLtPDH5milIBAAAAABJRU5ErkJggg==");
45 | }
46 |
47 | return s_X;
48 | }
49 | }
50 | }
51 | }
--------------------------------------------------------------------------------
/Editor/Interface/Colors/SkinnedColor.cs:
--------------------------------------------------------------------------------
1 | using UnityEditor;
2 | using UnityEngine;
3 |
4 | namespace AssetPipeline
5 | {
6 | internal struct SkinnedColor
7 | {
8 | static bool isProSkin => EditorGUIUtility.isProSkin;
9 |
10 | readonly Color lightColor;
11 | readonly Color darkColor;
12 |
13 | public Color color => isProSkin ? darkColor : lightColor;
14 |
15 | public SkinnedColor(float gray) : this(gray, gray)
16 | {
17 | }
18 |
19 | public SkinnedColor(float lightGray, float darkGray)
20 | {
21 | lightColor = ColorUtility.Gray(lightGray);
22 | darkColor = ColorUtility.Gray(darkGray);
23 | }
24 |
25 | public SkinnedColor(float lightGray, float lightAlpha, float darkGray, float darkAlpha)
26 | {
27 | lightColor = ColorUtility.Gray(lightGray).WithAlpha(lightAlpha);
28 | darkColor = ColorUtility.Gray(darkGray).WithAlpha(darkAlpha);
29 | }
30 |
31 | public SkinnedColor(Color light, Color dark)
32 | {
33 | lightColor = light;
34 | darkColor = dark;
35 | }
36 |
37 | public SkinnedColor(Color color) : this(color, color)
38 | {
39 | }
40 |
41 | public static implicit operator Color(SkinnedColor skinnedColor)
42 | {
43 | return skinnedColor.color;
44 | }
45 |
46 | public static implicit operator SkinnedColor(Color color)
47 | {
48 | return new SkinnedColor(color);
49 | }
50 |
51 | public string ToHexString()
52 | {
53 | return color.ToHexString();
54 | }
55 |
56 | public override string ToString()
57 | {
58 | return ToHexString();
59 | }
60 |
61 | public SkinnedColor WithAlpha(float alpha)
62 | {
63 | return new SkinnedColor(lightColor.WithAlpha(alpha), darkColor.WithAlpha(alpha));
64 | }
65 |
66 | public SkinnedColor WithAlpha(float lightAlpha, float darkAlpha)
67 | {
68 | return new SkinnedColor(lightColor.WithAlpha(lightAlpha), darkColor.WithAlpha(darkAlpha));
69 | }
70 |
71 | public SkinnedColor WithAlphaMultiplied(float alphaMultiplier)
72 | {
73 | return new SkinnedColor(lightColor.WithAlphaMultiplied(alphaMultiplier), darkColor.WithAlphaMultiplied(alphaMultiplier));
74 | }
75 |
76 | public SkinnedColor WithAlphaMultiplied(float lightAlphaMultiplier, float darkAlphaMultiplier)
77 | {
78 | return new SkinnedColor(lightColor.WithAlphaMultiplied(lightAlphaMultiplier), darkColor.WithAlphaMultiplied(darkAlphaMultiplier));
79 | }
80 | }
81 | }
--------------------------------------------------------------------------------
/Editor/Interface/DaiGUIUtility.cs:
--------------------------------------------------------------------------------
1 | using UnityEditor;
2 | using UnityEngine;
3 |
4 | namespace AssetPipeline
5 | {
6 | internal static class DaiGUIUtility
7 | {
8 | public static bool useLinearTextures => PlayerSettings.colorSpace == ColorSpace.Linear;
9 |
10 | public static void HorizontalSeparator()
11 | {
12 | GUILayout.Box(GUIContent.none, DaiGUIStyles.horizontalSeparator);
13 | }
14 |
15 | public static void HorizontalSeparator(float x, float y, float width)
16 | {
17 | var darkColor = ColorPalette.DarkLineColor.WithAlphaMultiplied(0.5f);
18 | var lightColor = ColorPalette.LightLineColor.WithAlphaMultiplied(0.5f);
19 | var rect = new Rect(x, y - 1, width, 1);
20 | EditorGUI.DrawRect(rect, darkColor);
21 | rect.y += 1;
22 | EditorGUI.DrawRect(rect, lightColor);
23 | }
24 |
25 | public static void VerticalSeparator()
26 | {
27 | GUILayout.Box(GUIContent.none, DaiGUIStyles.verticalSeparator);
28 | }
29 |
30 | public static void VerticalSeparator(float x, float y, float height)
31 | {
32 | var darkColor = ColorPalette.DarkLineColor.WithAlphaMultiplied(0.5f);
33 | var lightColor = ColorPalette.LightLineColor.WithAlphaMultiplied(0.5f);
34 | var rect = new Rect(x - 1, y, 1, height);
35 | EditorGUI.DrawRect(rect, darkColor);
36 | rect.x += 1;
37 | EditorGUI.DrawRect(rect, lightColor);
38 | }
39 |
40 | public static void CenterMiddleLabel(string text, GUIStyle style = null)
41 | {
42 | BeginCenterLayout();
43 | EditorGUILayout.LabelField(text, style);
44 | EndCenterLayout();
45 | }
46 |
47 | public static void BeginCenterLayout()
48 | {
49 | EditorGUILayout.BeginVertical();
50 | GUILayout.FlexibleSpace();
51 | EditorGUILayout.BeginHorizontal();
52 | GUILayout.FlexibleSpace();
53 | }
54 |
55 | public static void EndCenterLayout()
56 | {
57 | GUILayout.FlexibleSpace();
58 | EditorGUILayout.EndHorizontal();
59 | GUILayout.FlexibleSpace();
60 | EditorGUILayout.EndVertical();
61 | }
62 |
63 | public static bool IconButton(Rect rect, EditorTexture icon)
64 | {
65 | return IconButton(rect, icon, null, "");
66 | }
67 |
68 | public static bool IconButton(Rect rect, EditorTexture icon, string tooltip)
69 | {
70 | return IconButton(rect, icon, null, tooltip);
71 | }
72 |
73 | public static bool IconButton(Rect rect, EditorTexture icon, GUIStyle style, string tooltip)
74 | {
75 | style = style ?? DaiGUIStyles.iconButton;
76 | var tex = icon.Get(rect);
77 | return GUI.Button(rect, EditorGUIUtility.TrIconContent(tex, tooltip), style);
78 | }
79 | }
80 | }
--------------------------------------------------------------------------------
/Editor/Profiles/Import/AssetImportProfile.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.IO;
3 | using AssetPipeline.Filters;
4 | using UnityEditor;
5 | using UnityEngine;
6 |
7 | namespace AssetPipeline.Import
8 | {
9 | public class AssetImportProfile : ScriptableObject
10 | {
11 | public bool enabled;
12 | public NamingConventionRule path = new NamingConventionRule();
13 | public List pathExclusions = new List();
14 | public List assetFilters = new List();
15 |
16 | public static AssetImportProfile Create(string filename)
17 | {
18 | var path = GenerateUniqueAssetPath(filename);
19 | var instance = CreateInstance();
20 | AssetDatabase.CreateAsset(instance, path);
21 | instance.path.name = "assetPath";
22 | return instance;
23 | }
24 |
25 | static AssetImportProfile[] s_CachedProfiles;
26 | public static AssetImportProfile[] AllProfiles => s_CachedProfiles ?? (s_CachedProfiles = AssetDatabaseUtility.FindAndLoadAssets());
27 |
28 | public static void InvalidateCachedProfiles()
29 | {
30 | s_CachedProfiles = null;
31 | }
32 |
33 | public bool IsMatch(string assetPath, bool mustBeEnabled = true)
34 | {
35 | return (!mustBeEnabled || enabled) && path.IsMatch(assetPath) && !IsExcludedPath(assetPath);
36 | }
37 |
38 | bool IsExcludedPath(string assetPath)
39 | {
40 | foreach (var exclusion in pathExclusions)
41 | {
42 | if (exclusion.IsMatch(assetPath))
43 | {
44 | return true;
45 | }
46 | }
47 |
48 | return false;
49 | }
50 |
51 |
52 | static string GenerateUniqueAssetPath(string filename)
53 | {
54 | var path = AssetPipelineSettings.Settings.profileStoragePath;
55 | path = Path.Combine(path, filename).Replace(@"\", "/");
56 | if (Path.GetExtension(path) != ".asset")
57 | {
58 | path += ".asset";
59 | }
60 |
61 | var folderPath = Path.GetDirectoryName(path);
62 | PathUtility.CreateDirectoryIfNeeded(folderPath);
63 |
64 | path = AssetDatabase.GenerateUniqueAssetPath(path);
65 | return path;
66 | }
67 |
68 | internal static IList GetProfileMatches(string assetPath)
69 | {
70 | var result = new List();
71 | foreach (var profile in AllProfiles)
72 | {
73 | if (profile.IsMatch(assetPath))
74 | {
75 | result.Add(profile);
76 | }
77 | }
78 |
79 | return result;
80 | }
81 |
82 | public void RemoveNullFilters()
83 | {
84 | assetFilters.RemoveAll(x => x == null);
85 | }
86 | }
87 | }
--------------------------------------------------------------------------------
/Settings/AssetPipelineSettings.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: f780564f37454ff78ed14f6648c0379e, type: 3}
13 | m_Name: AssetPipelineSettings
14 | m_EditorClassIdentifier:
15 | m_AssetTypeFileExtensions:
16 | - m_AssetType: 0
17 | m_FileExtensions:
18 | - .ai
19 | - .apng
20 | - .png
21 | - .bmp
22 | - .cdr
23 | - .dib
24 | - .eps
25 | - .exif
26 | - .gif
27 | - .ico
28 | - .icon
29 | - .j
30 | - .j2c
31 | - .j2k
32 | - .jas
33 | - .jiff
34 | - .jng
35 | - .jp2
36 | - .jpc
37 | - .jpe
38 | - .jpeg
39 | - .jpf
40 | - .jpg
41 | - .jpw
42 | - .jpx
43 | - .jtf
44 | - .mac
45 | - .omf
46 | - .qif
47 | - .qti
48 | - .qtif
49 | - .tex
50 | - .tfw
51 | - .tga
52 | - .tif
53 | - .tiff
54 | - .wmf
55 | - .psd
56 | - .exr
57 | - .hdr
58 | - m_AssetType: 1
59 | m_FileExtensions:
60 | - .3df
61 | - .3dm
62 | - .3dmf
63 | - .3ds
64 | - .3dv
65 | - .3dx
66 | - .blend
67 | - .c4d
68 | - .lwo
69 | - .lws
70 | - .ma
71 | - .max
72 | - .mb
73 | - .mesh
74 | - .obj
75 | - .vrl
76 | - .wrl
77 | - .wrz
78 | - .fbx
79 | - m_AssetType: 2
80 | m_FileExtensions:
81 | - .aac
82 | - .aif
83 | - .aiff
84 | - .au
85 | - .mid
86 | - .midi
87 | - .mp3
88 | - .mpa
89 | - .ra
90 | - .ram
91 | - .wma
92 | - .wav
93 | - .wave
94 | - .ogg
95 | - .flac
96 | - m_AssetType: 3
97 | m_FileExtensions:
98 | - .dv
99 | - .mp4
100 | - .mpg
101 | - .mpeg
102 | - .m4v
103 | - .ogv
104 | - .vp8
105 | - .webm
106 | - .asf
107 | - .asx
108 | - .avi
109 | - .dat
110 | - .divx
111 | - .dvx
112 | - .mlv
113 | - .m2l
114 | - .m2t
115 | - .m2ts
116 | - .m2v
117 | - .m4e
118 | - .mjp
119 | - .mov
120 | - .movie
121 | - .mp21
122 | - .mpe
123 | - .mpv2
124 | - .ogm
125 | - .qt
126 | - .rm
127 | - .rmvb
128 | - .wmw
129 | - .xvid
130 | - m_AssetType: 4
131 | m_FileExtensions:
132 | - .ttf
133 | - .otf
134 | - .fon
135 | - .fnt
136 | - m_AssetType: 5
137 | m_FileExtensions:
138 | - .anim
139 | - m_AssetType: 6
140 | m_FileExtensions:
141 | - .mat
142 | - m_AssetType: 7
143 | m_FileExtensions:
144 | - .prefab
145 | - m_AssetType: 8
146 | m_FileExtensions:
147 | - .spriteatlas
148 | - .spriteatlasv2
149 | m_DefaultProfileStoragePath: Assets/Editor/AssetPipeline/Settings/
150 | m_EnabledColor: {r: 0.2688679, g: 1, b: 0.2688679, a: 1}
151 | m_DisabledColor: {r: 1, g: 0.2688679, b: 0.2688679, a: 1}
152 | m_DefaultConvention: 0
153 |
--------------------------------------------------------------------------------
/Editor/Assets/__importermodelsdummy__.obj.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 8045263587ad08944b470f853fde4bb2
3 | ModelImporter:
4 | serializedVersion: 21202
5 | internalIDToNameTable: []
6 | externalObjects: {}
7 | materials:
8 | materialImportMode: 0
9 | materialName: 0
10 | materialSearch: 1
11 | materialLocation: 1
12 | animations:
13 | legacyGenerateAnimations: 4
14 | bakeSimulation: 0
15 | resampleCurves: 1
16 | optimizeGameObjects: 0
17 | removeConstantScaleCurves: 0
18 | motionNodeName:
19 | rigImportErrors:
20 | rigImportWarnings:
21 | animationImportErrors:
22 | animationImportWarnings:
23 | animationRetargetingWarnings:
24 | animationDoRetargetingWarnings: 0
25 | importAnimatedCustomProperties: 0
26 | importConstraints: 0
27 | animationCompression: 1
28 | animationRotationError: 0.5
29 | animationPositionError: 0.5
30 | animationScaleError: 0.5
31 | animationWrapMode: 0
32 | extraExposedTransformPaths: []
33 | extraUserProperties: []
34 | clipAnimations: []
35 | isReadable: 0
36 | meshes:
37 | lODScreenPercentages: []
38 | globalScale: 1
39 | meshCompression: 0
40 | addColliders: 0
41 | useSRGBMaterialColor: 1
42 | sortHierarchyByName: 1
43 | importVisibility: 1
44 | importBlendShapes: 1
45 | importCameras: 1
46 | importLights: 1
47 | nodeNameCollisionStrategy: 0
48 | fileIdsGeneration: 2
49 | swapUVChannels: 0
50 | generateSecondaryUV: 0
51 | useFileUnits: 1
52 | keepQuads: 0
53 | weldVertices: 1
54 | bakeAxisConversion: 0
55 | preserveHierarchy: 0
56 | skinWeightsMode: 0
57 | maxBonesPerVertex: 4
58 | minBoneWeight: 0.001
59 | optimizeBones: 1
60 | meshOptimizationFlags: -1
61 | indexFormat: 0
62 | secondaryUVAngleDistortion: 8
63 | secondaryUVAreaDistortion: 15.000001
64 | secondaryUVHardAngle: 88
65 | secondaryUVMarginMethod: 1
66 | secondaryUVMinLightmapResolution: 40
67 | secondaryUVMinObjectScale: 1
68 | secondaryUVPackMargin: 4
69 | useFileScale: 1
70 | tangentSpace:
71 | normalSmoothAngle: 60
72 | normalImportMode: 0
73 | tangentImportMode: 3
74 | normalCalculationMode: 4
75 | legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
76 | blendShapeNormalImportMode: 1
77 | normalSmoothingSource: 0
78 | referencedClips: []
79 | importAnimation: 1
80 | humanDescription:
81 | serializedVersion: 3
82 | human: []
83 | skeleton: []
84 | armTwist: 0.5
85 | foreArmTwist: 0.5
86 | upperLegTwist: 0.5
87 | legTwist: 0.5
88 | armStretch: 0.05
89 | legStretch: 0.05
90 | feetSpacing: 0
91 | globalScale: 1
92 | rootMotionBoneName:
93 | hasTranslationDoF: 0
94 | hasExtraRoot: 0
95 | skeletonHasParents: 1
96 | lastHumanDescriptionAvatarSource: {instanceID: 0}
97 | autoGenerateAvatarMappingIfUnspecified: 1
98 | animationType: 2
99 | humanoidOversampling: 1
100 | avatarSetup: 0
101 | addHumanoidExtraRootOnlyWhenUsingAvatar: 0
102 | additionalBone: 0
103 | userData:
104 | assetBundleName:
105 | assetBundleVariant:
106 |
--------------------------------------------------------------------------------
/Editor/Interface/PropertyDrawers/NamingConventionRulePropertyDrawer.cs:
--------------------------------------------------------------------------------
1 | using AssetPipeline.NamingConvention;
2 | using UnityEditor;
3 | using UnityEngine;
4 |
5 | namespace AssetPipeline.PropertyDrawers
6 | {
7 | [CustomPropertyDrawer(typeof(NamingConventionRule))]
8 | public class NamingConventionRulePropertyDrawer : PropertyDrawer
9 | {
10 | const float kVerticalSpacer = 3;
11 |
12 | public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
13 | {
14 | return EditorGUIUtility.singleLineHeight + kVerticalSpacer;
15 | }
16 |
17 | public static class Styles
18 | {
19 | public static GUIContent anchor = new GUIContent("", "Where should the path match\nContains\tAnywhere in path\nStart\t\tStart of path\nEnd\t\tEnd of path\nExact\t\tExact match\nAll Paths\tAll paths will be a match");
20 |
21 | public static GUIContent pattern = new GUIContent("", @"Path pattern to match
22 | Variables can be specified by wrapping the variable name in {} braces
23 |
24 | Variable Examples
25 | -----------------
26 | ""Assets/Textures/Characters/{name}/"" matches ""Assets/Textures/Characters/Alice/"" with the value of {name} equaling ""Alice""
27 |
28 | ""{textureName}_albedo""
29 |
30 | ""{textureName}_{textureType:albedo|emission}"" matches where {textureType} is albedo or emission
31 |
32 | ""{assetName}_v{version:\d\{3\}}"" matches where {version} is a 3 digit number (e.g. 001)
33 |
34 |
35 | Variable String Convention
36 | -------------------------
37 | This optional variable parameter allows the option to match a specific casing convention.
38 |
39 | This will override the default string convention set in the project settings for the variable.
40 |
41 | {varName:\none} Any case
42 | {varName:\snake} snake_case
43 | {varName:\usnake} UPPER_SNAKE_CASE
44 | {varName:\kebab} kebab-case
45 | {varName:\camel} camelCase
46 | {varName:\pascal} PascalCase
47 | {varName:\upper} UPPER CASE
48 | {varName:\lower} lower case");
49 | }
50 |
51 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
52 | {
53 | EditorGUI.BeginProperty(position, label, property);
54 | position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label);
55 | position.height = EditorGUIUtility.singleLineHeight;
56 | var anchorRect = position;
57 | anchorRect.width = 70;
58 | var patternRect = position;
59 | patternRect.xMin += anchorRect.width + 3;
60 | var anchorProp = property.FindPropertyRelative("anchor");
61 | EditorGUI.PropertyField(anchorRect, anchorProp, GUIContent.none);
62 | EditorGUI.LabelField(anchorRect, Styles.anchor);
63 | if (anchorProp.enumValueIndex != (int) Anchor.AllPaths)
64 | {
65 | EditorGUI.PropertyField(patternRect, property.FindPropertyRelative("pattern"), GUIContent.none);
66 | EditorGUI.LabelField(patternRect, Styles.pattern);
67 | }
68 | else
69 | {
70 | EditorGUI.LabelField(patternRect, "This will match all files of this asset type");
71 | }
72 |
73 | property.serializedObject.ApplyModifiedProperties();
74 | EditorGUI.EndProperty();
75 | }
76 | }
77 | }
--------------------------------------------------------------------------------
/Editor/Dependencies/ReflectionMagic/PrivateReflectionUsingDynamicExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 |
4 | namespace AssetPipeline.ReflectionMagic
5 | {
6 | public static class PrivateReflectionUsingDynamicExtensions
7 | {
8 | ///
9 | /// Wraps the specified object in a dynamic object that allows access to private members.
10 | ///
11 | /// The object to wrap
12 | /// The wrapped object.
13 | ///
14 | /// Does not wrap null, , primitive types, and already wrapped objects.
15 | ///
16 | ///
17 | public static dynamic AsDynamic(this object o)
18 | {
19 | // Don't wrap primitive types, which don't have many interesting internal APIs
20 | if (o is null || o.GetType().GetTypeInfo().IsPrimitive || o is string || o is PrivateReflectionDynamicObjectBase)
21 | return o;
22 |
23 | return new PrivateReflectionDynamicObjectInstance(o);
24 | }
25 |
26 | ///
27 | /// Wraps the specified type in a dynamic object which allows easy instantion through the method.
28 | ///
29 | /// The type to wrap.
30 | /// The wrapped type.
31 | ///
32 | public static dynamic AsDynamicType(this Type type)
33 | {
34 | return new PrivateReflectionDynamicObjectStatic(type);
35 | }
36 |
37 | ///
38 | /// Gets the type with the specified name from the specified assembly instance, and returns it as a dynamic object. See also .
39 | ///
40 | /// The assembly instance to search for the type.
41 | /// The type name.
42 | /// The wrapped type.
43 | ///
44 | public static dynamic GetDynamicType(this Assembly assembly, string typeName)
45 | {
46 | if (assembly is null)
47 | throw new ArgumentNullException(nameof(assembly));
48 |
49 | return assembly.GetType(typeName).AsDynamicType();
50 | }
51 |
52 | ///
53 | /// Tries to instantiate the type with the specified type name from the specified assembly instance using the specified constructor arguments.
54 | ///
55 | /// The assembly instance to search.
56 | /// The full type name.
57 | /// The arguments to pass to the constructor.
58 | ///
59 | /// Thrown when no suitable constructor can be found.
60 | public static dynamic CreateDynamicInstance(this Assembly assembly, string typeName, params object[] args)
61 | {
62 | if (args is null)
63 | throw new ArgumentNullException(nameof(args));
64 |
65 | return assembly.GetDynamicType(typeName).New(args);
66 | }
67 | }
68 | }
--------------------------------------------------------------------------------
/Editor/Processors/AssetProcessorDescriptionAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using AssetPipeline.Import;
4 | using UnityEditor;
5 | using UnityEditorInternal;
6 | using UnityEngine;
7 |
8 | namespace AssetPipeline
9 | {
10 | [AttributeUsage(AttributeTargets.Class)]
11 | public class AssetProcessorDescriptionAttribute : Attribute
12 | {
13 | readonly string m_Name;
14 | readonly string m_Icon;
15 | readonly Type m_IconType;
16 | Texture m_CachedIcon;
17 | ImportAssetTypeFlag m_ValidAssetTypes;
18 |
19 | public AssetProcessorDescriptionAttribute(ImportAssetTypeFlag validAssetTypes = ImportAssetTypeFlag.All) : this("", iconType: null, validAssetTypes)
20 | {
21 | }
22 |
23 | public AssetProcessorDescriptionAttribute(Type iconType, ImportAssetTypeFlag validAssetTypes = ImportAssetTypeFlag.All) : this("", iconType, validAssetTypes)
24 | {
25 | }
26 |
27 | public AssetProcessorDescriptionAttribute(string icon, ImportAssetTypeFlag validAssetTypes = ImportAssetTypeFlag.All) : this("", icon, validAssetTypes)
28 | {
29 | }
30 |
31 | public AssetProcessorDescriptionAttribute(string name, Type iconType, ImportAssetTypeFlag validAssetTypes = ImportAssetTypeFlag.All)
32 | {
33 | m_Name = name;
34 | m_Icon = null;
35 | m_IconType = iconType;
36 | m_ValidAssetTypes = validAssetTypes;
37 | }
38 |
39 | public AssetProcessorDescriptionAttribute(string name, string icon, ImportAssetTypeFlag validAssetTypes = ImportAssetTypeFlag.All)
40 | {
41 | m_Name = name;
42 | m_Icon = icon;
43 | m_IconType = null;
44 | m_ValidAssetTypes = validAssetTypes;
45 | }
46 |
47 | public string Name => m_Name;
48 | public ImportAssetTypeFlag ValidAssetTypes => m_ValidAssetTypes;
49 |
50 | public Texture Icon
51 | {
52 | get
53 | {
54 | if (m_CachedIcon == null)
55 | {
56 | if (m_IconType != null)
57 | {
58 | m_CachedIcon = (Texture2D) UnityEditorDynamic.EditorGUIUtility.FindTextureByType(m_IconType);
59 | }
60 | else if (!string.IsNullOrEmpty(m_Icon))
61 | {
62 | m_CachedIcon = EditorGUIUtility.FindTexture(m_Icon);
63 | if (!m_CachedIcon && File.Exists(m_Icon))
64 | {
65 | m_CachedIcon = AssetDatabase.LoadAssetAtPath(m_Icon);
66 | }
67 |
68 | if (!m_CachedIcon)
69 | {
70 | m_CachedIcon = InternalEditorUtility.FindIconForFile(m_Icon);
71 | }
72 |
73 | if (!m_CachedIcon)
74 | {
75 | m_CachedIcon = EditorGUIUtility.IconContent(m_Icon).image;
76 | }
77 | }
78 |
79 | if (!m_CachedIcon)
80 | {
81 | m_CachedIcon = EditorGUIUtility.FindTexture("_Popup@2x");
82 | }
83 | }
84 |
85 | return m_CachedIcon;
86 | }
87 | }
88 | }
89 | }
--------------------------------------------------------------------------------
/Settings/UIRaw.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!114 &-5265369776087779653
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: 2833c50f97654ad2b8034ab06a4dee5a, type: 3}
13 | m_Name: Filter_Textures
14 | m_EditorClassIdentifier:
15 | enabled: 1
16 | showOptions: 1
17 | file:
18 | name: assetFilter
19 | pattern:
20 | anchor: 4
21 | assetType: 0
22 | otherAssetExtensions: []
23 | subPaths: []
24 | fileExclusions: []
25 | assetProcessors:
26 | - {fileID: 4315205504528667874}
27 | parent: {fileID: 11400000}
28 | --- !u!114 &11400000
29 | MonoBehaviour:
30 | m_ObjectHideFlags: 0
31 | m_CorrespondingSourceObject: {fileID: 0}
32 | m_PrefabInstance: {fileID: 0}
33 | m_PrefabAsset: {fileID: 0}
34 | m_GameObject: {fileID: 0}
35 | m_Enabled: 1
36 | m_EditorHideFlags: 0
37 | m_Script: {fileID: 11500000, guid: 4c962c1226e043caa066ec79a5193cc0, type: 3}
38 | m_Name: UIRaw
39 | m_EditorClassIdentifier:
40 | enabled: 1
41 | path:
42 | name: ui_raw
43 | pattern: Assets/AssetRaw/UIRaw/Raw
44 | anchor: 1
45 | pathExclusions: []
46 | assetFilters:
47 | - {fileID: -5265369776087779653}
48 | --- !u!114 &2251338471046930608
49 | MonoBehaviour:
50 | m_ObjectHideFlags: 0
51 | m_CorrespondingSourceObject: {fileID: 0}
52 | m_PrefabInstance: {fileID: 0}
53 | m_PrefabAsset: {fileID: 0}
54 | m_GameObject: {fileID: 0}
55 | m_Enabled: 1
56 | m_EditorHideFlags: 0
57 | m_Script: {fileID: 11500000, guid: 10761bfa18b64f668c3e1b9ddd3e5a8e, type: 3}
58 | m_Name: Textures_AddUIAtlas
59 | m_EditorClassIdentifier:
60 | parent: {fileID: -5265369776087779653}
61 | enabled: 0
62 | runOnImport: 0
63 | --- !u!114 &4315205504528667874
64 | MonoBehaviour:
65 | m_ObjectHideFlags: 0
66 | m_CorrespondingSourceObject: {fileID: 0}
67 | m_PrefabInstance: {fileID: 0}
68 | m_PrefabAsset: {fileID: 0}
69 | m_GameObject: {fileID: 0}
70 | m_Enabled: 1
71 | m_EditorHideFlags: 0
72 | m_Script: {fileID: 11500000, guid: 1fe6242d75f94bfcb454b3d50cba1494, type: 3}
73 | m_Name: Textures_SetTextureAllSettings
74 | m_EditorClassIdentifier:
75 | parent: {fileID: -5265369776087779653}
76 | enabled: 1
77 | runOnImport: 1
78 | fireOnEveryImport: 1
79 | config:
80 | isEnabled: 0
81 | textureType: 0
82 | textureShape: 1
83 | sRGBTexture: 1
84 | alphaSource: 1
85 | alphaIsTransparency: 0
86 | ignorePNGFileGamma: 0
87 | nonPowerOf2: 1
88 | readWriteEnabled: 0
89 | streamingMipmaps: 0
90 | vitrualTextureOnly: 0
91 | generateMipMaps: 0
92 | borderMipMaps: 0
93 | mipmapFilter: 0
94 | mipMapsPreserveCoverage: 0
95 | fadeoutMipMaps: 0
96 | wrapMode: 1
97 | filterMode: 1
98 | anisoLevel: 1
99 | platformConfigs:
100 | - platformName: 0
101 | maxSize: 2048
102 | format: 50
103 | compression: 1
104 | useCrunchCompression: 0
105 | - platformName: 1
106 | maxSize: 2048
107 | format: 50
108 | compression: 1
109 | useCrunchCompression: 0
110 | - platformName: 2
111 | maxSize: 2048
112 | format: 50
113 | compression: 1
114 | useCrunchCompression: 0
115 |
--------------------------------------------------------------------------------
/Editor/Interface/PropertyDrawers/StringTokenFilterPropertyDrawer.cs:
--------------------------------------------------------------------------------
1 | using System.Text.RegularExpressions;
2 | using AssetPipeline.Filters;
3 | using UnityEditor;
4 | using UnityEngine;
5 |
6 | namespace AssetPipeline.PropertyDrawers
7 | {
8 | [CustomPropertyDrawer(typeof(StringTokenFilter))]
9 | internal class StringTokenFilterPropertyDrawer : PropertyDrawer
10 | {
11 | const int kLineSpacing = 2;
12 | const string kImbalancedError = "\nImbalanced parentheses detected\n";
13 | static GUIStyle s_HelpboxStyle;
14 |
15 | public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
16 | {
17 | var height = EditorGUIUtility.singleLineHeight + kLineSpacing;
18 | height += CalculateHelpBoxHeight(GetTokenMessage(property));
19 | if (!IsValid(property))
20 | {
21 | height += CalculateHelpBoxHeight(kImbalancedError) + kLineSpacing;
22 | }
23 |
24 | return height;
25 | }
26 |
27 | static float CalculateHelpBoxHeight(string text)
28 | {
29 | if (s_HelpboxStyle == null)
30 | {
31 | s_HelpboxStyle = GUI.skin.GetStyle("helpbox");
32 | }
33 |
34 | return s_HelpboxStyle.CalcHeight(new GUIContent(text), EditorGUIUtility.currentViewWidth);
35 | }
36 |
37 | static string GetTokenMessage(SerializedProperty property)
38 | {
39 | var pattern = property.FindPropertyRelative("rulePattern").stringValue;
40 | var groupCount = new Regex(pattern).GetGroupNumbers().Length;
41 | var message = "The following tokens can be used:\n(assetName)\tAsset Filename\n(assetExt)\tAsset File Extension\n(.)\t\tAsset Folder Name\n(../)\t\tRelative Parent Folder Name";
42 | for (var i = 1; i < groupCount; i++)
43 | {
44 | message += $"\n(${i})\t\tWildcard {i}";
45 | }
46 |
47 | return message;
48 | }
49 |
50 | static bool IsValid(SerializedProperty property)
51 | {
52 | var str = property.FindPropertyRelative("name").stringValue;
53 | return str.Split('(').Length == str.Split(')').Length;
54 | }
55 |
56 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
57 | {
58 | var rawPosition = position;
59 | EditorGUI.BeginProperty(position, label, property);
60 | position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label);
61 |
62 | position.height = EditorGUIUtility.singleLineHeight;
63 | var rect = position;
64 | EditorGUI.PropertyField(rect, property.FindPropertyRelative("name"), GUIContent.none);
65 |
66 | rect = rawPosition;
67 | rect.y += kLineSpacing + EditorGUIUtility.singleLineHeight;
68 | if (!IsValid(property))
69 | {
70 | rect.height = CalculateHelpBoxHeight(kImbalancedError);
71 | EditorGUI.HelpBox(rect, kImbalancedError, MessageType.Error);
72 | rect.y += kLineSpacing + rect.height;
73 | }
74 |
75 | var message = GetTokenMessage(property);
76 | rect.height = CalculateHelpBoxHeight(message);
77 |
78 | EditorGUI.HelpBox(rect, message, MessageType.None);
79 | EditorGUI.EndProperty();
80 | }
81 | }
82 | }
--------------------------------------------------------------------------------
/Editor/Dependencies/ReflectionMagic/PrivateReflectionDynamicObjectStatic.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Concurrent;
3 | using System.Collections.Generic;
4 | using System.Diagnostics;
5 | using System.Reflection;
6 |
7 | namespace AssetPipeline.ReflectionMagic
8 | {
9 | public class PrivateReflectionDynamicObjectStatic : PrivateReflectionDynamicObjectBase
10 | {
11 | static readonly ConcurrentDictionary> s_PropertiesOnType = new ConcurrentDictionary>();
12 |
13 | ///
14 | /// Initializes a new instance of the class, wrapping the specified type.
15 | ///
16 | /// The type to wrap.
17 | /// Thrown when is null.
18 | public PrivateReflectionDynamicObjectStatic(Type type)
19 | {
20 | TargetType = type ?? throw new ArgumentNullException(nameof(type));
21 | }
22 |
23 | protected override IDictionary> PropertiesOnType => s_PropertiesOnType;
24 |
25 | // For static calls, we have the type and the instance is always null
26 | protected override Type TargetType { get; }
27 |
28 | protected override object Instance => null;
29 |
30 | ///
31 | /// The type that the wraps.
32 | ///
33 | public override object RealObject => TargetType;
34 |
35 | protected override BindingFlags BindingFlags => BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;
36 |
37 | public dynamic New(params object[] args)
38 | {
39 | if (args is null)
40 | throw new ArgumentNullException(nameof(args));
41 |
42 | Debug.Assert(TargetType != null);
43 |
44 | #if NETSTANDARD1_5
45 | var constructors = TargetType.GetTypeInfo().GetConstructors(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
46 |
47 | object result = null;
48 | for (int i = 0; i < constructors.Length; ++i)
49 | {
50 | var constructor = constructors[i];
51 | var parameters = constructor.GetParameters();
52 |
53 | if (parameters.Length == args.Length)
54 | {
55 | bool found = true;
56 | for (int j = 0; j < args.Length; ++j)
57 | {
58 | if (parameters[j].ParameterType != args[j].GetType())
59 | {
60 | found = false;
61 | break;
62 | }
63 | }
64 |
65 | if (found)
66 | {
67 | result = constructor.Invoke(args);
68 | break;
69 | }
70 | }
71 | }
72 |
73 | if (result is null)
74 | throw new MissingMethodException($"Constructor that accepts parameters: '{string.Join(", ", args.Select(x => x.GetType().ToString()))}' not found.");
75 |
76 | return result.AsDynamic();
77 | #else
78 | return Activator.CreateInstance(TargetType, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance, null, args, null).AsDynamic();
79 | #endif
80 | }
81 | }
82 | }
--------------------------------------------------------------------------------
/Editor/Processors/ExtractMaterials.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.IO;
3 | using System.Linq;
4 | using AssetPipeline.Import;
5 | using UnityEditor;
6 | using UnityEngine;
7 |
8 | namespace AssetPipeline.Processors
9 | {
10 | [AssetProcessorDescription(typeof(Material), ImportAssetTypeFlag.Models)]
11 | public class ExtractMaterials : AssetProcessor
12 | {
13 | [SerializeField] MaterialPathType pathType;
14 | [SerializeField] string destination;
15 | [SerializeField] DefaultAsset targetFolder;
16 | [SerializeField] FileExistsAction fileExistsAction;
17 |
18 | public override void OnPostprocess(Object asset, string assetPath)
19 | {
20 | var materialPaths = new HashSet();
21 | var materials = AssetDatabase.LoadAllAssetsAtPath(assetPath)
22 | .Where(x => x.GetType() == typeof(Material));
23 |
24 | var destinationPath = GetDestinationPath(assetPath);
25 | foreach (var material in materials)
26 | {
27 | var materialPath = Path.Combine(destinationPath, $"{material.name}.mat");
28 | if (File.Exists(materialPath))
29 | {
30 | if (fileExistsAction == FileExistsAction.Skip) { continue; }
31 | if (fileExistsAction == FileExistsAction.UniquePath)
32 | {
33 | materialPath = AssetDatabase.GenerateUniqueAssetPath(materialPath);
34 | }
35 | else
36 | {
37 | File.Delete(materialPath);
38 | }
39 | }
40 |
41 | var error = AssetDatabase.ExtractAsset(material, materialPath);
42 | if (string.IsNullOrEmpty(error))
43 | {
44 | materialPaths.Add(assetPath);
45 | }
46 | else
47 | {
48 | Debug.LogError($"[{GetName()}] Failed to extract material \"{material.name}\" from \"{assetPath}\": {error}");
49 | }
50 | }
51 |
52 | foreach (var path in materialPaths)
53 | {
54 | AssetDatabase.WriteImportSettingsIfDirty(path);
55 | AssetDatabase.ImportAsset(path, ImportAssetOptions.ForceUpdate);
56 | }
57 |
58 | if (materialPaths.Count > 0)
59 | {
60 | Debug.Log($"[{GetName()}] Materials extracted from {assetPath} to {destinationPath}");
61 | }
62 | ImportProfileUserData.AddOrUpdateProcessor(assetPath, this);
63 | }
64 |
65 | string GetDestinationPath(string assetPath)
66 | {
67 | var destinationPath = destination;
68 | if (pathType == MaterialPathType.Absolute || pathType == MaterialPathType.Relative)
69 | {
70 | destinationPath = ReplaceVariables(destinationPath, assetPath);
71 | }
72 |
73 | destinationPath = pathType.GetFolderPath(assetPath, destinationPath, targetFolder);
74 | if (pathType == MaterialPathType.TargetFolder && !targetFolder)
75 | {
76 | Debug.LogWarning($"[{GetName()}] Target Folder was not set. Extracting materials to {destinationPath}");
77 | }
78 |
79 | destinationPath = destinationPath.FixPathSeparators();
80 | PathUtility.CreateDirectoryIfNeeded(destinationPath);
81 |
82 | return destinationPath;
83 | }
84 | }
85 | }
--------------------------------------------------------------------------------
/Editor/Processors/CreatePrefab.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 | using AssetPipeline.Import;
3 | using UnityEditor;
4 | using UnityEngine;
5 | using UnityEngine.Rendering;
6 |
7 | namespace AssetPipeline.Processors
8 | {
9 | [AssetProcessorDescription(".prefab", ImportAssetTypeFlag.Models)]
10 | public class CreatePrefab : AssetProcessor
11 | {
12 | [SerializeField] TargetPathType prefabPathType = TargetPathType.SameAsAsset;
13 | [SerializeField] string prefabPath;
14 | [SerializeField] DefaultAsset targetFolder;
15 | [SerializeField] bool applyTag;
16 | [SerializeField] string tag = "Untagged";
17 | [SerializeField] bool applyLayer;
18 | [SerializeField] bool applyLayerRecursively = true;
19 | [SerializeField] LayerMask layer;
20 |
21 | [SerializeField] LightProbeUsage mrLightProbeUsage = LightProbeUsage.BlendProbes;
22 | [SerializeField] ReflectionProbeUsage mrReflectionProbeUsage = ReflectionProbeUsage.BlendProbes;
23 | [SerializeField] ShadowCastingMode mrShadowCastingMode = ShadowCastingMode.On;
24 | [SerializeField] bool mrAllowOcclusionWhenDynamic;
25 | [SerializeField] bool mrReceiveShadows = true;
26 | [SerializeField] bool mrContributeGlobalIllumination;
27 | [SerializeField] bool mrCreateAnchorOverride;
28 | [SerializeField] ReceiveGI mrReceivedGlobalIllumination = ReceiveGI.LightProbes;
29 | [SerializeField] MotionVectorGenerationMode mrMotionVectorGenerationMode = MotionVectorGenerationMode.ForceNoMotion;
30 |
31 | public override void OnPostprocess(Object asset, string assetPath)
32 | {
33 | var targetPath = prefabPathType.GetFolderPath(assetPath, prefabPath, targetFolder);
34 | targetPath = Path.Combine(targetPath, $"{Path.GetFileNameWithoutExtension(assetPath)}.prefab");
35 |
36 | var prefabInstance = Instantiate(asset) as GameObject;
37 |
38 | if (applyTag)
39 | {
40 | prefabInstance.tag = tag;
41 | }
42 |
43 | if (applyLayer)
44 | {
45 | prefabInstance.SetLayer(layer, applyLayerRecursively);
46 | }
47 |
48 | var renderers = prefabInstance.GetComponentsInChildren();
49 | foreach (var renderer in renderers)
50 | {
51 | renderer.lightProbeUsage = mrLightProbeUsage;
52 | renderer.reflectionProbeUsage = mrReflectionProbeUsage;
53 | renderer.shadowCastingMode = mrShadowCastingMode;
54 | renderer.allowOcclusionWhenDynamic = mrAllowOcclusionWhenDynamic;
55 | renderer.receiveShadows = mrReceiveShadows;
56 | renderer.receiveGI = mrReceivedGlobalIllumination;
57 | renderer.motionVectorGenerationMode = mrMotionVectorGenerationMode;
58 | if (mrContributeGlobalIllumination)
59 | {
60 | GameObjectUtility.SetStaticEditorFlags(renderer.gameObject, StaticEditorFlags.ContributeGI);
61 | }
62 |
63 | if (mrCreateAnchorOverride)
64 | {
65 | var anchor = new GameObject($"{renderer.name}-LightProbeAnchor");
66 | anchor.transform.SetParent(renderer.transform);
67 | renderer.probeAnchor = anchor.transform;
68 | }
69 | }
70 |
71 | PrefabUtility.SaveAsPrefabAsset(prefabInstance, targetPath);
72 | DestroyImmediate(prefabInstance);
73 | ImportProfileUserData.AddOrUpdateProcessor(assetPath, this);
74 | Debug.Log($"[{GetName()}] Prefab created for {assetPath}");
75 | }
76 | }
77 | }
--------------------------------------------------------------------------------
/Editor/Interface/Colors/ColorPalette.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 |
3 | namespace AssetPipeline
4 | {
5 | internal static class ColorPalette
6 | {
7 | public static readonly SkinnedColor BackgroundDarker = new SkinnedColor(0.33f, 0.1f);
8 | public static readonly SkinnedColor BackgroundDark = new SkinnedColor(0.64f, 0.16f);
9 | public static readonly SkinnedColor Background = new SkinnedColor(0.76f, 0.22f);
10 | public static readonly SkinnedColor BackgroundLight = new SkinnedColor(0.87f, 0.24f);
11 | public static readonly SkinnedColor BackgroundLighter = new SkinnedColor(0.957f, 0.264f);
12 | public static readonly SkinnedColor Foreground = new SkinnedColor(0.0f, 0.81f);
13 | public static readonly SkinnedColor ForegroundDim = Foreground.WithAlphaMultiplied(0.40f, 0.40f);
14 | public static readonly SkinnedColor ForegroundDimer = Foreground.WithAlphaMultiplied(0.20f, 0.20f);
15 | public static readonly SkinnedColor ForegroundSelected = new SkinnedColor(1.0f, 1.0f);
16 | public static readonly SkinnedColor SelectionHighlight = new SkinnedColor(new Color(0.24f, 0.49f, 0.91f), new Color(0.20f, 0.38f, 0.57f));
17 |
18 | public static readonly SkinnedColor CardBackgroundColor = new SkinnedColor(1, 0.45f, 1, 0.25f);
19 | public static readonly SkinnedColor BorderColor = new SkinnedColor(0.38f, 0.6f, 0.11f, 0.8f);
20 | public static readonly SkinnedColor BoxBackgroundColor = new SkinnedColor(1, 0.5f, 1, 0.05f);
21 | public static readonly SkinnedColor DarkEditorBackground = new SkinnedColor(0, 0, 0.192f, 1);
22 | public static readonly SkinnedColor EditorWindowBackgroundColor = new SkinnedColor(0.76f, 0.22f);
23 | public static readonly SkinnedColor MenuBackgroundColor = new SkinnedColor(0.87f, 1, 1, 0.035f);
24 | public static readonly SkinnedColor HeaderBoxBackgroundColor = new SkinnedColor(1, 0.26f, 1, 0.06f);
25 | public static readonly SkinnedColor HighlightedButtonColor = new SkinnedColor(Color.green);
26 | public static readonly SkinnedColor HighlightedTextColor = new SkinnedColor(Color.black, Color.white);
27 | public static readonly SkinnedColor HighlightPropertyColor = new SkinnedColor(0, 0.6f, 1, 0.6f);
28 | public static readonly SkinnedColor ListItemColorEven = new SkinnedColor(0.838f, 0.235f);
29 | public static readonly SkinnedColor ListItemColorHoverEven = new SkinnedColor(0.89f, 0.2232f);
30 | public static readonly SkinnedColor ListItemColorHoverOdd = new SkinnedColor(0.904f, 0.2472f);
31 | public static readonly SkinnedColor ListItemColorOdd = new SkinnedColor(0.788f, 0.216f);
32 | public static readonly SkinnedColor ListItemDragBg = new SkinnedColor(0.1f);
33 | public static readonly SkinnedColor ListItemDragBgColor = new SkinnedColor(0.338f, 0.1f);
34 | public static readonly SkinnedColor ColumnTitleBg = new SkinnedColor(1, 0.019f, 1, 0.019f);
35 | public static readonly SkinnedColor ListItemEven = new SkinnedColor(0.4f);
36 | public static readonly SkinnedColor ListItemOdd = new SkinnedColor(0.4f);
37 | public static readonly SkinnedColor MenuButtonActiveBgColor = new SkinnedColor(new Color(0.243f, 0.49f, 0.9f, 1.000f), new Color(0.243f, 0.373f, 0.588f, 1.000f));
38 | public static readonly SkinnedColor MenuButtonBorderColor = new SkinnedColor(0.608f);
39 | public static readonly SkinnedColor MenuButtonColor = Color.clear;
40 | public static readonly SkinnedColor MenuButtonHoverColor = new SkinnedColor(1, 0.08f, 1, 0.08f);
41 | public static readonly SkinnedColor LightBorderColor = new SkinnedColor(0.3529412f);
42 | public static readonly SkinnedColor DarkLineColor = new SkinnedColor(new Color(0, 0, 0, 0.2f), BorderColor);
43 | public static readonly SkinnedColor LightLineColor = new SkinnedColor(Color.white, new Color(1, 1, 1, 0.103f));
44 | }
45 | }
--------------------------------------------------------------------------------
/Editor/Processors/Inspectors/PackTexture2DInspector.cs:
--------------------------------------------------------------------------------
1 | using AssetPipeline.Import;
2 | using UnityEditor;
3 | using UnityEngine;
4 |
5 | namespace AssetPipeline.Processors
6 | {
7 | [CustomEditor(typeof(PackTexture2D))]
8 | internal class PackTexture2DInspector : AssetProcessorInspector
9 | {
10 | SerializedProperty m_TextureName;
11 | SerializedProperty m_TextureSize;
12 | SerializedProperty m_IsLinear;
13 | SerializedProperty m_RedChannel;
14 | SerializedProperty m_RedChannelTextureFilter;
15 | SerializedProperty m_GreenChannel;
16 | SerializedProperty m_GreenChannelTextureFilter;
17 | SerializedProperty m_BlueChannel;
18 | SerializedProperty m_BlueChannelTextureFilter;
19 | SerializedProperty m_AlphaChannel;
20 | SerializedProperty m_AlphaChannelTextureFilter;
21 |
22 | protected override void OnEnable()
23 | {
24 | m_TextureName = serializedObject.FindProperty("textureName");
25 | m_TextureSize = serializedObject.FindProperty("textureSize");
26 | m_IsLinear = serializedObject.FindProperty("isLinear");
27 | m_RedChannel = serializedObject.FindProperty("redChannel");
28 | m_RedChannelTextureFilter = serializedObject.FindProperty("redChannelTextureFilter");
29 | m_GreenChannel = serializedObject.FindProperty("greenChannel");
30 | m_GreenChannelTextureFilter = serializedObject.FindProperty("greenChannelTextureFilter");
31 | m_BlueChannel = serializedObject.FindProperty("blueChannel");
32 | m_BlueChannelTextureFilter = serializedObject.FindProperty("blueChannelTextureFilter");
33 | m_AlphaChannel = serializedObject.FindProperty("alphaChannel");
34 | m_AlphaChannelTextureFilter = serializedObject.FindProperty("alphaChannelTextureFilter");
35 | base.OnEnable();
36 | }
37 |
38 | public override void OnInspectorGUI()
39 | {
40 | serializedObject.Update();
41 | DrawBaseProperties();
42 | EditorGUILayout.PropertyField(m_TextureName, DaiGUIContent.packedTextureName);
43 | DrawTemplateVariables();
44 | EditorGUILayout.Space();
45 | EditorGUILayout.PropertyField(m_TextureSize);
46 | EditorGUILayout.PropertyField(m_IsLinear);
47 | EditorGUILayout.Space();
48 |
49 | EditorGUILayout.LabelField("Channels", DaiGUIStyles.boldLabel);
50 | EditorGUILayout.BeginHorizontal();
51 | EditorGUILayout.PropertyField(m_RedChannel, GUIContent.none, GUILayout.Width(20));
52 | EditorGUILayout.LabelField("Red", GUILayout.Width(40));
53 | EditorGUILayout.PropertyField(m_RedChannelTextureFilter, GUIContent.none);
54 | EditorGUILayout.EndHorizontal();
55 |
56 | EditorGUILayout.BeginHorizontal();
57 | EditorGUILayout.PropertyField(m_GreenChannel, GUIContent.none, GUILayout.Width(20));
58 | EditorGUILayout.LabelField("Green", GUILayout.Width(40));
59 | EditorGUILayout.PropertyField(m_GreenChannelTextureFilter, GUIContent.none);
60 | EditorGUILayout.EndHorizontal();
61 |
62 | EditorGUILayout.BeginHorizontal();
63 | EditorGUILayout.PropertyField(m_BlueChannel, GUIContent.none, GUILayout.Width(20));
64 | EditorGUILayout.LabelField("Blue", GUILayout.Width(40));
65 | EditorGUILayout.PropertyField(m_BlueChannelTextureFilter, GUIContent.none);
66 | EditorGUILayout.EndHorizontal();
67 |
68 | EditorGUILayout.BeginHorizontal();
69 | EditorGUILayout.PropertyField(m_AlphaChannel, GUIContent.none, GUILayout.Width(20));
70 | EditorGUILayout.LabelField("Alpha", GUILayout.Width(40));
71 | EditorGUILayout.PropertyField(m_AlphaChannelTextureFilter, GUIContent.none);
72 | EditorGUILayout.EndHorizontal();
73 |
74 | serializedObject.ApplyModifiedProperties();
75 | }
76 | }
77 | }
--------------------------------------------------------------------------------
/Editor/Interface/EditorTexture/EditorTexture.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using UnityEditor;
3 | using UnityEngine;
4 |
5 | namespace AssetPipeline
6 | {
7 | internal class EditorTexture
8 | {
9 | Material iconMat;
10 |
11 | SkinnedColor inactiveColor = new SkinnedColor(0.72f, 0.4f);
12 | SkinnedColor highlightedColor = new SkinnedColor(0.9f, 0.2f);
13 | SkinnedColor activeColor = new SkinnedColor(0.4f, 0.55f);
14 |
15 | GUIContent inactiveGUIContent;
16 | GUIContent highlightedGUIContent;
17 | GUIContent activeGUIContent;
18 |
19 | Texture2D icon;
20 | Texture inactive;
21 | Texture active;
22 | Texture highlighted;
23 | string data;
24 | int width;
25 | int height;
26 |
27 | public EditorTexture(int width, int height, string base64ImageData)
28 | {
29 | this.width = width;
30 | this.height = height;
31 | data = base64ImageData;
32 | }
33 |
34 | public Texture Highlighted
35 | {
36 | get
37 | {
38 | if (!highlighted)
39 | {
40 | highlighted = RenderIcon(highlightedColor);
41 | }
42 |
43 | return highlighted;
44 | }
45 | }
46 |
47 | public Texture Active
48 | {
49 | get
50 | {
51 | if (!active)
52 | {
53 | active = RenderIcon(activeColor);
54 | }
55 |
56 | return active;
57 | }
58 | }
59 |
60 | public Texture Inactive
61 | {
62 | get
63 | {
64 | if (!inactive)
65 | {
66 | inactive = RenderIcon(inactiveColor);
67 | }
68 |
69 | return inactive;
70 | }
71 | }
72 |
73 | public Texture2D Raw
74 | {
75 | get
76 | {
77 | if (!icon)
78 | {
79 | var bytes = Convert.FromBase64String(data);
80 | icon = TextureUtility.LoadImage(width, height, bytes);
81 | }
82 |
83 | return icon;
84 | }
85 | }
86 |
87 | public Texture Get(Rect rect)
88 | {
89 | if (!GUI.enabled)
90 | {
91 | return Inactive;
92 | }
93 |
94 | if (rect.Contains(Event.current.mousePosition))
95 | {
96 | return Highlighted;
97 | }
98 |
99 | return Active;
100 | }
101 |
102 | Texture RenderIcon(Color color)
103 | {
104 | if (!iconMat || !iconMat.shader)
105 | {
106 | var shader = Shader.Find("Hidden/AssetPipeline/Editor/GUIIcon");
107 | iconMat = new Material(shader);
108 | }
109 |
110 | iconMat.SetColor("_Color", color);
111 | var prevSRGB = GL.sRGBWrite;
112 | GL.sRGBWrite = true;
113 | var prev = RenderTexture.active;
114 | var rt = RenderTexture.GetTemporary(width, height, 0);
115 | RenderTexture.active = rt;
116 | GL.Clear(false, true, new Color(1, 1, 1, 0));
117 | Graphics.Blit(Raw, rt, iconMat);
118 |
119 | var texture = new Texture2D(rt.width, rt.height, TextureFormat.ARGB32, false, true);
120 | texture.filterMode = FilterMode.Bilinear;
121 | texture.ReadPixels(new Rect(0, 0, rt.width, rt.height), 0, 0);
122 | texture.alphaIsTransparency = true;
123 | texture.Apply();
124 |
125 | RenderTexture.ReleaseTemporary(rt);
126 | RenderTexture.active = prev;
127 | GL.sRGBWrite = prevSRGB;
128 | return texture;
129 | }
130 | }
131 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Unity 资产处理管线
2 |
3 | - [README 中文](./README.md)
4 | - [README English](./README_EN.md)
5 |
6 | 该工具是Unity中基于规则的资产后处理器解决方案,旨在开发可重复使用的处理器,这些处理器可以在资产导入时自动应用。
7 |
8 | ## 资产导入配置文件
9 |
10 | 资产导入配置文件是继承自 `ScriptableObject` 的配置文件,用于存储基于路径规则的资产导入策略。这些规则包含:
11 | - 基础文件夹路径
12 | - 要处理的资产类型
13 | - 匹配资产后需要执行的处理器列表
14 |
15 | ### 支持资产类型
16 |
17 | 支持纹理、模型、音频、视频、字体、动画、材质、预制件、Sprite图集等多种类型。_其他_ 类型可用于匹配指定文件扩展名集合外的任意资产。
18 |
19 | ## 路径变量系统
20 |
21 | 在资产导入配置文件的路径定义和文件过滤器中,可以使用动态变量(使用 `{}` 包裹变量名)。例如路径 `Assets/3DGamekit/Art/Textures/Characters/{characterName}/` 将自动捕获文件夹名作为 `characterName` 变量值,该变量可在设置资源包名、标签等处理器中使用。
22 |
23 | 变量支持强制命名规范校验(通过后缀指定):
24 |
25 | | 命名规范 | 变量后缀 | 示例 |
26 | | :------------: | :---------: | :----------------: |
27 | | 无规范 | `:\none` | The quick brown fox |
28 | | 蛇形命名法 | `:\snake` | the_quick_brown_fox |
29 | | 大蛇形命名法 | `:\usnake` | THE_QUICK_BROWN_FOX |
30 | | 帕斯卡命名法 | `:\pascal` | TheQuickBrownFox |
31 | | 驼峰命名法 | `:\camel` | theQuickBrownFox |
32 | | 短横线命名法 | `:\kebab` | the-quick-brown-fox |
33 | | 全大写 | `:\upper` | THE QUICK BROWN FOX |
34 | | 全小写 | `:\lower` | the quick brown fox |
35 |
36 | 后缀也支持正则表达式校验(例如 `:\d+` 强制数字格式)。在处理器中使用变量时,可通过后缀转换变量值的格式。
37 |
38 | ## 资产处理器
39 |
40 | 资产处理器是在资产导入时自动执行的模块化功能单元,当前包含以下核心处理器:
41 |
42 | | 处理器 | 适用类型 | 功能描述 |
43 | | :--------------: | :----------: | :---------------------------------------------------------------------: |
44 | | 应用预设 | 纹理/模型/音频等 | 应用预定义的导入设置 |
45 | | 设置资源包 | 全部 | 指定AssetBundle名称和变体 |
46 | | 设置资源标签 | 全部 | 添加资源标签 |
47 | | 添加到Sprite图集 | 纹理 | 自动创建/更新Sprite图集 |
48 | | 纹理通道打包 | 纹理 | 将纹理打包到其他纹理的指定通道 |
49 | | 材质提取 | 模型 | 从模型自动提取材质 |
50 | | 材质配置 | 模型 | 自动配置材质属性并关联纹理 |
51 | | 网格数据精简 | 模型 | 移除顶点颜色、冗余UV通道等非必要数据 |
52 | | 变换重置 | 模型 | 重置模型的坐标/旋转/缩放 |
53 | | 预制件生成 | 模型 | 自动生成预制件并配置渲染参数 |
54 |
55 | ### .meta文件用户数据
56 |
57 | 多数处理器会在.meta文件中记录处理状态,防止重复处理。
58 |
59 | ### 自定义处理器
60 |
61 | 可通过继承 `AssetProcessor` 类创建自定义处理器,示例:
62 |
63 | ```csharp
64 | // 资产标签设置处理器示例
65 | using System.Linq;
66 | using Daihenka.AssetPipeline.Import;
67 | using UnityEditor;
68 | using UnityEngine;
69 |
70 | [AssetProcessorDescription("FilterByLabel@2x")]
71 | public class SetAssetLabels : AssetProcessor
72 | {
73 | [SerializeField] string[] Labels;
74 |
75 | public override void OnPostprocess(Object asset, string assetPath)
76 | {
77 | var assetLabels = AssetDatabase.GetLabels(asset).ToHashSet();
78 | assetLabels.AddRange(Labels);
79 | AssetDatabase.SetLabels(asset, assetLabels.ToArray());
80 |
81 | ImportProfileUserData.AddOrUpdateProcessor(assetPath, this);
82 | }
83 | }
84 | ```
85 |
86 | ## 使用指南
87 |
88 | 通过菜单项 `Tools > Asset Pipeline > Import Profiles` 打开配置界面:
89 |
90 | 
91 |
92 | 
93 |
94 | 在此界面中:
95 | 1. 点击 `Create New`(新建)按钮创建导入配置文件
96 | 2. 双击配置文件条目即可打开编辑器进行配置
97 |
98 | 
99 |
100 | 配置项说明:
101 | - 基础路径设置:指定资产扫描的根目录
102 | - 资产过滤器:配置类型匹配规则与路径变量
103 | - 处理器列表:添加/管理要执行的自动化处理流程
104 |
105 |
--------------------------------------------------------------------------------
/Editor/Processors/Inspectors/AddToSpriteAtlasInspector.cs:
--------------------------------------------------------------------------------
1 | using AssetPipeline.Import;
2 | using UnityEditor;
3 | using UnityEngine;
4 |
5 | namespace AssetPipeline.Processors
6 | {
7 | [CustomEditor(typeof(AddToSpriteAtlas))]
8 | internal class AddToSpriteAtlasInspector : AssetProcessorInspector
9 | {
10 | SerializedProperty m_AddFolderToSpriteAtlas;
11 | SerializedProperty m_PathType;
12 | SerializedProperty m_Destination;
13 | SerializedProperty m_TargetFolder;
14 | SerializedProperty m_SpriteAtlasName;
15 | SerializedProperty m_IncludeInBuild;
16 | SerializedProperty m_CreateVariantAtlas;
17 | SerializedProperty m_VariantSuffix;
18 | SerializedProperty m_IncludeVariantInBuild;
19 | SerializedProperty m_VariantScale;
20 |
21 | protected override void OnEnable()
22 | {
23 | m_AddFolderToSpriteAtlas = serializedObject.FindProperty("addFolderToSpriteAtlas");
24 | m_PathType = serializedObject.FindProperty("pathType");
25 | m_Destination = serializedObject.FindProperty("destination");
26 | m_TargetFolder = serializedObject.FindProperty("targetFolder");
27 | m_SpriteAtlasName = serializedObject.FindProperty("spriteAtlasName");
28 | m_IncludeInBuild = serializedObject.FindProperty("includeInBuild");
29 | m_CreateVariantAtlas = serializedObject.FindProperty("createVariantAtlas");
30 | m_VariantSuffix = serializedObject.FindProperty("variantSuffix");
31 | m_IncludeVariantInBuild = serializedObject.FindProperty("includeVariantInBuild");
32 | m_VariantScale = serializedObject.FindProperty("variantScale");
33 | base.OnEnable();
34 | }
35 |
36 | public override void OnInspectorGUI()
37 | {
38 | serializedObject.Update();
39 |
40 | DrawBaseProperties();
41 | EditorGUILayout.PropertyField(m_AddFolderToSpriteAtlas);
42 |
43 | EditorGUILayout.Space();
44 | EditorGUILayout.LabelField("SpriteAtlas Creation Settings (If SpriteAtlas Missing)", DaiGUIStyles.boldLabel);
45 |
46 | EditorGUILayout.Space();
47 | EditorGUILayout.PropertyField(m_PathType);
48 | var enumValueIndex = m_PathType.enumValueIndex;
49 | if (enumValueIndex == (int) TargetPathType.Relative || enumValueIndex == (int) TargetPathType.Absolute)
50 | {
51 | EditorGUILayout.PropertyField(m_Destination);
52 | DrawTemplateVariables();
53 | }
54 | else if (enumValueIndex == (int) TargetPathType.TargetFolder)
55 | {
56 | EditorGUILayout.PropertyField(m_TargetFolder, DaiGUIContent.destination);
57 | }
58 |
59 | EditorGUILayout.Space();
60 | EditorGUILayout.LabelField("Master SpriteAtlas", DaiGUIStyles.boldLabel);
61 | EditorGUILayout.PropertyField(m_SpriteAtlasName);
62 | DrawTemplateVariables();
63 | EditorGUILayout.Space();
64 | EditorGUILayout.PropertyField(m_IncludeInBuild);
65 |
66 | EditorGUILayout.Space();
67 | EditorGUILayout.LabelField("Variant SpriteAtlas", DaiGUIStyles.boldLabel);
68 | EditorGUILayout.PropertyField(m_CreateVariantAtlas);
69 | if (m_CreateVariantAtlas.boolValue)
70 | {
71 | EditorGUILayout.PropertyField(m_VariantSuffix);
72 | EditorGUILayout.PropertyField(m_IncludeVariantInBuild);
73 | EditorGUILayout.Slider(m_VariantScale, 0.01f, 1f);
74 | // Test if the multiplier scale a power of two size (1024) into another power of 2 size.
75 | if (!Mathf.IsPowerOfTwo((int) (m_VariantScale.floatValue * 1024)))
76 | {
77 | EditorGUILayout.HelpBox(DaiGUIContent.notPowerOfTwoWarning.text, MessageType.Warning, true);
78 | }
79 | }
80 |
81 | serializedObject.ApplyModifiedProperties();
82 | }
83 | }
84 | }
--------------------------------------------------------------------------------
/Editor/Utility/EditorWindowUtility.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using AssetPipeline.ReflectionMagic;
5 | using UnityEditor;
6 | using UnityEngine;
7 | using UnityResources = UnityEngine.Resources;
8 |
9 | namespace AssetPipeline
10 | {
11 | internal static class EditorWindowUtility
12 | {
13 | static readonly Type ContainerWindowType;
14 | static readonly Type DockAreaType;
15 |
16 | static EditorWindowUtility()
17 | {
18 | ContainerWindowType = UnityEditorDynamic.UnityEditorAssembly.GetType("UnityEditor.ContainerWindow", true);
19 | DockAreaType = UnityEditorDynamic.UnityEditorAssembly.GetType("UnityEditor.DockArea", true);
20 | }
21 |
22 | public static bool KeyPressed(this T s, string controlName, KeyCode key, out T fieldValue)
23 | {
24 | fieldValue = s;
25 | return GUI.GetNameOfFocusedControl() == controlName && (Event.current.type == EventType.KeyUp && Event.current.keyCode == key);
26 | }
27 |
28 | public static EditorWindow[] GetAllEditorWindows()
29 | {
30 | var editorWindows = new List();
31 | var containerWindows = ContainerWindowType.AsDynamicType().windows;
32 | foreach (var containerWindow in containerWindows)
33 | {
34 | var dynamicContainerWindow = ((object) containerWindow).AsDynamic();
35 | foreach (var view in dynamicContainerWindow.rootView.allChildren)
36 | {
37 | var dynamicView = ((object) view).AsDynamic();
38 | if (!DockAreaType.IsInstanceOfTypeNullable((object) view))
39 | {
40 | continue;
41 | }
42 |
43 | foreach (var pane in dynamicView.m_Panes)
44 | {
45 | var win = (EditorWindow) pane;
46 | if (win)
47 | {
48 | editorWindows.Add(win);
49 | }
50 | }
51 | }
52 | }
53 |
54 | return editorWindows.ToArray();
55 | }
56 |
57 | public static T[] GetWindows() where T : EditorWindow
58 | {
59 | return GetAllEditorWindows().Where(x => x is T).Cast().ToArray();
60 | }
61 |
62 |
63 | public static bool TryDockNextTo(this EditorWindow window, params Type[] windowTypes)
64 | {
65 | var containerWindows = ContainerWindowType.AsDynamicType().windows;
66 | foreach (var type in windowTypes)
67 | {
68 | foreach (var containerWindow in containerWindows)
69 | {
70 | var dynamicContainerWindow = ((object) containerWindow).AsDynamic();
71 | foreach (var view in dynamicContainerWindow.rootView.allChildren)
72 | {
73 | var dynamicView = ((object) view).AsDynamic();
74 | if (!DockAreaType.IsInstanceOfTypeNullable((object) view))
75 | {
76 | continue;
77 | }
78 |
79 | foreach (var pane in dynamicView.m_Panes)
80 | {
81 | if (pane.GetType() == type)
82 | {
83 | dynamicView.AddTab(window, true);
84 | return true;
85 | }
86 | }
87 | }
88 | }
89 | }
90 |
91 | return false;
92 | }
93 |
94 | public static bool IsNullable(this Type type)
95 | {
96 | // http://stackoverflow.com/a/1770232
97 | return type.IsReferenceType() || Nullable.GetUnderlyingType(type) != null;
98 | }
99 |
100 | public static bool IsReferenceType(this Type type)
101 | {
102 | return !type.IsValueType;
103 | }
104 |
105 | public static bool IsInstanceOfTypeNullable(this Type type, object value)
106 | {
107 | return value == null ? type.IsNullable() : type.IsInstanceOfType(value);
108 | }
109 | }
110 | }
--------------------------------------------------------------------------------
/Editor/Windows/AssetSearchWindow.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using UnityEditor;
3 | using UnityEditor.IMGUI.Controls;
4 | using UnityEngine;
5 |
6 | namespace AssetPipeline
7 | {
8 | internal class AssetSearchWindow : EditorWindow
9 | {
10 | [MenuItem("Tools/资产管理工具(Asset Pipeline)/Asset Search", false, 99)]
11 | static void ShowWindow()
12 | {
13 | GetWindow("Asset Search", typeof(ImportProfilesWindow)).Show();
14 | }
15 |
16 | [NonSerialized] bool m_Initialized;
17 | [SerializeField] TreeViewState m_TreeViewState;
18 | [SerializeField] MultiColumnHeaderState m_ColumnHeaderState;
19 | AssetSearchTableView m_TreeView;
20 | SearchField m_SearchField;
21 |
22 | void InitIfNeeded()
23 | {
24 | if (m_Initialized)
25 | {
26 | return;
27 | }
28 |
29 | if (m_TreeViewState == null)
30 | {
31 | m_TreeViewState = new TreeViewState();
32 | }
33 |
34 | var firstInit = m_ColumnHeaderState == null;
35 | var headerState = AssetSearchTableView.CreateDefaultMultiColumnHeaderState();
36 | if (MultiColumnHeaderState.CanOverwriteSerializedFields(m_ColumnHeaderState, headerState))
37 | {
38 | MultiColumnHeaderState.OverwriteSerializedFields(m_ColumnHeaderState, headerState);
39 | }
40 |
41 | m_ColumnHeaderState = headerState;
42 | var multiColumnHeader = new MultiColumnHeader(headerState);
43 | if (firstInit)
44 | {
45 | multiColumnHeader.ResizeToFit();
46 | }
47 |
48 | m_TreeView = new AssetSearchTableView(m_TreeViewState, multiColumnHeader);
49 | m_TreeView.Reload();
50 | m_SearchField = new SearchField();
51 | m_SearchField.downOrUpArrowKeyPressed += m_TreeView.SetFocusAndEnsureSelectedItem;
52 | m_Initialized = true;
53 | }
54 |
55 | void OnGUI()
56 | {
57 | InitIfNeeded();
58 | DrawToolbar();
59 | DrawContent();
60 | }
61 |
62 | void DrawToolbar()
63 | {
64 | EditorGUILayout.BeginHorizontal(DaiGUIStyles.toolbar);
65 | var treeViewMode = GUILayout.Toggle(!m_TreeView.FlatView, EditorGUIUtility.TrIconContent("UnityEditor.SceneHierarchyWindow", "Tree View"), DaiGUIStyles.toolbarButton);
66 | if (treeViewMode == m_TreeView.FlatView)
67 | {
68 | m_TreeView.FlatView = !treeViewMode;
69 | m_TreeView.Reload();
70 | }
71 |
72 | if (GUILayout.Button("All Assets", DaiGUIStyles.toolbarButton))
73 | {
74 | m_TreeView.assetsFilter = AssetSearchTableView.Filter.All;
75 | m_TreeView.Reload();
76 | }
77 |
78 | if (GUILayout.Button("With Import Profile", DaiGUIStyles.toolbarButton))
79 | {
80 | m_TreeView.assetsFilter = AssetSearchTableView.Filter.ImportProfile;
81 | m_TreeView.Reload();
82 | }
83 |
84 | if (GUILayout.Button("Without Import Profile", DaiGUIStyles.toolbarButton))
85 | {
86 | m_TreeView.assetsFilter = AssetSearchTableView.Filter.NoImportProfile;
87 | m_TreeView.Reload();
88 | }
89 |
90 | if (GUILayout.Button("Unused", DaiGUIStyles.toolbarButton))
91 | {
92 | m_TreeView.assetsFilter = AssetSearchTableView.Filter.Unused;
93 | m_TreeView.Reload();
94 | }
95 |
96 | if (GUILayout.Button("Duplicates", DaiGUIStyles.toolbarButton))
97 | {
98 | m_TreeView.assetsFilter = AssetSearchTableView.Filter.Duplicates;
99 | m_TreeView.Reload();
100 | }
101 |
102 | GUILayout.FlexibleSpace();
103 | m_TreeView.searchString = m_SearchField.OnToolbarGUI(m_TreeView.searchString);
104 | EditorGUILayout.EndHorizontal();
105 | }
106 |
107 | void DrawContent()
108 | {
109 | var r = EditorGUILayout.GetControlRect(GUILayout.ExpandHeight(true));
110 | r.yMin -= 2;
111 | m_TreeView.OnGUI(r);
112 | }
113 | }
114 | }
--------------------------------------------------------------------------------
/Editor/Processors/Inspectors/SetTextureFormatInspector.cs:
--------------------------------------------------------------------------------
1 | // using System;
2 | // using System.Collections;
3 | // using System.Collections.Generic;
4 | // using System.Reflection;
5 | // using AssetPipeline.Import;
6 | // using UnityEditor;
7 | // using UnityEditor.AssetImporters;
8 | // using UnityEditorInternal;
9 | // using UnityEngine;
10 | // using Object = UnityEngine.Object;
11 | // using NinjaBeats;
12 | // using IList = System.Collections.IList;
13 | // using NinjaBeats.ReflectionHelper;
14 | //
15 | // namespace AssetPipeline.Processors
16 | // {
17 | // [CustomEditor(typeof(SetTextureFormat))]
18 | // internal class SetTextureFormatInspector : AssetProcessorInspector
19 | // {
20 | // private static UnityEditor_TextureImporterInspector s_DummyEditor;
21 | // private static IList s_PlatformSettings;
22 | // private SetTextureFormat m_Target;
23 | // private readonly GUIContent GUIContent_defaultPlatform = EditorGUIUtility.TrTextContent("Default");
24 | //
25 | // protected override void OnEnable()
26 | // {
27 | // base.OnEnable();
28 | //
29 | // m_Target = target as SetTextureFormat;
30 | // if (m_Target == null)
31 | // return;
32 | //
33 | // m_Target.DataToDummy();
34 | //
35 | // s_DummyEditor.__self__ ??= Editor.CreateEditor(SetTextureFormat.DummyImporter, UnityEditor_TextureImporterInspector.__type__);
36 | // s_PlatformSettings ??= (IList)Activator.CreateInstance(typeof(List<>).MakeGenericType(new[] { UnityEditor_BaseTextureImportPlatformSettings.__type__ }));
37 | //
38 | // s_DummyEditor.OnEnable();
39 | // }
40 | //
41 | // protected void OnDisable()
42 | // {
43 | // if (m_Target == null)
44 | // return;
45 | //
46 | // s_DummyEditor.OnDisable();
47 | //
48 | // m_Target = null;
49 | // }
50 | //
51 | // public override void OnInspectorGUI()
52 | // {
53 | // if (m_Target == null)
54 | // return;
55 | //
56 | // serializedObject.Update();
57 | // DrawBaseProperties();
58 | // serializedObject.ApplyModifiedProperties();
59 | //
60 | // s_PlatformSettings.Clear();
61 | // s_PlatformSettings.AddRange(s_DummyEditor.m_PlatformSettings);
62 | // var m_PlatformSettingsArrProp = s_DummyEditor.m_PlatformSettingsArrProp;
63 | // UnityEditor_BaseTextureImportPlatformSettings.InitPlatformSettings(s_PlatformSettings);
64 | // foreach (var v in s_PlatformSettings)
65 | // {
66 | // var settings = new UnityEditor_TextureImportPlatformSettings(v);
67 | // settings.CacheSerializedProperties(m_PlatformSettingsArrProp);
68 | // }
69 | // GUILayout.Space(10f);
70 | // int selected = UnityEditor_EditorGUILayout.BeginPlatformGrouping(
71 | // UnityEditor_BaseTextureImportPlatformSettings.GetBuildPlayerValidPlatforms(),
72 | // GUIContent_defaultPlatform,
73 | // UnityEditor_EditorStyles.frameBox, (Func)(idx =>
74 | // {
75 | // UnityEditor_TextureImportPlatformSettings setting = new(s_PlatformSettings[idx + 1]);
76 | // var model = setting.model;
77 | // var isDefault = model.isDefault;
78 | // var overriddenIsDifferent = model.overriddenIsDifferent;
79 | // var allAreOverridden = model.allAreOverridden;
80 | // return !isDefault && (overriddenIsDifferent || allAreOverridden);
81 | // }));
82 | // using (EditorGUI.ChangeCheckScope changeCheckScope = new EditorGUI.ChangeCheckScope())
83 | // {
84 | // UnityEditor_BaseTextureImportPlatformSettings.ShowPlatformSpecificSettings(s_PlatformSettings,
85 | // selected);
86 | // if (changeCheckScope.changed)
87 | // {
88 | // Undo.RegisterCompleteObjectUndo(new UnityEngine.Object[] { this.m_Target, SetTextureFormat.DummyImporter }, "Inspector");
89 | // UnityEditor_BaseTextureImportPlatformSettings.ApplyPlatformSettings(s_PlatformSettings);
90 | // m_Target.DataFromDummy();
91 | //
92 | // }
93 | // }
94 | // }
95 | // }
96 | // }
--------------------------------------------------------------------------------
/Editor/Assets/__importertexturesdummy__.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 850ae6629c6fa2740b7d1e26859a4300
3 | TextureImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 12
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: 0
40 | wrapV: 0
41 | wrapW: 0
42 | nPOTScale: 1
43 | lightmap: 0
44 | compressionQuality: 50
45 | spriteMode: 0
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: 0
55 | spriteTessellationDetail: -1
56 | textureType: 0
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 | cookieLightType: 1
67 | platformSettings:
68 | - serializedVersion: 3
69 | buildTarget: DefaultTexturePlatform
70 | maxTextureSize: 2048
71 | resizeAlgorithm: 0
72 | textureFormat: -1
73 | textureCompression: 1
74 | compressionQuality: 50
75 | crunchedCompression: 0
76 | allowsAlphaSplitting: 0
77 | overridden: 0
78 | androidETC2FallbackOverride: 0
79 | forceMaximumCompressionQuality_BC6H_BC7: 0
80 | - serializedVersion: 3
81 | buildTarget: WebGL
82 | maxTextureSize: 2048
83 | resizeAlgorithm: 0
84 | textureFormat: 10
85 | textureCompression: 1
86 | compressionQuality: 50
87 | crunchedCompression: 0
88 | allowsAlphaSplitting: 0
89 | overridden: 1
90 | androidETC2FallbackOverride: 0
91 | forceMaximumCompressionQuality_BC6H_BC7: 0
92 | - serializedVersion: 3
93 | buildTarget: Standalone
94 | maxTextureSize: 2048
95 | resizeAlgorithm: 0
96 | textureFormat: -1
97 | textureCompression: 1
98 | compressionQuality: 50
99 | crunchedCompression: 0
100 | allowsAlphaSplitting: 0
101 | overridden: 0
102 | androidETC2FallbackOverride: 0
103 | forceMaximumCompressionQuality_BC6H_BC7: 0
104 | - serializedVersion: 3
105 | buildTarget: iPhone
106 | maxTextureSize: 2048
107 | resizeAlgorithm: 0
108 | textureFormat: -1
109 | textureCompression: 1
110 | compressionQuality: 50
111 | crunchedCompression: 0
112 | allowsAlphaSplitting: 0
113 | overridden: 1
114 | androidETC2FallbackOverride: 0
115 | forceMaximumCompressionQuality_BC6H_BC7: 0
116 | - serializedVersion: 3
117 | buildTarget: Android
118 | maxTextureSize: 2048
119 | resizeAlgorithm: 0
120 | textureFormat: -1
121 | textureCompression: 1
122 | compressionQuality: 50
123 | crunchedCompression: 0
124 | allowsAlphaSplitting: 0
125 | overridden: 1
126 | androidETC2FallbackOverride: 0
127 | forceMaximumCompressionQuality_BC6H_BC7: 0
128 | - serializedVersion: 3
129 | buildTarget: Server
130 | maxTextureSize: 2048
131 | resizeAlgorithm: 0
132 | textureFormat: -1
133 | textureCompression: 1
134 | compressionQuality: 50
135 | crunchedCompression: 0
136 | allowsAlphaSplitting: 0
137 | overridden: 0
138 | androidETC2FallbackOverride: 0
139 | forceMaximumCompressionQuality_BC6H_BC7: 0
140 | spriteSheet:
141 | serializedVersion: 2
142 | sprites: []
143 | outline: []
144 | physicsShape: []
145 | bones: []
146 | spriteID:
147 | internalID: 0
148 | vertices: []
149 | indices:
150 | edges: []
151 | weights: []
152 | secondaryTextures: []
153 | nameFileIdTable: {}
154 | spritePackingTag:
155 | pSDRemoveMatte: 0
156 | pSDShowRemoveMatteOption: 0
157 | userData:
158 | assetBundleName:
159 | assetBundleVariant:
160 |
--------------------------------------------------------------------------------
/Editor/Config/AssetPipelineSettings.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.IO;
3 | using AssetPipeline.Import;
4 | using UnityEditor;
5 | using UnityEngine;
6 |
7 | namespace AssetPipeline
8 | {
9 | public class AssetPipelineSettings : ScriptableObject
10 | {
11 | const string kDefaultProfileStoragePath = "Assets/Editor/AssetPipeline/Settings/";
12 | static AssetPipelineSettings s_AssetPipelineSettings;
13 | public const string kSettingsPath = "Assets/Editor/AssetPipeline/Settings/AssetPipelineSettings.asset";
14 | public const string kDeveloperModeKey = "AssetPipelineDeveloperMode";
15 |
16 | #pragma warning disable 0414
17 | [SerializeField] List m_AssetTypeFileExtensions;
18 | [SerializeField] string m_DefaultProfileStoragePath;
19 | [SerializeField] Color m_EnabledColor = new Color(0.2688679f, 1f, 0.2688679f);
20 | [SerializeField] Color m_DisabledColor = new Color(1f, 0.2688679f, 0.2688679f);
21 | [SerializeField] StringConvention m_DefaultConvention = StringConvention.None;
22 | #pragma warning restore 0414
23 |
24 | public StringConvention DefaultPathVariableConvention => m_DefaultConvention;
25 | public string profileStoragePath => string.IsNullOrEmpty(m_DefaultProfileStoragePath) ? kDefaultProfileStoragePath : m_DefaultProfileStoragePath;
26 | public List assetTypeFileExtensions => m_AssetTypeFileExtensions;
27 | public static AssetPipelineSettings Settings => GetOrCreateSettings();
28 |
29 | public static bool DeveloperMode
30 | {
31 | get => EditorPrefs.GetBool(kDeveloperModeKey, false);
32 | set => EditorPrefs.SetBool(kDeveloperModeKey, value);
33 | }
34 |
35 | internal static AssetPipelineSettings GetOrCreateSettings()
36 | {
37 | if (!s_AssetPipelineSettings)
38 | {
39 | var folderPath = Path.GetDirectoryName(kSettingsPath);
40 | PathUtility.CreateDirectoryIfNeeded(folderPath);
41 |
42 | s_AssetPipelineSettings = AssetDatabase.LoadAssetAtPath(kSettingsPath);
43 | if (s_AssetPipelineSettings == null)
44 | {
45 | s_AssetPipelineSettings = CreateInstance();
46 | s_AssetPipelineSettings.m_AssetTypeFileExtensions = new List
47 | {
48 | new AssetTypeFileExtensions(ImportAssetType.Textures, ".ai", ".apng", ".png", ".bmp", ".cdr", ".dib", ".eps", ".exif", ".gif", ".ico", ".icon", ".j", ".j2c", ".j2k", ".jas", ".jiff", ".jng", ".jp2", ".jpc", ".jpe", ".jpeg", ".jpf", ".jpg", ".jpw", ".jpx", ".jtf", ".mac",
49 | ".omf", ".qif", ".qti", ".qtif", ".tex", ".tfw", ".tga", ".tif", ".tiff", ".wmf", ".psd", ".exr", ".hdr"),
50 | new AssetTypeFileExtensions(ImportAssetType.Models, ".3df", ".3dm", ".3dmf", ".3ds", ".3dv", ".3dx", ".blend", ".c4d", ".lwo", ".lws", ".ma", ".max", ".mb", ".mesh", ".obj", ".vrl", ".wrl", ".wrz", ".fbx"),
51 | new AssetTypeFileExtensions(ImportAssetType.Audio, ".aac", ".aif", ".aiff", ".au", ".mid", ".midi", ".mp3", ".mpa", ".ra", ".ram", ".wma", ".wav", ".wave", ".ogg", ".flac"),
52 | new AssetTypeFileExtensions(ImportAssetType.Videos, ".dv", ".mp4", ".mpg", ".mpeg", ".m4v", ".ogv", ".vp8", ".webm", ".asf", ".asx", ".avi", ".dat", ".divx", ".dvx", ".mlv", ".m2l", ".m2t", ".m2ts", ".m2v", ".m4e", ".mjp", ".mov", ".movie", ".mp21", ".mpe", ".mpv2", ".ogm",
53 | ".qt", ".rm", ".rmvb", ".wmw", ".xvid"),
54 | new AssetTypeFileExtensions(ImportAssetType.Fonts, ".ttf", ".otf", ".fon", ".fnt"),
55 | new AssetTypeFileExtensions(ImportAssetType.Animations, ".anim"),
56 | new AssetTypeFileExtensions(ImportAssetType.Materials, ".mat"),
57 | new AssetTypeFileExtensions(ImportAssetType.Prefabs, ".prefab"),
58 | new AssetTypeFileExtensions(ImportAssetType.SpriteAtlases, ".spriteatlas",".spriteatlasv2"),
59 | };
60 | s_AssetPipelineSettings.m_DefaultProfileStoragePath = kDefaultProfileStoragePath;
61 | AssetDatabase.CreateAsset(s_AssetPipelineSettings, kSettingsPath);
62 | AssetDatabase.SaveAssets();
63 | }
64 | }
65 |
66 | return s_AssetPipelineSettings;
67 | }
68 |
69 | internal static SerializedObject GetSerializedSettings()
70 | {
71 | return new SerializedObject(Settings);
72 | }
73 |
74 | public static Color GetStatusColor(bool enabled)
75 | {
76 | return enabled ? Settings.m_EnabledColor : Settings.m_DisabledColor;
77 | }
78 | }
79 | }
--------------------------------------------------------------------------------
/Editor/Utility/AssetDatabaseUtility.cs:
--------------------------------------------------------------------------------
1 | using System.Collections;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Reflection;
5 | using UnityEditor;
6 | using UnityEngine;
7 |
8 | namespace AssetPipeline
9 | {
10 | internal static class AssetDatabaseUtility
11 | {
12 | public static T FindAndLoadAsset() where T : Object
13 | {
14 | return FindAndLoadAsset($"t:{typeof(T).FullName}");
15 | }
16 |
17 | public static T FindAndLoadAsset(string filter, params string[] paths) where T : Object
18 | {
19 | var assetPaths = FindAssetPaths(filter, paths);
20 | return assetPaths.Length == 0 ? null : AssetDatabase.LoadAssetAtPath(assetPaths[0]);
21 | }
22 |
23 | public static T[] FindAndLoadAssets() where T : Object
24 | {
25 | return FindAndLoadAssets($"t:{typeof(T).FullName}");
26 | }
27 |
28 | public static T[] FindAndLoadAssets(string filter, params string[] paths) where T : Object
29 | {
30 | var assetPaths = FindAssetPaths(filter, paths);
31 | var objs = new T[assetPaths.Length];
32 | for (var i = 0; i < assetPaths.Length; i++)
33 | {
34 | objs[i] = AssetDatabase.LoadAssetAtPath(assetPaths[i]);
35 | }
36 |
37 | return objs;
38 | }
39 |
40 | public static string[] FindAssetPaths(string filter, params string[] paths)
41 | {
42 | for (var i = 0; i < paths.Length; i++)
43 | {
44 | if (paths[i].EndsWith("/"))
45 | {
46 | paths[i] = paths[i].Substring(0, paths[i].Length - 1);
47 | }
48 | }
49 |
50 | return AssetDatabase.FindAssets(filter, paths).Select(AssetDatabase.GUIDToAssetPath).ToArray();
51 | }
52 |
53 | public static void AddObjectToUnityAsset(this Object objectToAdd, Object assetObject)
54 | {
55 | AssetDatabase.AddObjectToAsset(objectToAdd, assetObject);
56 | AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(objectToAdd));
57 | AssetDatabase.Refresh();
58 | AssetDatabase.SaveAssets();
59 | }
60 |
61 | public static void RemoveObjectFromUnityAsset(this Object obj, string parentAssetPath)
62 | {
63 | if (!obj)
64 | {
65 | return;
66 | }
67 |
68 | if (AssetDatabase.GetAssetPath(obj) == parentAssetPath)
69 | {
70 | RemoveObjectFromUnityAsset(obj);
71 | }
72 | }
73 |
74 | public static void RemoveObjectFromUnityAsset(this Object obj)
75 | {
76 | if (!obj)
77 | {
78 | return;
79 | }
80 |
81 | AssetDatabase.RemoveObjectFromAsset(obj);
82 | Object.DestroyImmediate(obj, true);
83 | }
84 |
85 | public static void RemoveNestedObjectsFromUnityAsset(this object obj, string parentAssetPath, bool includeSelf = true)
86 | {
87 | if (obj == null)
88 | {
89 | return;
90 | }
91 |
92 | var fieldInfos = obj.GetType().GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
93 | foreach (var fieldInfo in fieldInfos)
94 | {
95 | if (!fieldInfo.IsPublic && fieldInfo.GetCustomAttribute() == null)
96 | {
97 | continue;
98 | }
99 |
100 | if (fieldInfo.FieldType.IsSubclassOf(typeof(Object)))
101 | {
102 | var value = (Object) fieldInfo.GetValue(obj);
103 | if (value)
104 | {
105 | value.RemoveNestedObjectsFromUnityAsset(parentAssetPath);
106 | }
107 | }
108 | else if (fieldInfo.FieldType.IsGenericType && fieldInfo.FieldType.GetGenericTypeDefinition().GetInterfaces().Any(i => i.IsGenericType && i.GetGenericTypeDefinition().IsAssignableFrom(typeof(IEnumerable<>))))
109 | {
110 | var type = fieldInfo.FieldType.GetGenericArguments()[0];
111 | if (type.IsSubclassOf(typeof(Object)))
112 | {
113 | var collection = (IEnumerable) fieldInfo.GetValue(obj);
114 | foreach (var value in collection)
115 | {
116 | value.RemoveNestedObjectsFromUnityAsset(parentAssetPath);
117 | }
118 | }
119 | }
120 | }
121 |
122 | if (includeSelf && obj is Object o)
123 | {
124 | o.RemoveObjectFromUnityAsset(parentAssetPath);
125 | }
126 | }
127 | }
128 | }
--------------------------------------------------------------------------------
/Editor/Resources/Icons/IgnoreCaseOff.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 352749165781dbd46b814d8bd0c0de09
3 | TextureImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 12
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: 0
42 | nPOTScale: 0
43 | lightmap: 0
44 | compressionQuality: 50
45 | spriteMode: 0
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: 2
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 | cookieLightType: 1
67 | platformSettings:
68 | - serializedVersion: 3
69 | buildTarget: DefaultTexturePlatform
70 | maxTextureSize: 2048
71 | resizeAlgorithm: 0
72 | textureFormat: -1
73 | textureCompression: 1
74 | compressionQuality: 50
75 | crunchedCompression: 0
76 | allowsAlphaSplitting: 0
77 | overridden: 0
78 | androidETC2FallbackOverride: 0
79 | forceMaximumCompressionQuality_BC6H_BC7: 0
80 | - serializedVersion: 3
81 | buildTarget: Standalone
82 | maxTextureSize: 2048
83 | resizeAlgorithm: 0
84 | textureFormat: -1
85 | textureCompression: 1
86 | compressionQuality: 50
87 | crunchedCompression: 0
88 | allowsAlphaSplitting: 0
89 | overridden: 0
90 | androidETC2FallbackOverride: 0
91 | forceMaximumCompressionQuality_BC6H_BC7: 0
92 | - serializedVersion: 3
93 | buildTarget: Windows Store Apps
94 | maxTextureSize: 2048
95 | resizeAlgorithm: 0
96 | textureFormat: -1
97 | textureCompression: 1
98 | compressionQuality: 50
99 | crunchedCompression: 0
100 | allowsAlphaSplitting: 0
101 | overridden: 0
102 | androidETC2FallbackOverride: 0
103 | forceMaximumCompressionQuality_BC6H_BC7: 0
104 | - serializedVersion: 3
105 | buildTarget: iPhone
106 | maxTextureSize: 2048
107 | resizeAlgorithm: 0
108 | textureFormat: -1
109 | textureCompression: 1
110 | compressionQuality: 50
111 | crunchedCompression: 0
112 | allowsAlphaSplitting: 0
113 | overridden: 1
114 | androidETC2FallbackOverride: 0
115 | forceMaximumCompressionQuality_BC6H_BC7: 0
116 | - serializedVersion: 3
117 | buildTarget: Android
118 | maxTextureSize: 2048
119 | resizeAlgorithm: 0
120 | textureFormat: -1
121 | textureCompression: 1
122 | compressionQuality: 50
123 | crunchedCompression: 0
124 | allowsAlphaSplitting: 0
125 | overridden: 1
126 | androidETC2FallbackOverride: 0
127 | forceMaximumCompressionQuality_BC6H_BC7: 0
128 | - serializedVersion: 3
129 | buildTarget: WebGL
130 | maxTextureSize: 2048
131 | resizeAlgorithm: 0
132 | textureFormat: 12
133 | textureCompression: 1
134 | compressionQuality: 50
135 | crunchedCompression: 0
136 | allowsAlphaSplitting: 0
137 | overridden: 1
138 | androidETC2FallbackOverride: 0
139 | forceMaximumCompressionQuality_BC6H_BC7: 0
140 | - serializedVersion: 3
141 | buildTarget: Server
142 | maxTextureSize: 2048
143 | resizeAlgorithm: 0
144 | textureFormat: -1
145 | textureCompression: 1
146 | compressionQuality: 50
147 | crunchedCompression: 0
148 | allowsAlphaSplitting: 0
149 | overridden: 0
150 | androidETC2FallbackOverride: 0
151 | forceMaximumCompressionQuality_BC6H_BC7: 0
152 | spriteSheet:
153 | serializedVersion: 2
154 | sprites: []
155 | outline: []
156 | physicsShape: []
157 | bones: []
158 | spriteID:
159 | internalID: 0
160 | vertices: []
161 | indices:
162 | edges: []
163 | weights: []
164 | secondaryTextures: []
165 | nameFileIdTable: {}
166 | spritePackingTag:
167 | pSDRemoveMatte: 0
168 | pSDShowRemoveMatteOption: 0
169 | userData:
170 | assetBundleName:
171 | assetBundleVariant:
172 |
--------------------------------------------------------------------------------