public static NetInfo SetAllSegmentsTexture(this NetInfo info, TexturesSet newTextures, TexturesSet newLODTextures = null)
        {
            foreach (var segment in info.m_segments)
            {
                segment.SetTextures(newTextures, newLODTextures);
            }

            return(info);
        }
        public static NetInfo SetAllNodesTexture(this NetInfo info, TexturesSet newTextures, TexturesSet newLODTextures = null)
        {
            foreach (var node in info.m_nodes)
            {
                node.SetTextures(newTextures, newLODTextures);
            }

            return info;
        }
예제 #3
0
        public static NetInfo SetAllNodesTexture(this NetInfo info, TexturesSet newTextures, TexturesSet newLODTextures = null)
        {
            foreach (var node in info.m_nodes)
            {
                node.SetTextures(newTextures, newLODTextures);
            }

            return(info);
        }
        public static NetInfo SetAllSegmentsTexture(this NetInfo info, TexturesSet newTextures, TexturesSet newLODTextures = null)
        {
            foreach (var segment in info.m_segments)
            {
                segment.SetTextures(newTextures, 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.Segment SetTextures(this NetInfo.Segment segment, TexturesSet newTextures, TexturesSet newLODTextures = null)
        {
            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(segment);
        }
예제 #8
0
        public static NetInfo.Node SetTextures(this NetInfo.Node node, TexturesSet newTextures, TexturesSet newLODTextures = null)
        {
            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(node);
        }
        public static NetInfo.Node SetTextures(this NetInfo.Node node, TexturesSet newTextures, TexturesSet newLODTextures = null)
        {
            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 node;
        }
        public static NetInfo.Segment SetTextures(this NetInfo.Segment segment, TexturesSet newTextures, TexturesSet newLODTextures = null)
        {
            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 segment;
        }