예제 #1
0
        private void InitShaper()
        {
            var shaperData = new BiomShaperData();

            shaperData.GrowthSpeed = GrowthCoeficient;
            shaperData.Owner       = this;
            shaperData.Padding     = Padding;
            shaperData.Plane       = Plane;

            _shaper = new BiomShaper(shaperData);
            _biomeComponents.Add(_shaper);
        }
예제 #2
0
        public BiomShaper(BiomShaperData data)
        {
            _plane                = data.Plane;
            _owner                = data.Owner;
            _surfaceFilter        = data.Owner.Surface.GetComponent <MeshRenderer> ();
            _selfCollider         = _plane.GetComponent <MeshCollider> ();
            _planeMeshFinter      = _plane.GetComponent <MeshFilter> ();
            _selfMapLength        = Mathf.Sqrt(_planeMeshFinter.mesh.vertices.Length);
            _mapGeneratorInstance = GameObject.FindObjectOfType <MapGenerator> ();

            Padding     = data.Padding;
            GrowthSpeed = data.GrowthSpeed;
        }