Exemple #1
0
    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());
    }
Exemple #2
0
    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++;
        }
    }
Exemple #3
0
    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++;
        }
    }
Exemple #4
0
    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++;
        }
    }
Exemple #5
0
 public static void SetFactionColorMaterialProperty(GameObject gameObject, Color factionColor)
 {
     Renderer[] componentsInChildren = gameObject.GetComponentsInChildren <Renderer>(true);
     DiplomaticViewportUtilities.SetFactionColorMaterialProperty(componentsInChildren, factionColor);
 }
Exemple #6
0
 public static void SetStatusMaterialProperty(GameObject gameObject, Vector4 status)
 {
     Renderer[] componentsInChildren = gameObject.GetComponentsInChildren <Renderer>(true);
     DiplomaticViewportUtilities.SetStatusMaterialProperty(componentsInChildren, status);
 }
Exemple #7
0
 public static void SetSocketTexture(GameObject gameObject, Texture texture)
 {
     DiplomaticViewportUtilities.SetSocketTexture(gameObject.GetComponentsInChildren <Renderer>(true), texture);
 }