public void UnregisterMesh(LibiglMesh libiglMesh) { if (AllMeshes.Contains(libiglMesh)) { AllMeshes.Remove(libiglMesh); } }
private static void DestroyActiveMesh() { if (!ActiveMesh) { return; } Destroy(ActiveMesh.gameObject); ActiveMesh = null; }
/// <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); }
public static void SetActiveMesh(LibiglMesh libiglMesh) { if (ActiveMesh == libiglMesh) { return; } if (ActiveMesh) { ActiveMesh.gameObject.layer = _defaultLayer; } libiglMesh.gameObject.layer = _holographicLayer; ActiveMesh = libiglMesh; OnActiveMeshChanged(); }
/// <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); }
public void RegisterMesh(LibiglMesh libiglMesh) { AllMeshes.Add(libiglMesh); }