|
@@ -33,6 +33,10 @@
|
|
#define NO_PREFAB_MESH
|
|
#define NO_PREFAB_MESH
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
+#if UNITY_2018_1_OR_NEWER
|
|
|
|
+#define PER_MATERIAL_PROPERTY_BLOCKS
|
|
|
|
+#endif
|
|
|
|
+
|
|
#if UNITY_2017_1_OR_NEWER
|
|
#if UNITY_2017_1_OR_NEWER
|
|
#define BUILT_IN_SPRITE_MASK_COMPONENT
|
|
#define BUILT_IN_SPRITE_MASK_COMPONENT
|
|
#endif
|
|
#endif
|
|
@@ -55,7 +59,7 @@ namespace Spine.Unity.Editor {
|
|
|
|
|
|
protected SerializedProperty skeletonDataAsset, initialSkinName;
|
|
protected SerializedProperty skeletonDataAsset, initialSkinName;
|
|
protected SerializedProperty initialFlipX, initialFlipY;
|
|
protected SerializedProperty initialFlipX, initialFlipY;
|
|
- protected SerializedProperty singleSubmesh, separatorSlotNames, clearStateOnDisable, immutableTriangles;
|
|
|
|
|
|
+ protected SerializedProperty singleSubmesh, separatorSlotNames, clearStateOnDisable, immutableTriangles, fixDrawOrder;
|
|
protected SerializedProperty normals, tangents, zSpacing, pmaVertexColors, tintBlack; // MeshGenerator settings
|
|
protected SerializedProperty normals, tangents, zSpacing, pmaVertexColors, tintBlack; // MeshGenerator settings
|
|
protected SerializedProperty maskInteraction;
|
|
protected SerializedProperty maskInteraction;
|
|
protected SerializedProperty maskMaterialsNone, maskMaterialsInside, maskMaterialsOutside;
|
|
protected SerializedProperty maskMaterialsNone, maskMaterialsInside, maskMaterialsOutside;
|
|
@@ -70,7 +74,7 @@ namespace Spine.Unity.Editor {
|
|
protected bool deleteOutsideMaskMaterialsQueued = false;
|
|
protected bool deleteOutsideMaskMaterialsQueued = false;
|
|
|
|
|
|
protected GUIContent SkeletonDataAssetLabel, SkeletonUtilityButtonContent;
|
|
protected GUIContent SkeletonDataAssetLabel, SkeletonUtilityButtonContent;
|
|
- protected GUIContent PMAVertexColorsLabel, ClearStateOnDisableLabel, ZSpacingLabel, ImmubleTrianglesLabel, TintBlackLabel, SingleSubmeshLabel;
|
|
|
|
|
|
+ protected GUIContent PMAVertexColorsLabel, ClearStateOnDisableLabel, ZSpacingLabel, ImmubleTrianglesLabel, TintBlackLabel, SingleSubmeshLabel, FixDrawOrderLabel;
|
|
protected GUIContent NormalsLabel, TangentsLabel, MaskInteractionLabel;
|
|
protected GUIContent NormalsLabel, TangentsLabel, MaskInteractionLabel;
|
|
protected GUIContent MaskMaterialsHeadingLabel, MaskMaterialsNoneLabel, MaskMaterialsInsideLabel, MaskMaterialsOutsideLabel;
|
|
protected GUIContent MaskMaterialsHeadingLabel, MaskMaterialsNoneLabel, MaskMaterialsInsideLabel, MaskMaterialsOutsideLabel;
|
|
protected GUIContent SetMaterialButtonLabel, ClearMaterialButtonLabel, DeleteMaterialButtonLabel;
|
|
protected GUIContent SetMaterialButtonLabel, ClearMaterialButtonLabel, DeleteMaterialButtonLabel;
|
|
@@ -116,6 +120,7 @@ namespace Spine.Unity.Editor {
|
|
TangentsLabel = new GUIContent("Solve Tangents", "Calculates the tangents per frame. Use this if you are using lit shaders (usually with normal maps) that require vertex tangents.");
|
|
TangentsLabel = new GUIContent("Solve Tangents", "Calculates the tangents per frame. Use this if you are using lit shaders (usually with normal maps) that require vertex tangents.");
|
|
TintBlackLabel = new GUIContent("Tint Black (!)", "Adds black tint vertex data to the mesh as UV2 and UV3. Black tinting requires that the shader interpret UV2 and UV3 as black tint colors for this effect to work. You may also use the default [Spine/Skeleton Tint Black] shader.\n\nIf you only need to tint the whole skeleton and not individual parts, the [Spine/Skeleton Tint] shader is recommended for better efficiency and changing/animating the _Black material property via MaterialPropertyBlock.");
|
|
TintBlackLabel = new GUIContent("Tint Black (!)", "Adds black tint vertex data to the mesh as UV2 and UV3. Black tinting requires that the shader interpret UV2 and UV3 as black tint colors for this effect to work. You may also use the default [Spine/Skeleton Tint Black] shader.\n\nIf you only need to tint the whole skeleton and not individual parts, the [Spine/Skeleton Tint] shader is recommended for better efficiency and changing/animating the _Black material property via MaterialPropertyBlock.");
|
|
SingleSubmeshLabel = new GUIContent("Use Single Submesh", "Simplifies submesh generation by assuming you are only using one Material and need only one submesh. This is will disable multiple materials, render separation, and custom slot materials.");
|
|
SingleSubmeshLabel = new GUIContent("Use Single Submesh", "Simplifies submesh generation by assuming you are only using one Material and need only one submesh. This is will disable multiple materials, render separation, and custom slot materials.");
|
|
|
|
+ FixDrawOrderLabel = new GUIContent("Fix Draw Order", "Applies only when 3+ submeshes are used (2+ materials with alternating order, e.g. \"A B A\"). If true, MaterialPropertyBlocks are assigned at each material to prevent aggressive batching of submeshes by e.g. the LWRP renderer, leading to incorrect draw order (e.g. \"A1 B A2\" changed to \"A1A2 B\"). You can disable this parameter when everything is drawn correctly to save the additional performance cost.");
|
|
MaskInteractionLabel = new GUIContent("Mask Interaction", "SkeletonRenderer's interaction with a Sprite Mask.");
|
|
MaskInteractionLabel = new GUIContent("Mask Interaction", "SkeletonRenderer's interaction with a Sprite Mask.");
|
|
MaskMaterialsHeadingLabel = new GUIContent("Mask Interaction Materials", "Materials used for different interaction with sprite masks.");
|
|
MaskMaterialsHeadingLabel = new GUIContent("Mask Interaction Materials", "Materials used for different interaction with sprite masks.");
|
|
MaskMaterialsNoneLabel = new GUIContent("Normal Materials", "Normal materials used when Mask Interaction is set to None.");
|
|
MaskMaterialsNoneLabel = new GUIContent("Normal Materials", "Normal materials used when Mask Interaction is set to None.");
|
|
@@ -137,6 +142,7 @@ namespace Spine.Unity.Editor {
|
|
clearStateOnDisable = so.FindProperty("clearStateOnDisable");
|
|
clearStateOnDisable = so.FindProperty("clearStateOnDisable");
|
|
tintBlack = so.FindProperty("tintBlack");
|
|
tintBlack = so.FindProperty("tintBlack");
|
|
singleSubmesh = so.FindProperty("singleSubmesh");
|
|
singleSubmesh = so.FindProperty("singleSubmesh");
|
|
|
|
+ fixDrawOrder = so.FindProperty("fixDrawOrder");
|
|
maskInteraction = so.FindProperty("maskInteraction");
|
|
maskInteraction = so.FindProperty("maskInteraction");
|
|
maskMaterialsNone = so.FindProperty("maskMaterials.materialsMaskDisabled");
|
|
maskMaterialsNone = so.FindProperty("maskMaterials.materialsMaskDisabled");
|
|
maskMaterialsInside = so.FindProperty("maskMaterials.materialsInsideMask");
|
|
maskMaterialsInside = so.FindProperty("maskMaterials.materialsInsideMask");
|
|
@@ -334,6 +340,9 @@ namespace Spine.Unity.Editor {
|
|
using (new SpineInspectorUtility.LabelWidthScope()) {
|
|
using (new SpineInspectorUtility.LabelWidthScope()) {
|
|
// Optimization options
|
|
// Optimization options
|
|
if (singleSubmesh != null) EditorGUILayout.PropertyField(singleSubmesh, SingleSubmeshLabel);
|
|
if (singleSubmesh != null) EditorGUILayout.PropertyField(singleSubmesh, SingleSubmeshLabel);
|
|
|
|
+ #if PER_MATERIAL_PROPERTY_BLOCKS
|
|
|
|
+ if (fixDrawOrder != null) EditorGUILayout.PropertyField(fixDrawOrder, FixDrawOrderLabel);
|
|
|
|
+ #endif
|
|
if (immutableTriangles != null) EditorGUILayout.PropertyField(immutableTriangles, ImmubleTrianglesLabel);
|
|
if (immutableTriangles != null) EditorGUILayout.PropertyField(immutableTriangles, ImmubleTrianglesLabel);
|
|
EditorGUILayout.PropertyField(clearStateOnDisable, ClearStateOnDisableLabel);
|
|
EditorGUILayout.PropertyField(clearStateOnDisable, ClearStateOnDisableLabel);
|
|
EditorGUILayout.Space();
|
|
EditorGUILayout.Space();
|