private void checkWithinHandModelManager()
        {
            bool plural = targets.Length > 1;
            bool anyWithinHandPool;

            HandModelManager handModelManager = FindObjectOfType <HandModelManager>();

            if (handModelManager == null)
            {
                return;
            }

            anyWithinHandPool = targets.Query()
                                .Any(c => c.transform.parent == handModelManager.transform);

            if (anyWithinHandPool)
            {
                string message = "";
                if (plural)
                {
                    message += "One or more of the currently selected controllers ";
                }
                else
                {
                    message += "The currently selected controller ";
                }

                message += "is inside a HandModelManager. Interaction controllers, such "
                           + "as InteractionHands, are not HandModels and are not spawned by the "
                           + "HandModelManager. InteractionHands and all Interaction controllers "
                           + "should be childed to the Interaction Manager.";

                EditorGUILayout.HelpBox(message, MessageType.Error);
            }
        }
        /// <inheritdoc />
        public override void Enable()
        {
            if (leapProvider == null)
            {
                leapProvider = Hands.Provider;
            }

            if (leapProvider == null)
            {
                Debug.LogError("Leap Provider not found");
                return;
            }

            leapProvider.OnUpdateFrame += OnUpdateFrame;

            if (handModelManager == null)
            {
                handModelManager = leapProvider.GetComponentInChildren <HandModelManager>();
            }

            if (handModelManager == null)
            {
                Debug.LogWarning("Hand Model Manager not found");
                return;
            }
        }
Esempio n. 3
0
 private void Awake()
 {
     if (leapService == null)
     {
         leapService = GetComponentInChildren <LeapServiceProvider>();
     }
     if (handModelManager == null)
     {
         handModelManager = GetComponentInChildren <HandModelManager>();
     }
 }
Esempio n. 4
0
    // Use this for initialization
    void Start()
    {
        manager = GetComponent <HandModelManager>();

        if (manager == null)
        {
            Debug.LogWarning("HandModelSwitcher:  No HandModelManager component found on GameObject. Will not switch through Leap hand models.");
            return;
        }

        UpdateHands();
    }
Esempio n. 5
0
    // Start is called before the first frame update
    void Start()
    {
        MyLeapSettings   settings         = FindObjectOfType <MyLeapSettings>();
        HandModelManager handModelManager = GetComponent <HandModelManager>();

        if (settings.enableHand)
        {
            handModelManager.EnableGroup("Rigged Hands");
        }
        else
        {
            handModelManager.DisableGroup("Rigged Hands");
        }
    }
Esempio n. 6
0
        protected override void OnLoadStart()
        {
            if (leapService == null)
            {
                leapService = GetComponentInChildren <LeapServiceProvider>();
            }
            if (handModelManager == null)
            {
                handModelManager = GetComponentInChildren <HandModelManager>();
            }

            var sm = Model.First <SettingModel>();

            if (!sm.UseLeapMotion)
            {
                leapService.gameObject.SetActive(false);
                handModelManager.gameObject.SetActive(false);
            }
            SetResourceLoadComplete();
        }
Esempio n. 7
0
        void ResourcesLoad()
        {
            leapHand = ModuleManager.Instance.GetComponentInChildren <HandModelManager>();
            var hands = leapHand.GetComponentsInChildren <HandModel>(true);

            foreach (var item in hands)
            {
                Debug.Log("" + item.Handedness + " name : " + item.name);
                Rigidhands.Add(item.Handedness, item);
            }

            Rigidhands[Chirality.Left].OnBegin   += OnLeft;
            Rigidhands[Chirality.Left].OnFinish  += OffLeft;
            Rigidhands[Chirality.Right].OnBegin  += OnRight;
            Rigidhands[Chirality.Right].OnFinish += OffRight;

            if (leapHand == null)
            {
                Debug.LogError("module error");
            }
        }
Esempio n. 8
0
 // Use this for initialization
 void Start()
 {
     HandPool = GetComponent <HandModelManager>();
     disableAllGroups();
     CurrentGroup = 0;
 }