示例#1
0
        public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
        {
            var particleEffectSizeOverLifetime = new ParticleSizeOverLifetime {
                curveRef = SampledAnimationCurve.ConstructBlobAssetReference(curve, samples)
            };

            dstManager.AddComponentData(entity, particleEffectSizeOverLifetime);
        }
 void Start()
 {
     originShift = GameObject.FindGameObjectWithTag("World").GetComponent <OriginShift>();
     strongDisplacementCurveLUT = new SampledAnimationCurve(strongDisplacementCurve, 256);
     worldTransform             = GetComponent <Transform>();
     jobHandles             = new List <JobHandle>();
     jobs                   = new List <TerrainGenerationJob>();
     playerTransform        = GameObject.FindGameObjectWithTag("MainCamera").transform;
     xseed                  = (int)(seed / 46340.95000105199);
     yseed                  = (int)(seed % 46340.95000105199);
     relativePlayerPosition = new Vector2((int)(playerTransform.position.x / chunkDimensions + 2344), (int)(playerTransform.position.z / chunkDimensions + 2344));
     precaculatedTris       = PrecaculateTris();
     sceneryPlacer          = GetComponent <SceneryPlacer>();
     vertexIndexToPosition  = 1f / (verticesPerEdge - 1) * chunkDimensions;
 }
        public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
        {
            var sizeOverLifetime = new SizeOverLifetime {
                curveRef = SampledAnimationCurve.ConstructBlobAssetReference(curve, samples)
            };

            var localScale = transform.localScale;
            var sizeValue  = (localScale.x + localScale.y + localScale.z) * (1.0f / 3.0f);

            dstManager.AddComponentData(entity, new SizeReference {
                value = sizeValue
            });
            dstManager.AddComponentData(entity, new NonUniformScale {
                Value = sizeOverLifetime.curveRef.Value.Evaluate(0.0f) * sizeValue
            });
            dstManager.AddComponentData(entity, sizeOverLifetime);
        }
示例#4
0
 //This script is a dependency of TerrainGenerator. It servers the purpose to Seperate the scenery object instanciation and variables from the chunk mesh generation and job management.
 //Essentialy it supplies the terrain Generator with the Necessary variables and Applies the variables it gets from it to new Game Objects
 private void Start()
 {
     stoneQuantityDistributionCurveLUT = new SampledAnimationCurve(stoneQuantityDistributionCurve, 256);
     stoneSizeDistributuionCurveLUT    = new SampledAnimationCurve(stoneSizeDistributuionCurve, 256);
 }