// Token: 0x06000C79 RID: 3193 RVA: 0x0005D3F4 File Offset: 0x0005B7F4
        public void bakeFoliageSurface(FoliageBakeSettings bakeSettings, FoliageTile foliageTile)
        {
            FoliageInfoCollectionAsset foliageInfoCollectionAsset = Assets.find <FoliageInfoCollectionAsset>(this.foliage);

            if (foliageInfoCollectionAsset == null)
            {
                return;
            }
            bool activeSelf = base.gameObject.activeSelf;

            if (!activeSelf)
            {
                base.gameObject.SetActive(true);
            }
            Bounds  worldBounds = foliageTile.worldBounds;
            Vector3 min         = worldBounds.min;
            Vector3 max         = worldBounds.max;
            Bounds  bounds      = this.surfaceCollider.bounds;
            Vector3 min2        = bounds.min;
            Vector3 max2        = bounds.max;

            foliageInfoCollectionAsset.bakeFoliage(bakeSettings, this, new Bounds
            {
                min = new Vector3(Mathf.Max(min.x, min2.x), min2.y, Mathf.Max(min.z, min2.z)),
                max = new Vector3(Mathf.Min(max.x, max2.x), max2.y, Mathf.Min(max.z, max2.z))
            }, 1f);
            if (!activeSelf)
            {
                base.gameObject.SetActive(false);
            }
        }
Exemple #2
0
 // Token: 0x06000C11 RID: 3089 RVA: 0x0005BF23 File Offset: 0x0005A323
 public virtual void bakeFoliage(FoliageBakeSettings bakeSettings, IFoliageSurface surface, Bounds bounds, float surfaceWeight, float collectionWeight)
 {
     if (!this.isSurfaceWeightValid(surfaceWeight))
     {
         return;
     }
     this.bakeFoliageSteps(surface, bounds, surfaceWeight, collectionWeight, new FoliageInfoAsset.BakeFoliageStepHandler(this.handleBakeFoliageStep));
 }
 public virtual void bakeFoliage(FoliageBakeSettings bakeSettings, IFoliageSurface surface, Bounds bounds, float weight)
 {
     foreach (FoliageInfoCollectionAsset.FoliageInfoCollectionElement foliageInfoCollectionElement in this.elements)
     {
         FoliageInfoAsset foliageInfoAsset = Assets.find <FoliageInfoAsset>(foliageInfoCollectionElement.asset);
         if (foliageInfoAsset != null)
         {
             foliageInfoAsset.bakeFoliage(bakeSettings, surface, bounds, weight, foliageInfoCollectionElement.weight);
         }
     }
 }
Exemple #4
0
 // Token: 0x06000C49 RID: 3145 RVA: 0x0005CB19 File Offset: 0x0005AF19
 public override void bakeFoliage(FoliageBakeSettings bakeSettings, IFoliageSurface surface, Bounds bounds, float surfaceWeight, float collectionWeight)
 {
     if (!bakeSettings.bakeInstancesMeshes)
     {
         return;
     }
     if (bakeSettings.bakeClear)
     {
         return;
     }
     base.bakeFoliage(bakeSettings, surface, bounds, surfaceWeight, collectionWeight);
 }
 // Token: 0x06000CBA RID: 3258 RVA: 0x0005DD52 File Offset: 0x0005C152
 private static void bakePostTile(FoliageBakeSettings bakeSettings, FoliageTile foliageTile)
 {
     if (!bakeSettings.bakeInstancesMeshes)
     {
         return;
     }
     if (foliageTile.hasInstances)
     {
         foliageTile.writeInstances();
         if (foliageTile.clearPostBake)
         {
             foliageTile.clearInstances();
         }
     }
 }
 // Token: 0x06000CB9 RID: 3257 RVA: 0x0005DCF8 File Offset: 0x0005C0F8
 private static void bakePreTile(FoliageBakeSettings bakeSettings, FoliageTile foliageTile)
 {
     if (!bakeSettings.bakeInstancesMeshes)
     {
         return;
     }
     if (!foliageTile.hasInstances)
     {
         foliageTile.readInstancesOnThread();
         foliageTile.clearPostBake = true;
     }
     if (foliageTile.hasInstances)
     {
         if (bakeSettings.bakeApplyScale)
         {
             foliageTile.applyScale();
         }
         else
         {
             foliageTile.clearGeneratedInstances();
         }
     }
 }
 // Token: 0x06000CB5 RID: 3253 RVA: 0x0005DB8B File Offset: 0x0005BF8B
 public static void bakeLocal(FoliageBakeSettings bakeSettings)
 {
     FoliageSystem.bakeSettings = bakeSettings;
     FoliageSystem.bakePre();
     FoliageSystem.bakeLocalBegin();
 }