Beispiel #1
0
 /// <summary>
 /// Handles the event for touchpad gesture start. Changes level of detail
 /// if gesture is swipe up.
 /// </summary>
 /// <param name="controllerId">The id of the controller.</param>
 /// <param name="gesture">The gesture getting started.</param>
 private void OnTouchpadGestureStart(byte controllerId, MLInput.Controller.TouchpadGesture gesture)
 {
     #if PLATFORM_LUMIN
     if (_controllerConnectionHandler.IsControllerValid(controllerId) &&
         gesture.Type == MLInput.Controller.TouchpadGesture.GestureType.Swipe && gesture.Direction == MLInput.Controller.TouchpadGesture.GestureDirection.Up)
     {
         #if UNITY_2019_3_OR_NEWER
         _mlSpatialMapper.density = MLSpatialMapper.LevelOfDetailToDensity((MLSpatialMapper.DensityToLevelOfDetail(_mlSpatialMapper.density) == MLSpatialMapper.LevelOfDetail.Maximum) ? MLSpatialMapper.LevelOfDetail.Minimum : (MLSpatialMapper.DensityToLevelOfDetail(_mlSpatialMapper.density) + 1));
         #else
         _mlSpatialMapper.levelOfDetail = ((_mlSpatialMapper.levelOfDetail == MLSpatialMapper.LevelOfDetail.Maximum) ? MLSpatialMapper.LevelOfDetail.Minimum : (_mlSpatialMapper.levelOfDetail + 1));
         #endif
     }
     #endif
 }
Beispiel #2
0
        void CacheSerializedProperties()
        {
            m_MeshPrefab                = this.serializedObject.FindProperty("m_MeshPrefab");
            m_ComputeNormals            = this.serializedObject.FindProperty("m_ComputeNormals");
            m_Density                   = this.serializedObject.FindProperty("m_Density");
            m_MeshParent                = this.serializedObject.FindProperty("m_MeshParent");
            m_MeshType                  = this.serializedObject.FindProperty("m_RequestedMeshType");
            m_FillHoleLength            = this.serializedObject.FindProperty("m_FillHoleLength");
            m_MeshQueueSize             = this.serializedObject.FindProperty("m_MeshQueueSize");
            m_PollingRate               = this.serializedObject.FindProperty("m_PollingRate");
            m_BatchSize                 = this.serializedObject.FindProperty("m_BatchSize");
            m_Planarize                 = this.serializedObject.FindProperty("m_Planarize");
            m_DisconnectedComponentArea = this.serializedObject.FindProperty("m_DisconnectedComponentArea");
            m_RequestVertexConfidence   = this.serializedObject.FindProperty("m_RequestVertexConfidence");
            m_RemoveMeshSkirt           = this.serializedObject.FindProperty("m_RemoveMeshSkirt");

            SerializedProperty legacyLod = this.serializedObject.FindProperty("m_LevelOfDetail");

            if (legacyLod != null)
            {
                m_Density.floatValue = MLSpatialMapper.LevelOfDetailToDensity((MLSpatialMapper.LevelOfDetail)legacyLod.intValue);
            }
        }