Example #1
0
        /// <summary>
        /// Clone Constructor
        /// </summary>
        /// <param name="lbTerrainTexture"></param>
        public LBTerrainTexture(LBTerrainTexture lbTerrainTexture)
        {
            this.texture   = lbTerrainTexture.texture;
            this.normalMap = lbTerrainTexture.normalMap;
            this.heightMap = lbTerrainTexture.heightMap;
            if (lbTerrainTexture.textureName == null)
            {
                this.textureName = string.Empty;
            }
            else
            {
                this.textureName = lbTerrainTexture.textureName;
            }
            if (lbTerrainTexture.normalMapName == null)
            {
                this.normalMapName = string.Empty;
            }
            else
            {
                this.normalMapName = lbTerrainTexture.normalMapName;
            }
            this.tileSize               = lbTerrainTexture.tileSize;
            this.smoothness             = lbTerrainTexture.smoothness;
            this.metallic               = lbTerrainTexture.metallic;
            this.minHeight              = lbTerrainTexture.minHeight;
            this.maxHeight              = lbTerrainTexture.maxHeight;
            this.minInclination         = lbTerrainTexture.minInclination;
            this.maxInclination         = lbTerrainTexture.maxInclination;
            this.strength               = lbTerrainTexture.strength;
            this.texturingMode          = lbTerrainTexture.texturingMode;
            this.isCurvatureConcave     = lbTerrainTexture.isCurvatureConcave;
            this.curvatureDistance      = lbTerrainTexture.curvatureDistance;
            this.curvatureMinHeightDiff = lbTerrainTexture.curvatureMinHeightDiff;
            this.map                          = lbTerrainTexture.map;
            this.mapColour                    = lbTerrainTexture.mapColour;
            this.isDisabled                   = lbTerrainTexture.isDisabled;
            this.mapTolerance                 = lbTerrainTexture.mapTolerance;
            this.useNoise                     = lbTerrainTexture.useNoise;
            this.noiseTileSize                = lbTerrainTexture.noiseTileSize;
            this.isMinimalBlendingEnabled     = lbTerrainTexture.isMinimalBlendingEnabled;
            this.mapInverse                   = lbTerrainTexture.mapInverse;
            this.useAdvancedMapTolerance      = lbTerrainTexture.useAdvancedMapTolerance;
            this.mapToleranceRed              = lbTerrainTexture.mapToleranceRed;
            this.mapToleranceGreen            = lbTerrainTexture.mapToleranceGreen;
            this.mapToleranceBlue             = lbTerrainTexture.mapToleranceBlue;
            this.mapToleranceAlpha            = lbTerrainTexture.mapToleranceAlpha;
            this.mapWeightRed                 = lbTerrainTexture.mapWeightRed;
            this.mapWeightGreen               = lbTerrainTexture.mapWeightGreen;
            this.mapWeightBlue                = lbTerrainTexture.mapWeightBlue;
            this.mapWeightAlpha               = lbTerrainTexture.mapWeightAlpha;
            this.mapToleranceBlendCurvePreset = lbTerrainTexture.mapToleranceBlendCurvePreset;
            this.mapToleranceBlendCurve       = lbTerrainTexture.mapToleranceBlendCurve;
            this.mapIsPath                    = lbTerrainTexture.mapIsPath;
            this.isTinted                     = lbTerrainTexture.isTinted;
            this.tintColour                   = lbTerrainTexture.tintColour;
            this.tintStrength                 = lbTerrainTexture.tintStrength;
            this.tintedTexture                = lbTerrainTexture.tintedTexture;
            this.isRotated                    = lbTerrainTexture.isRotated;
            this.rotationAngle                = lbTerrainTexture.rotationAngle;
            this.rotatedTexture               = lbTerrainTexture.rotatedTexture;
            this.showTexture                  = lbTerrainTexture.showTexture;
            this.noiseOffset                  = lbTerrainTexture.noiseOffset;
            if (lbTerrainTexture.filterList != null)
            {
                this.filterList = new List <LBTextureFilter>(lbTerrainTexture.filterList);
            }
            else
            {
                this.filterList = new List <LBTextureFilter>();
            }

            if (lbTerrainTexture.lbTerrainDataList == null)
            {
                this.lbTerrainDataList = null;
            }
            else
            {
                this.lbTerrainDataList = new List <LBTerrainData>(lbTerrainTexture.lbTerrainDataList);
            }

            lbTerrainTexture.blendCurveMode = BlendCurveMode.Auto;

            this.GUID = lbTerrainTexture.GUID;
        }
Example #2
0
        // Class constructor
        public LBTerrainTexture()
        {
            this.texture        = null;
            this.normalMap      = null;
            this.heightMap      = null;
            this.tileSize       = Vector2.one * 25f;
            this.smoothness     = 0f;
            this.metallic       = 0f;
            this.minHeight      = 0.25f;
            this.maxHeight      = 0.75f;
            this.minInclination = 0f;
            this.maxInclination = 30f;
            this.strength       = 1f;
            // v2.0.6 Beta 5a changed default from Height to ConstantInfluence
            this.texturingMode = TexturingMode.ConstantInfluence;

            // Added v2.0.7 Beta 6
            this.isCurvatureConcave     = false;
            this.curvatureMinHeightDiff = 1f;
            this.curvatureDistance      = 5f;

            // Added v1.4.2 Beta 5b
            this.textureName   = string.Empty;
            this.normalMapName = string.Empty;

            // Added v1.1 Beta 4-9
            this.map           = null;
            this.mapColour     = UnityEngine.Color.red;
            this.isDisabled    = false;
            this.mapTolerance  = 1;
            this.useNoise      = true;
            this.noiseTileSize = 100f;

            // Added v1.2 Beta 3
            this.isMinimalBlendingEnabled = false;

            // Added v1.2 Beta 12
            this.mapInverse = false;

            // Added v1.3.1 Beta 8f
            this.useAdvancedMapTolerance      = false;
            this.mapToleranceRed              = 0;
            this.mapToleranceGreen            = 0;
            this.mapToleranceBlue             = 0;
            this.mapToleranceAlpha            = 0;
            this.mapWeightRed                 = 1f;
            this.mapWeightGreen               = 1f;
            this.mapWeightBlue                = 1f;
            this.mapWeightAlpha               = 1f;
            this.mapToleranceBlendCurvePreset = (LBCurve.BlendCurvePreset)LBCurve.CurvePreset.Cubed;
            this.mapToleranceBlendCurve       = LBCurve.SetCurveFromPreset((LBCurve.CurvePreset) this.mapToleranceBlendCurvePreset);

            // Added 1.3.2 Beta 5h
            this.mapIsPath = false;

            // Added 1.3.2 Beta 2e
            this.isTinted      = false;
            this.tintColour    = UnityEngine.Color.clear;
            this.tintStrength  = 0.5f;
            this.tintedTexture = null;

            // Added 1.3.2 Beta 7c
            this.isRotated      = false;
            this.rotationAngle  = 0f;
            this.rotatedTexture = null;

            // Added v1.3.0 Beta 3a
            this.showTexture = true;

            // Added v1.4.2 Beta 4a
            this.lbTerrainDataList = null;

            // Noise offset cannot be modified from the editor as it is randomly set when the terrain is textured

            // Added v2.0.0
            // Assign a unique identifier
            GUID = System.Guid.NewGuid().ToString();

            // Added v2.2.4
            blendCurveMode = BlendCurveMode.BlendMinMaxValues;
        }