コード例 #1
0
 public void UnregisterMesh(LibiglMesh libiglMesh)
 {
     if (AllMeshes.Contains(libiglMesh))
     {
         AllMeshes.Remove(libiglMesh);
     }
 }
コード例 #2
0
        private static void DestroyActiveMesh()
        {
            if (!ActiveMesh)
            {
                return;
            }

            Destroy(ActiveMesh.gameObject);
            ActiveMesh = null;
        }
コード例 #3
0
        /// <summary>
        /// Create a behaviour for the <see cref="Mesh"/> <see cref="MonoBehaviour"/> component.
        /// Every Mesh has one behaviour.
        /// </summary>
        public LibiglBehaviour(LibiglMesh libiglMesh)
        {
            Mesh = libiglMesh;

            // Initialize C++ and create the State from the DataRowMajor
            State = Native.InitializeMesh(libiglMesh.DataRowMajor.GetNative(), Mesh.name);
            Input = MeshInputState.GetInstance();

            _uiDetails = UiManager.get.CreateDetailsPanel();
            _uiDetails.Initialize(this);
        }
コード例 #4
0
        public static void SetActiveMesh(LibiglMesh libiglMesh)
        {
            if (ActiveMesh == libiglMesh)
            {
                return;
            }

            if (ActiveMesh)
            {
                ActiveMesh.gameObject.layer = _defaultLayer;
            }
            libiglMesh.gameObject.layer = _holographicLayer;

            ActiveMesh = libiglMesh;
            OnActiveMeshChanged();
        }
コード例 #5
0
        /// <summary>
        /// Use this to delete a mesh safely.
        /// Handles case when mesh is the active one, <see cref="ActiveMesh"/>
        /// </summary>
        public void DestroyMesh(LibiglMesh libiglMesh)
        {
            if (ActiveMesh == libiglMesh)
            {
                // Assign new active mesh
                foreach (var mesh in AllMeshes.Where(mesh => mesh != ActiveMesh))
                {
                    SetActiveMesh(mesh);
                    break;
                }
            }

            if (ActiveMesh == libiglMesh)
            {
                LoadMesh(meshPrefabs[0]);
            }

            Destroy(libiglMesh.gameObject);
        }
コード例 #6
0
 public void RegisterMesh(LibiglMesh libiglMesh)
 {
     AllMeshes.Add(libiglMesh);
 }