Ejemplo n.º 1
0
        public override void StartController(InstantVR ivr)
        {
            base.StartController(ivr);
            tracking = true;

            handAnimator = GetComponent <IVR_AnimatorHand>();
        }
Ejemplo n.º 2
0
        public override void StartController(InstantVR ivr)
        {
            extension = ivr.GetComponent <IVR_Traditional>();
            base.StartController(ivr);
            tracking = true;

            handAnimator = GetComponent <IVR_AnimatorHand>();
        }
Ejemplo n.º 3
0
        public override void StartController(InstantVR ivr)
        {
            extension = ivr.GetComponent <IVR_Traditional>();
            base.StartController(ivr);
            tracking = true;

            handAnimator = GetComponent <IVR_AnimatorHand>();
#if INSTANTVR_ADVANCED
            handMovements = GetComponent <IVR_HandMovementsBase>();
#endif
        }
Ejemplo n.º 4
0
        void OnDestroy()
        {
            InstantVR ivr = this.GetComponent <InstantVR>();

            if (ivr != null)
            {
                IVR_AnimatorHead defaultHead = ivr.headTarget.GetComponent <IVR_AnimatorHead>();
                if (defaultHead != null)
                {
                    DestroyImmediate(defaultHead);
                }

                IVR_AnimatorHand defaultLeftHand = ivr.leftHandTarget.GetComponent <IVR_AnimatorHand>();
                if (defaultLeftHand != null)
                {
                    DestroyImmediate(defaultLeftHand);
                }

                IVR_AnimatorHand defaultRightHand = ivr.rightHandTarget.GetComponent <IVR_AnimatorHand>();
                if (defaultRightHand != null)
                {
                    DestroyImmediate(defaultRightHand);
                }

                IVR_AnimatorHip defaultHip = ivr.hipTarget.GetComponent <IVR_AnimatorHip>();
                if (defaultHip != null)
                {
                    DestroyImmediate(defaultHip);
                }

                IVR_AnimatorFoot defaultLeftFoot = ivr.leftFootTarget.GetComponent <IVR_AnimatorFoot>();
                if (defaultLeftFoot != null)
                {
                    DestroyImmediate(defaultLeftFoot);
                }

                IVR_AnimatorFoot defaultRightFoot = ivr.rightFootTarget.GetComponent <IVR_AnimatorFoot>();
                if (defaultRightFoot != null)
                {
                    DestroyImmediate(defaultRightFoot);
                }
            }
        }
Ejemplo n.º 5
0
        void OnDestroy()
        {
            if (ivranimator == null && ivr != null)
            {
                animatorHead = ivr.headTarget.GetComponent <IVR_AnimatorHead>();
                if (animatorHead != null)
                {
                    DestroyImmediate(animatorHead, true);
                }

                animatorLeftHand = ivr.leftHandTarget.GetComponent <IVR_AnimatorHand>();
                if (animatorLeftHand != null)
                {
                    DestroyImmediate(animatorLeftHand, true);
                }

                animatorRightHand = ivr.rightHandTarget.GetComponent <IVR_AnimatorHand>();
                if (animatorRightHand != null)
                {
                    DestroyImmediate(animatorRightHand, true);
                }

                animatorHip = ivr.hipTarget.GetComponent <IVR_AnimatorHip>();
                if (animatorHip != null)
                {
                    DestroyImmediate(animatorHip, true);
                }

                animatorLeftFoot = ivr.leftFootTarget.GetComponent <IVR_AnimatorFoot>();
                if (animatorLeftFoot != null)
                {
                    DestroyImmediate(animatorLeftFoot, true);
                }

                animatorRightFoot = ivr.rightFootTarget.GetComponent <IVR_AnimatorFoot>();
                if (animatorRightFoot != null)
                {
                    DestroyImmediate(animatorRightFoot, true);
                }
            }
        }
Ejemplo n.º 6
0
        void OnEnable()
        {
            ivranimator = (IVR_Animator)target;
            if (!ivranimator)
            {
                return;
            }

            ivr = ivranimator.GetComponent <InstantVR>();

            if (ivr != null)
            {
                animatorHead = ivr.headTarget.GetComponent <IVR_AnimatorHead>();
                if (animatorHead == null)
                {
                    animatorHead           = ivr.headTarget.gameObject.AddComponent <IVR_AnimatorHead>();
                    animatorHead.extension = ivranimator;
                }

                animatorLeftHand = ivr.leftHandTarget.GetComponent <IVR_AnimatorHand>();
                if (animatorLeftHand == null)
                {
                    animatorLeftHand           = ivr.leftHandTarget.gameObject.AddComponent <IVR_AnimatorHand>();
                    animatorLeftHand.extension = ivranimator;
                }

                animatorRightHand = ivr.rightHandTarget.GetComponent <IVR_AnimatorHand>();
                if (animatorRightHand == null)
                {
                    animatorRightHand           = ivr.rightHandTarget.gameObject.AddComponent <IVR_AnimatorHand>();
                    animatorRightHand.extension = ivranimator;
                }

                animatorHip = ivr.hipTarget.GetComponent <IVR_AnimatorHip>();
                if (animatorHip == null)
                {
                    animatorHip           = ivr.hipTarget.gameObject.AddComponent <IVR_AnimatorHip>();
                    animatorHip.extension = ivranimator;
                }

                animatorLeftFoot = ivr.leftFootTarget.GetComponent <IVR_AnimatorFoot>();
                if (animatorLeftFoot == null)
                {
                    animatorLeftFoot           = ivr.leftFootTarget.gameObject.AddComponent <IVR_AnimatorFoot>();
                    animatorLeftFoot.extension = ivranimator;
                }

                animatorRightFoot = ivr.rightFootTarget.GetComponent <IVR_AnimatorFoot>();
                if (animatorRightFoot == null)
                {
                    animatorRightFoot           = ivr.rightFootTarget.gameObject.AddComponent <IVR_AnimatorFoot>();
                    animatorRightFoot.extension = ivranimator;
                }

                IVR_Extension[] extensions = ivr.GetComponents <IVR_Extension>();
                if (ivranimator.priority == -1)
                {
                    ivranimator.priority = extensions.Length - 1;
                }
                for (int i = 0; i < extensions.Length; i++)
                {
                    if (ivranimator == extensions[i])
                    {
                        while (i < ivranimator.priority)
                        {
                            MoveUp(animatorHead);
                            MoveUp(animatorLeftHand);
                            MoveUp(animatorRightHand);
                            MoveUp(animatorHip);
                            MoveUp(animatorLeftFoot);
                            MoveUp(animatorRightFoot);
                            ivranimator.priority--;
                            //Debug.Log ("Animator Move up to : " + i + " now: " + ivranimator.priority);
                        }
                        while (i > ivranimator.priority)
                        {
                            MoveDown(animatorHead);
                            MoveDown(animatorLeftHand);
                            MoveDown(animatorRightHand);
                            MoveDown(animatorHip);
                            MoveDown(animatorLeftFoot);
                            MoveDown(animatorRightFoot);
                            ivranimator.priority++;
                            //Debug.Log ("Animator Move down to : " + i + " now: " + ivranimator.priority);
                        }
                    }
                }
            }
        }