44 lines
1.5 KiB
C#
44 lines
1.5 KiB
C#
using System;
|
|
using System.Runtime.CompilerServices;
|
|
using UnityEngine.Scripting;
|
|
|
|
namespace UnityEngine
|
|
{
|
|
// Token: 0x02000236 RID: 566
|
|
public static class TerrainExtensions
|
|
{
|
|
// Token: 0x06002737 RID: 10039 RVA: 0x0002CC28 File Offset: 0x0002AE28
|
|
public static void UpdateGIMaterials(this Terrain terrain)
|
|
{
|
|
if (terrain.terrainData == null)
|
|
{
|
|
throw new ArgumentException("Invalid terrainData.");
|
|
}
|
|
TerrainExtensions.UpdateGIMaterialsForTerrain(terrain, new Rect(0f, 0f, 1f, 1f));
|
|
}
|
|
|
|
// Token: 0x06002738 RID: 10040 RVA: 0x0002CC68 File Offset: 0x0002AE68
|
|
public static void UpdateGIMaterials(this Terrain terrain, int x, int y, int width, int height)
|
|
{
|
|
if (terrain.terrainData == null)
|
|
{
|
|
throw new ArgumentException("Invalid terrainData.");
|
|
}
|
|
float num = (float)terrain.terrainData.alphamapWidth;
|
|
float num2 = (float)terrain.terrainData.alphamapHeight;
|
|
TerrainExtensions.UpdateGIMaterialsForTerrain(terrain, new Rect((float)x / num, (float)y / num2, (float)width / num, (float)height / num2));
|
|
}
|
|
|
|
// Token: 0x06002739 RID: 10041 RVA: 0x0002CCC8 File Offset: 0x0002AEC8
|
|
internal static void UpdateGIMaterialsForTerrain(Terrain terrain, Rect uvBounds)
|
|
{
|
|
TerrainExtensions.INTERNAL_CALL_UpdateGIMaterialsForTerrain(terrain, ref uvBounds);
|
|
}
|
|
|
|
// Token: 0x0600273A RID: 10042
|
|
[GeneratedByOldBindingsGenerator]
|
|
[MethodImpl(MethodImplOptions.InternalCall)]
|
|
private static extern void INTERNAL_CALL_UpdateGIMaterialsForTerrain(Terrain terrain, ref Rect uvBounds);
|
|
}
|
|
}
|