Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: property name updated to latest XRIT API TRNG-1397 #81

Merged
merged 1 commit into from
Feb 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Editor/Innoactive.CreatorEditor.XRInteraction.asmdef
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
"name": "com.unity.xr.interaction.toolkit",
"expression": "0.10.0-preview",
"define": "XRIT_0_10_OR_NEWER"
},
{
"name": "com.unity.xr.interaction.toolkit",
"expression": "1.0.0-pre.2",
"define": "XRIT_1_0_OR_NEWER"
}
],
"noEngineReferences": false
Expand Down
21 changes: 20 additions & 1 deletion Editor/Interaction/InteractableObjectEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ internal class InteractableObjectEditor : Editor
private SerializedProperty gravityOnDetachProperty;
private SerializedProperty retainTransformParentProperty;

#if XRIT_1_0_OR_NEWER
private SerializedProperty customReticle;
#endif

private SerializedProperty onFirstHoverEntered;
private SerializedProperty onHoverEntered;
private SerializedProperty onHoverExited;
Expand Down Expand Up @@ -78,6 +82,10 @@ private static class Tooltips
public static readonly GUIContent IsGrabbable = new GUIContent("Is Grabbable", "Determines if this Interactable Object can be grabbed.");
public static readonly GUIContent IsUsable = new GUIContent("Is Usable", "Determines if this Interactable Object can be used.");
public static readonly GUIContent HighlightOptions = new GUIContent("Enable Highlighting", "Adds an InteractableHighlighter component to this Interactable.");

#if XRIT_1_0_OR_NEWER
public static readonly GUIContent CustomReticle = EditorGUIUtility.TrTextContent("Custom Reticle", "The reticle that will appear at the end of the line when it is valid.");
#endif
}

private void OnEnable()
Expand All @@ -101,9 +109,16 @@ private void OnEnable()
throwSmoothingCurveProperty = serializedObject.FindProperty("m_ThrowSmoothingCurve");
throwVelocityScaleProperty = serializedObject.FindProperty("m_ThrowVelocityScale");
throwAngularVelocityScaleProperty = serializedObject.FindProperty("m_ThrowAngularVelocityScale");
gravityOnDetachProperty = serializedObject.FindProperty("m_GravityOnDetach");
retainTransformParentProperty = serializedObject.FindProperty("m_RetainTransformParent");
interactionManager = serializedObject.FindProperty("m_InteractionManager");

#if XRIT_1_0_OR_NEWER
gravityOnDetachProperty = serializedObject.FindProperty("m_ForceGravityOnDetach");
customReticle = serializedObject.FindProperty("m_CustomReticle");
#else
gravityOnDetachProperty = serializedObject.FindProperty("m_GravityOnDetach");
#endif

#if XRIT_0_10_OR_NEWER
onFirstHoverEntered = serializedObject.FindProperty("m_OnFirstHoverEntered");
onHoverEntered = serializedObject.FindProperty("m_OnHoverEntered");
Expand Down Expand Up @@ -154,6 +169,10 @@ public override void OnInspectorGUI()
EditorGUILayout.PropertyField(interactionLayerMaskProperty, Tooltips.InteractionLayerMask);
EditorGUILayout.PropertyField(collidersProperty, Tooltips.Colliders, true);

#if XRIT_1_0_OR_NEWER
EditorGUILayout.PropertyField(customReticle, Tooltips.CustomReticle);
#endif

EditorGUILayout.Space();

EditorGUILayout.PropertyField(movementTypeProperty, Tooltips.MovementType);
Expand Down
10 changes: 5 additions & 5 deletions Editor/XRInteractionSceneSetup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

namespace Innoactive.CreatorEditor.XRInteraction
{

/// <summary>
/// Scene setup for XR-Interaction.
/// </summary>
public class XRInteractionSceneSetup : InteractionFrameworkSceneSetup
{
private const string Title = "Obsolete XR Ring detected";

private const string Message = "Creator changed the Rig loading to a new dynamic system, you still have the old XR_Setup in the current scene, do you want to delete it?";

/// <inheritdoc />
public override string Key { get; } = "XRInteractionSetup";

/// <inheritdoc />
public override void Setup()
Expand All @@ -26,9 +26,9 @@ private void DeleteStaticObject(string objectName)

if (objectToDelete != null)
{
string Message = $"Creator changed the XR Rig loading to a new dynamic system, you have a static {objectName} in the current scene, do you want to delete it?";
string message = $"Creator changed the XR Rig loading to a new dynamic system, you have a static {objectName} in the current scene, do you want to delete it?";

if (EditorUtility.DisplayDialog(Title, Message, "Delete", "Skip"))
if (EditorUtility.DisplayDialog(Title, message, "Delete", "Skip"))
{
EditorUtility.SetDirty(objectToDelete);
Object.DestroyImmediate(objectToDelete);
Expand Down
2 changes: 1 addition & 1 deletion Runtime/Rigs/XRSetupBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public abstract class XRSetupBase : InteractionRigProvider
{
protected bool IsEventManagerInScene()
{
return GameObject.FindObjectOfType<XRInteractionManager>() != null;
return Object.FindObjectOfType<XRInteractionManager>() != null;
}
}
}