public static Mesh[] SortMeshes(Vector3 cameraPos, GameObject gameObject) { List <Mesh> list = new List <Mesh>(); foreach (MeshFilter meshFilter in gameObject.GetComponentsInChildren <MeshFilter>(true)) { Mesh mesh = meshFilter.mesh; if (UnityGraphicObjectPool.Singleton != null) { UnityGraphicObjectPool.Singleton.AddExternalMeshIFN(mesh); } list.Add(mesh); Matrix4x4 localToWorldMatrix = meshFilter.transform.localToWorldMatrix; DiplomaticViewportUtilities.SortOneMesh(cameraPos, localToWorldMatrix, mesh); meshFilter.mesh = mesh; } foreach (SkinnedMeshRenderer skinnedMeshRenderer in gameObject.GetComponentsInChildren <SkinnedMeshRenderer>(true)) { Mesh mesh2 = UnityEngine.Object.Instantiate <Mesh>(skinnedMeshRenderer.sharedMesh); list.Add(mesh2); if (UnityGraphicObjectPool.Singleton != null) { UnityGraphicObjectPool.Singleton.AddExternalMeshIFN(mesh2); } Matrix4x4 localToWorldMatrix2 = skinnedMeshRenderer.transform.localToWorldMatrix; DiplomaticViewportUtilities.SortOneMesh(cameraPos, localToWorldMatrix2, mesh2); skinnedMeshRenderer.sharedMesh = mesh2; } return(list.ToArray()); }
public static void SetShiftingFormMaterialProperty(Renderer[] renderers, Vector4 shiftingForm) { int num = 0; while (renderers != null && num < renderers.Length) { Renderer renderer = renderers[num]; for (int i = 0; i < renderer.materials.Length; i++) { Material oneMaterial = renderer.materials[i]; DiplomaticViewportUtilities.SetShiftingFormMaterialProperty(oneMaterial, shiftingForm); } num++; } }
public static void SetFactionColorMaterialProperty(Renderer[] renderers, Color factionColor) { int num = 0; while (renderers != null && num < renderers.Length) { Renderer renderer = renderers[num]; for (int i = 0; i < renderer.materials.Length; i++) { Material oneMaterial = renderer.materials[i]; DiplomaticViewportUtilities.SetFactionColorMaterialProperty(oneMaterial, factionColor); } num++; } }
public static void SetSocketTexture(Renderer[] renderers, Texture texture) { int num = 0; while (renderers != null && num < renderers.Length) { Renderer renderer = renderers[num]; if (num > 0) { for (int i = 0; i < renderer.materials.Length; i++) { DiplomaticViewportUtilities.SetSocketTexture(renderer.materials[i], texture); } } num++; } }
public static void SetFactionColorMaterialProperty(GameObject gameObject, Color factionColor) { Renderer[] componentsInChildren = gameObject.GetComponentsInChildren <Renderer>(true); DiplomaticViewportUtilities.SetFactionColorMaterialProperty(componentsInChildren, factionColor); }
public static void SetStatusMaterialProperty(GameObject gameObject, Vector4 status) { Renderer[] componentsInChildren = gameObject.GetComponentsInChildren <Renderer>(true); DiplomaticViewportUtilities.SetStatusMaterialProperty(componentsInChildren, status); }
public static void SetSocketTexture(GameObject gameObject, Texture texture) { DiplomaticViewportUtilities.SetSocketTexture(gameObject.GetComponentsInChildren <Renderer>(true), texture); }