private FootTarget GetFootTarget(HandInput settings) { if (settings == null) { return(null); } FootTarget handTarget = settings.GetComponent <FootTarget>(); if (handTarget == null) { handTarget = settings.transform.parent.GetComponent <FootTarget>(); } return(handTarget); }
private HandTarget GetHandTarget(HandInput handInput) { if (handInput == null) { return(null); } HandTarget handTarget = handInput.GetComponent <HandTarget>(); if (handTarget == null) { handTarget = handInput.transform.parent.GetComponent <HandTarget>(); } return(handTarget); }
private void HandTargetInspector(HandInput handInput) { if (handInput.handTarget == null) { handInput.handTarget = handInput.GetComponent <HandTarget>(); if (handInput.handTarget == null) { handTargetProp.objectReferenceValue = (HandTarget)EditorGUILayout.ObjectField("Hand Target", handTargetProp.objectReferenceValue, typeof(HandTarget), true); if (handTargetProp.objectReferenceValue == null && handInput.transform.parent != null) { handTargetProp.objectReferenceValue = handInput.transform.parent.GetComponent <HandTarget>(); } handInput.handTarget = (HandTarget)handTargetProp.objectReferenceValue; } } }