void OnPostprocessModel(GameObject curGO) { if (!assetPath.Contains("/Recons3DAsset/")) { return; } if (ViveSR_StaticColliderPool.ProcessDataAndGenColliderInfo(curGO) == true) { ViveSR_StaticColliderPool cldPool = curGO.AddComponent <ViveSR_StaticColliderPool>(); cldPool.OrganizeHierarchy(); } else { MeshRenderer[] rnds = curGO.GetComponentsInChildren <MeshRenderer>(true); int len = rnds.Length; for (int i = 0; i < len; ++i) { rnds[i].shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off; rnds[i].sharedMaterial.shader = Shader.Find("ViveSR/Unlit, Textured, Shadowed, Stencil"); rnds[i].gameObject.layer = LayerMask.NameToLayer(ViveSR_RigidReconstruction.ReconsMeshLayerName); //rnds[i].GetComponent<MeshFilter>().sharedMesh.RecalculateNormals(); } } }
void OnPostprocessModel(GameObject curGO) { if (!assetPath.Contains("/Recons3DAsset/")) { return; } if (ViveSR_StaticColliderPool.ProcessDataAndGenColliderInfo(curGO) == true) { ViveSR_StaticColliderPool cldPool = curGO.AddComponent <ViveSR_StaticColliderPool>(); cldPool.OrganizeHierarchy(); } else { MeshRenderer[] rnds = curGO.GetComponentsInChildren <MeshRenderer>(true); int len = rnds.Length; for (int i = 0; i < len; ++i) { rnds[i].sharedMaterial.shader = Shader.Find("Unlit/Texture"); } } }