mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 14:24:53 +08:00
[unity] PhysicsConstraints: Added inspector properties for Movement relative to, see previous commit 4266c72.
This commit is contained in:
parent
4266c727cb
commit
ad825305f0
@ -62,7 +62,7 @@ namespace Spine.Unity.Editor {
|
|||||||
SerializedProperty skeletonDataAsset, initialSkinName;
|
SerializedProperty skeletonDataAsset, initialSkinName;
|
||||||
SerializedProperty startingAnimation, startingLoop, timeScale, freeze,
|
SerializedProperty startingAnimation, startingLoop, timeScale, freeze,
|
||||||
updateTiming, updateWhenInvisible, unscaledTime, tintBlack, layoutScaleMode, editReferenceRect;
|
updateTiming, updateWhenInvisible, unscaledTime, tintBlack, layoutScaleMode, editReferenceRect;
|
||||||
SerializedProperty applyTranslationToPhysics, applyRotationToPhysics;
|
SerializedProperty applyTranslationToPhysics, applyRotationToPhysics, physicsMovementRelativeTo;
|
||||||
SerializedProperty initialFlipX, initialFlipY;
|
SerializedProperty initialFlipX, initialFlipY;
|
||||||
SerializedProperty meshGeneratorSettings;
|
SerializedProperty meshGeneratorSettings;
|
||||||
SerializedProperty allowMultipleCanvasRenderers, separatorSlotNames, enableSeparatorSlots,
|
SerializedProperty allowMultipleCanvasRenderers, separatorSlotNames, enableSeparatorSlots,
|
||||||
@ -77,6 +77,8 @@ namespace Spine.Unity.Editor {
|
|||||||
"When enabled, the GameObject Transform translation movement is applied to PhysicsConstraints of the skeleton.");
|
"When enabled, the GameObject Transform translation movement is applied to PhysicsConstraints of the skeleton.");
|
||||||
readonly GUIContent ApplyRotationToPhysicsLabel = new GUIContent("Transform Rotation",
|
readonly GUIContent ApplyRotationToPhysicsLabel = new GUIContent("Transform Rotation",
|
||||||
"When enabled, the GameObject Transform rotation movement is applied to PhysicsConstraints of the skeleton.");
|
"When enabled, the GameObject Transform rotation movement is applied to PhysicsConstraints of the skeleton.");
|
||||||
|
readonly GUIContent PhysicsMovementRelativeToLabel = new GUIContent("Movement relative to",
|
||||||
|
"Reference transform relative to which physics movement will be calculated, or null to use world location.");
|
||||||
|
|
||||||
SkeletonGraphic thisSkeletonGraphic;
|
SkeletonGraphic thisSkeletonGraphic;
|
||||||
protected bool isInspectingPrefab;
|
protected bool isInspectingPrefab;
|
||||||
@ -143,6 +145,7 @@ namespace Spine.Unity.Editor {
|
|||||||
editReferenceRect = so.FindProperty("editReferenceRect");
|
editReferenceRect = so.FindProperty("editReferenceRect");
|
||||||
applyTranslationToPhysics = so.FindProperty("applyTranslationToPhysics");
|
applyTranslationToPhysics = so.FindProperty("applyTranslationToPhysics");
|
||||||
applyRotationToPhysics = so.FindProperty("applyRotationToPhysics");
|
applyRotationToPhysics = so.FindProperty("applyRotationToPhysics");
|
||||||
|
physicsMovementRelativeTo = so.FindProperty("physicsMovementRelativeTo");
|
||||||
|
|
||||||
meshGeneratorSettings = so.FindProperty("meshGenerator").FindPropertyRelative("settings");
|
meshGeneratorSettings = so.FindProperty("meshGenerator").FindPropertyRelative("settings");
|
||||||
meshGeneratorSettings.isExpanded = SkeletonRendererInspector.advancedFoldout;
|
meshGeneratorSettings.isExpanded = SkeletonRendererInspector.advancedFoldout;
|
||||||
@ -320,6 +323,7 @@ namespace Spine.Unity.Editor {
|
|||||||
EditorGUILayout.LabelField(SpineInspectorUtility.TempContent("Physics Constraints", SpineEditorUtilities.Icons.constraintPhysics), EditorStyles.boldLabel);
|
EditorGUILayout.LabelField(SpineInspectorUtility.TempContent("Physics Constraints", SpineEditorUtilities.Icons.constraintPhysics), EditorStyles.boldLabel);
|
||||||
EditorGUILayout.PropertyField(applyTranslationToPhysics, ApplyTranslationToPhysicsLabel);
|
EditorGUILayout.PropertyField(applyTranslationToPhysics, ApplyTranslationToPhysicsLabel);
|
||||||
EditorGUILayout.PropertyField(applyRotationToPhysics, ApplyRotationToPhysicsLabel);
|
EditorGUILayout.PropertyField(applyRotationToPhysics, ApplyRotationToPhysicsLabel);
|
||||||
|
EditorGUILayout.PropertyField(physicsMovementRelativeTo, PhysicsMovementRelativeToLabel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -68,7 +68,7 @@ namespace Spine.Unity.Editor {
|
|||||||
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;
|
||||||
protected SerializedProperty applyTranslationToPhysics, applyRotationToPhysics;
|
protected SerializedProperty applyTranslationToPhysics, applyRotationToPhysics, physicsMovementRelativeTo;
|
||||||
protected SpineInspectorUtility.SerializedSortingProperties sortingProperties;
|
protected SpineInspectorUtility.SerializedSortingProperties sortingProperties;
|
||||||
protected bool wasInitParameterChanged = false;
|
protected bool wasInitParameterChanged = false;
|
||||||
protected bool requireRepaint = false;
|
protected bool requireRepaint = false;
|
||||||
@ -92,6 +92,8 @@ namespace Spine.Unity.Editor {
|
|||||||
"When enabled, the GameObject Transform translation movement is applied to PhysicsConstraints of the skeleton.");
|
"When enabled, the GameObject Transform translation movement is applied to PhysicsConstraints of the skeleton.");
|
||||||
readonly GUIContent ApplyRotationToPhysicsLabel = new GUIContent("Transform Rotation",
|
readonly GUIContent ApplyRotationToPhysicsLabel = new GUIContent("Transform Rotation",
|
||||||
"When enabled, the GameObject Transform rotation movement is applied to PhysicsConstraints of the skeleton.");
|
"When enabled, the GameObject Transform rotation movement is applied to PhysicsConstraints of the skeleton.");
|
||||||
|
readonly GUIContent PhysicsMovementRelativeToLabel = new GUIContent("Movement relative to",
|
||||||
|
"Reference transform relative to which physics movement will be calculated, or null to use world location.");
|
||||||
|
|
||||||
const string ReloadButtonString = "Reload";
|
const string ReloadButtonString = "Reload";
|
||||||
static GUILayoutOption reloadButtonWidth;
|
static GUILayoutOption reloadButtonWidth;
|
||||||
@ -169,6 +171,7 @@ namespace Spine.Unity.Editor {
|
|||||||
maskMaterialsOutside = so.FindProperty("maskMaterials.materialsOutsideMask");
|
maskMaterialsOutside = so.FindProperty("maskMaterials.materialsOutsideMask");
|
||||||
applyTranslationToPhysics = so.FindProperty("applyTranslationToPhysics");
|
applyTranslationToPhysics = so.FindProperty("applyTranslationToPhysics");
|
||||||
applyRotationToPhysics = so.FindProperty("applyRotationToPhysics");
|
applyRotationToPhysics = so.FindProperty("applyRotationToPhysics");
|
||||||
|
physicsMovementRelativeTo = so.FindProperty("physicsMovementRelativeTo");
|
||||||
|
|
||||||
separatorSlotNames = so.FindProperty("separatorSlotNames");
|
separatorSlotNames = so.FindProperty("separatorSlotNames");
|
||||||
separatorSlotNames.isExpanded = true;
|
separatorSlotNames.isExpanded = true;
|
||||||
@ -418,6 +421,7 @@ namespace Spine.Unity.Editor {
|
|||||||
EditorGUILayout.LabelField(SpineInspectorUtility.TempContent("Physics Constraints", SpineEditorUtilities.Icons.constraintPhysics), EditorStyles.boldLabel);
|
EditorGUILayout.LabelField(SpineInspectorUtility.TempContent("Physics Constraints", SpineEditorUtilities.Icons.constraintPhysics), EditorStyles.boldLabel);
|
||||||
EditorGUILayout.PropertyField(applyTranslationToPhysics, ApplyTranslationToPhysicsLabel);
|
EditorGUILayout.PropertyField(applyTranslationToPhysics, ApplyTranslationToPhysicsLabel);
|
||||||
EditorGUILayout.PropertyField(applyRotationToPhysics, ApplyRotationToPhysicsLabel);
|
EditorGUILayout.PropertyField(applyRotationToPhysics, ApplyRotationToPhysicsLabel);
|
||||||
|
EditorGUILayout.PropertyField(physicsMovementRelativeTo, PhysicsMovementRelativeToLabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
EditorGUILayout.Space();
|
EditorGUILayout.Space();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user