public GenericMap()
            {
                m_info = ViveRoleEnum.GetInfo <TRole>();
                m_map  = GetInternalMap(typeof(TRole));

                if (s_instance == null)
                {
                    s_instance = this;
                }
                else
                {
                    UnityEngine.Debug.LogWarning("duplicated instance for RoleInfo<" + typeof(TRole).Name + ">");
                }
            }
Exemplo n.º 2
0
            public GenericMap()
            {
                m_info = ViveRoleEnum.GetInfo <TRole>();
                m_map  = GetInternalMap(typeof(TRole));

                if (s_instance == null)
                {
                    s_instance = this;
                }
                else
                {
                    Debug.LogWarning("duplicated instance for RoleInfo<" + typeof(TRole).Name + ">");
                }

                m_map.onRoleValueMappingChanged += OnMappingChanged;
            }
Exemplo n.º 3
0
            public Map(Type roleType)
            {
                m_info = ViveRoleEnum.GetInfo(roleType);

                m_role2index = new uint[m_info.ValidRoleLength];
                m_index2role = new int[VRModule.MAX_DEVICE_COUNT];

                m_roleBoundDevices = new IndexedSet <uint> [m_info.ValidRoleLength];
                m_sn2role          = new IndexedTable <string, int>(Mathf.Min(m_info.ValidRoleLength, (int)VRModule.MAX_DEVICE_COUNT));

                for (int i = 0; i < m_role2index.Length; ++i)
                {
                    m_role2index[i] = VRModule.INVALID_DEVICE_INDEX;
                }

                for (int i = 0; i < m_index2role.Length; ++i)
                {
                    m_index2role[i] = m_info.InvalidRoleValue;
                }
            }
            public Map(Type roleType)
            {
                m_info = ViveRoleEnum.GetInfo(roleType);

                m_role2index = new uint[m_info.ValidRoleLength];
                m_index2role = new int[MAX_DEVICE_COUNT];

                m_role2sn = new string[m_info.ValidRoleLength];
                m_sn2role = new Dictionary <string, int>(Mathf.Min(m_info.ValidRoleLength, (int)MAX_DEVICE_COUNT));

                for (int i = 0; i < m_role2index.Length; ++i)
                {
                    m_role2index[i] = INVALID_DEVICE_INDEX;
                    m_role2sn[i]    = string.Empty;
                }

                for (int i = 0; i < m_index2role.Length; ++i)
                {
                    m_index2role[i] = m_info.InvalidRoleValue;
                }
            }