Пример #1
0
 public void UpdateGrassProperties()
 {
     if ((this.grassAtlas != null) && (this.material != null))
     {
         for (int i = 0; i < 0x10; i++)
         {
             FPGrassProperty property = this.grassAtlas.properties[i];
             this.material.SetColor("_GrassColorsOne" + i, property.Color1);
             this.material.SetColor("_GrassColorsTwo" + i, property.Color2);
             this.material.SetVector("_GrassSizes" + i, new Vector4(property.MinWidth, property.MaxWidth, property.MinHeight, property.MaxHeight));
         }
         for (int j = 0; j < this.children.Count; j++)
         {
             for (int k = 0; k < 0x10; k++)
             {
                 FPGrassProperty property2 = this.grassAtlas.properties[k];
                 this.children[j].levelMaterial.SetColor("_GrassColorsOne" + k, property2.Color1);
                 this.children[j].levelMaterial.SetColor("_GrassColorsTwo" + k, property2.Color2);
                 this.children[j].levelMaterial.SetVector("_GrassSizes" + k, new Vector4(property2.MinWidth, property2.MaxWidth, property2.MinHeight, property2.MaxHeight));
             }
         }
     }
 }
Пример #2
0
 public void UpdateGrassProperties()
 {
     if (!this.grassAtlas || !this.material)
     {
         return;
     }
     for (int i = 0; i < 16; i++)
     {
         FPGrassProperty item = this.grassAtlas.properties[i];
         this.material.SetColor(string.Concat("_GrassColorsOne", i), item.Color1);
         this.material.SetColor(string.Concat("_GrassColorsTwo", i), item.Color2);
         this.material.SetVector(string.Concat("_GrassSizes", i), new Vector4(item.MinWidth, item.MaxWidth, item.MinHeight, item.MaxHeight));
     }
     for (int j = 0; j < this.children.Count; j++)
     {
         for (int k = 0; k < 16; k++)
         {
             FPGrassProperty fPGrassProperty = this.grassAtlas.properties[k];
             this.children[j].levelMaterial.SetColor(string.Concat("_GrassColorsOne", k), fPGrassProperty.Color1);
             this.children[j].levelMaterial.SetColor(string.Concat("_GrassColorsTwo", k), fPGrassProperty.Color2);
             this.children[j].levelMaterial.SetVector(string.Concat("_GrassSizes", k), new Vector4(fPGrassProperty.MinWidth, fPGrassProperty.MaxWidth, fPGrassProperty.MinHeight, fPGrassProperty.MaxHeight));
         }
     }
 }