mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-06 18:56:54 +08:00
Merge branch '4.0' into 4.1-beta
This commit is contained in:
commit
8dc4ee4a6e
@ -625,18 +625,23 @@ namespace Spine.Unity.Editor {
|
|||||||
if (material == null) {
|
if (material == null) {
|
||||||
Shader defaultShader = Shader.Find(SpineEditorUtilities.Preferences.DefaultShader);
|
Shader defaultShader = Shader.Find(SpineEditorUtilities.Preferences.DefaultShader);
|
||||||
material = defaultShader != null ? new Material(defaultShader) : null;
|
material = defaultShader != null ? new Material(defaultShader) : null;
|
||||||
ApplyPMAOrStraightAlphaSettings(material, SpineEditorUtilities.Preferences.textureSettingsReference);
|
if (material) {
|
||||||
AssetDatabase.CreateAsset(material, materialPath);
|
ApplyPMAOrStraightAlphaSettings(material, SpineEditorUtilities.Preferences.textureSettingsReference);
|
||||||
|
AssetDatabase.CreateAsset(material, materialPath);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
vestigialMaterials.Remove(material);
|
vestigialMaterials.Remove(material);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (texture != null)
|
if (material != null) {
|
||||||
material.mainTexture = texture;
|
if (texture != null) {
|
||||||
|
material.mainTexture = texture;
|
||||||
|
}
|
||||||
|
|
||||||
EditorUtility.SetDirty(material);
|
EditorUtility.SetDirty(material);
|
||||||
// note: don't call AssetDatabase.SaveAssets() since this would trigger OnPostprocessAllAssets() every time unnecessarily.
|
// note: don't call AssetDatabase.SaveAssets() since this would trigger OnPostprocessAllAssets() every time unnecessarily.
|
||||||
populatingMaterials.Add(material); //atlasAsset.materials[i] = mat;
|
populatingMaterials.Add(material); //atlasAsset.materials[i] = mat;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
atlasAsset.materials = populatingMaterials.ToArray();
|
atlasAsset.materials = populatingMaterials.ToArray();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user