// Precache meshes at awake void AwakePrecache() { if (demolitionType == DemolitionType.AwakePrecache && objectType == ObjectType.Mesh) { RFDemolitionMesh.CacheInstant(this); } }
// Predefine fragments void AwakePrefragment() { if (demolitionType == DemolitionType.AwakePrefragment && objectType == ObjectType.Mesh) { // Cache meshes RFDemolitionMesh.CacheInstant(this); // Predefine fragments Prefragment(); } }
// Precache meshes in editor public void ManualPrecache() { if (demolitionType == DemolitionType.ManualPrecache && objectType == ObjectType.Mesh) { // Set components SetComponentsBasic(); // Set components SetComponentsPhysics(); // Cache meshes RFDemolitionMesh.CacheInstant(this); } else if (demolitionType == DemolitionType.ManualPrecache && objectType != ObjectType.Mesh) { Debug.Log("RayFire Rigid: " + name + " Object Type is not Mesh. Set to Mesh type to Precache.", gameObject); } }
// Precache meshes for prefab in editor public void PrefabPrecache() { if (demolitionType == DemolitionType.ManualPrefabPrecache && objectType == ObjectType.Mesh) { // Set components for mesh / skinned mesh / clusters SetComponentsBasic(); // Cache meshes RFDemolitionMesh.CacheInstant(this); // Convert meshes to RFmeshes if (HasMeshes == true) { rfMeshes = new RFMesh[meshes.Length]; for (int i = 0; i < meshes.Length; i++) { rfMeshes[i] = new RFMesh(meshes[i], meshDemolition.compressPrefab); } } meshes = null; } }