public static NetInfo SetSegmentsTexture(this NetInfo info, TexturesSet newTextures, TexturesSet newLODTextures = null)
        {
            foreach (var segment in info.m_segments)
            {
                if (segment.m_material != null)
                {
                    segment.m_material = segment.m_material.Clone(newTextures);
                }

                if (segment.m_segmentMaterial != null)
                {
                    segment.m_segmentMaterial = segment.m_segmentMaterial.Clone(newTextures);
                }

                if (segment.m_lodMaterial != null)
                {
                    if (newLODTextures != null)
                    {
                        segment.m_lodMaterial = segment.m_lodMaterial.Clone(newLODTextures);
                    }
                }
            }

            return info;
        }
Beispiel #2
0
        public static NetInfo SetNodesTexture(this NetInfo info, TexturesSet newTextures, TexturesSet newLODTextures = null)
        {
            foreach (var node in info.m_nodes)
            {
                if (node.m_material != null)
                {
                    node.m_material = node.m_material.Clone(newTextures);
                }

                if (node.m_nodeMaterial != null)
                {
                    node.m_nodeMaterial = node.m_nodeMaterial.Clone(newTextures);
                }

                if (node.m_lodMaterial != null)
                {
                    if (newLODTextures != null)
                    {
                        node.m_lodMaterial = node.m_lodMaterial.Clone(newLODTextures);
                    }
                }
            }

            return(info);
        }
Beispiel #3
0
        public static NetInfo SetSegmentsTexture(this NetInfo info, TexturesSet newTextures, TexturesSet newLODTextures = null)
        {
            foreach (var segment in info.m_segments)
            {
                if (segment.m_material != null)
                {
                    segment.m_material = segment.m_material.Clone(newTextures);
                }

                if (segment.m_segmentMaterial != null)
                {
                    segment.m_segmentMaterial = segment.m_segmentMaterial.Clone(newTextures);
                }

                if (segment.m_lodMaterial != null)
                {
                    if (newLODTextures != null)
                    {
                        segment.m_lodMaterial = segment.m_lodMaterial.Clone(newLODTextures);
                    }
                }
            }

            return(info);
        }
        public static Material Clone(this Material originalMaterial, TexturesSet newTextures)
        {
            var material = UnityEngine.Object.Instantiate(originalMaterial);

            {
                material.ModifyTexture("_MainTex", newTextures.MainTex);
            }

            if (newTextures.XYSMap != null)
            {
                material.ModifyTexture("_XYSMap", newTextures.XYSMap);
            }

            if (newTextures.APRMap != null)
            {
                material.ModifyTexture("_APRMap", newTextures.APRMap);
            }

            return material;
        }
        public static Material Clone(this Material originalMaterial, TexturesSet newTextures)
        {
            var material = UnityEngine.Object.Instantiate(originalMaterial);

            {
                material.ModifyTexture("_MainTex", newTextures.MainTex);
            }

            if (newTextures.XYSMap != null)
            {
                material.ModifyTexture("_XYSMap", newTextures.XYSMap);
            }

            if (newTextures.APRMap != null)
            {
                material.ModifyTexture("_APRMap", newTextures.APRMap);
            }

            return(material);
        }
        public static NetInfo SetNodesTexture(this NetInfo info, TexturesSet newTextures, TexturesSet newLODTextures = null)
        {
            foreach (var node in info.m_nodes)
            {
                if (node.m_material != null)
                {
                    node.m_material = node.m_material.Clone(newTextures);
                }

                if (node.m_nodeMaterial != null)
                {
                    node.m_nodeMaterial = node.m_nodeMaterial.Clone(newTextures);
                }

                if (node.m_lodMaterial != null)
                {
                    if (newLODTextures != null)
                    {
                        node.m_lodMaterial = node.m_lodMaterial.Clone(newLODTextures);
                    }
                }
            }

            return info;
        }