Skip to content
This repository was archived by the owner on Jul 11, 2023. It is now read-only.

Commit ebfef4a

Browse files
committed
增加模型规范
1 parent 676a7fb commit ebfef4a

File tree

2 files changed

+10
-21
lines changed

2 files changed

+10
-21
lines changed

GameFramework/Editor/AssetManagement/StandardAssetEditor.cs

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
// }
102102
// }
103103

104-
// public virtual AssetImporter Importer { get; set; }
104+
// public virtual JsonData ImporterConfig { get; set; }
105105

106106
// protected FieldInfo[] _filedInfos;
107107
// protected PropertyInfo[] _propertyInfos;
@@ -113,25 +113,6 @@
113113
// class TextureStandardAsset : StandardAssetBase
114114
// {
115115
// private TextureImporter _textureImporter;
116-
// public override AssetImporter Importer
117-
// {
118-
// get
119-
// {
120-
// return _textureImporter;
121-
// }
122-
// set
123-
// {
124-
// if (value == null)
125-
// {
126-
// var template = AssetDatabase.LoadAssetAtPath<TextAsset>($"Assets/UnityGameFramework/GameFramework/Editor/AssetManagement/StandardAsset/TextureImporter.bytes");
127-
// _textureImporter = SerializationUtility.DeserializeValue<TextureImporter>(template.bytes, DataFormat.Binary);
128-
// }
129-
// else
130-
// {
131-
// _textureImporter = value as TextureImporter;
132-
// }
133-
// }
134-
// }
135116

136117
// public override void OnDraw()
137118
// {

GameFramework/Editor/AssetManagement/StandardAssetPostprocessor.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,15 @@ void OnPreprocessTexture()
8181
/// </summary>
8282
void OnPreprocessModel()
8383
{
84-
84+
if (!CheckFlag("ModelFlag"))
85+
{
86+
ModelImporter modelImporter = (ModelImporter)assetImporter;
87+
modelImporter.useFileUnits = false;
88+
89+
EditorUtility.SetDirty(assetImporter);
90+
modelImporter.SaveAndReimport();
91+
AssetDatabase.Refresh();
92+
}
8593
}
8694

8795
/// <summary>

0 commit comments

Comments
 (0)