コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 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;
         }
     }
 }