예제 #1
0
        public bool Init()
        {
            TXRDebugger.Log("NativeController start init:");
            int count = GetControllerCount();

            TXRDebugger.Log("__controller count:" + count);
            for (int i = 0; i < count; i++)
            {
                m_StateHandles[i] = 1;
            }
            return(true);
        }
 new void Awake()
 {
     base.Awake();
     if (isDirty)
     {
         return;
     }
     #if !UNITY_EDITOR
     TXRDebugger.EnableLog = Debug.isDebugBuild;
     #endif
     TXRDebugger.Log("[TXRSessionBehaviour Awake: CreateSession]");
     TXRSessionManager.Instance.CreateSession(this);
 }
예제 #3
0
        internal void SetCameraPermission()
        {
            var manifest = SelectSingleNode("/manifest");

            if (!manifest.InnerXml.Contains("android.permission.CAMERA"))
            {
                XmlElement child = CreateElement("uses-permission");
                manifest.AppendChild(child);
                XmlAttribute newAttribute = CreateAndroidAttribute("name", "android.permission.CAMERA");
                child.Attributes.Append(newAttribute);
            }
            else
            {
                TXRDebugger.Log("Already has the camera permission.");
            }
        }
예제 #4
0
        internal void SetBlueToothPermission()
        {
            var manifest = SelectSingleNode("/manifest");

            if (!manifest.InnerXml.Contains("android.permission.BLUETOOTH"))
            {
                XmlElement child = CreateElement("uses-permission");
                manifest.AppendChild(child);
                XmlAttribute newAttribute = CreateAndroidAttribute("name", "android.permission.BLUETOOTH");
                child.Attributes.Append(newAttribute);
                newAttribute = CreateAndroidAttribute("name", "android.permission.BLUETOOTH_ADMIN");
                child.Attributes.Append(newAttribute);
            }
            else
            {
                TXRDebugger.Log("Already has the bluetooth permission.");
            }
        }
예제 #5
0
        private void InitNativeController()
        {
            m_NativeController = new NativeController();
            if (m_NativeController.Init())
            {
                Inited = true;
                TXRDebugger.Log("TXRControllerProvider Init Succeed");
            }
            else
            {
                m_NativeController = null;
                TXRDebugger.LogError("TXRControllerProvider Init Failed !!");
            }

#if !UNITY_EDITOR
            Debug.Log("[TXRInput] version:" + GetVersion(0));
#endif
            m_NeedInit = false;
        }
예제 #6
0
        public void CreateSession(TXRSessionBehaviour session)
        {
            if (IsInitialized || null == session)
            {
                return;
            }
            if (null != TXRSessionBehaviour)
            {
                TXRDebugger.LogError("Multiple SessionBehaviour components cannot exist in the scene. " +
                                     "Destroying the newest.");
                GameObject.DestroyImmediate(session.gameObject);
                return;
            }

            SessionStatus       = TXRSessionState.CREATED;
            TXRSessionBehaviour = session;

            TXRHMDPoseTracker = session.GetComponent <TXRHMDPoseTracker>();

            // So far, we only have 3DoF Tracking
            SetTrackingMode(TXRHMDPoseTracker.TrackingType.TRACKINGTYPE_3DOF);
        }