-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAddToWaterMap.cs
More file actions
79 lines (77 loc) · 3.66 KB
/
AddToWaterMap.cs
File metadata and controls
79 lines (77 loc) · 3.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
using UnityEngine;
public class AddToWaterMap : ProceduralObject
{
public bool isOcean;
public override void Process()
{
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
//IL_0177: Unknown result type (might be due to invalid IL or missing references)
//IL_0195: Unknown result type (might be due to invalid IL or missing references)
//IL_0197: Unknown result type (might be due to invalid IL or missing references)
//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
Vector3 val = default(Vector3);
((Vector3)(ref val))._002Ector(10000f, 1000f, 10000f);
Collider component = ((Component)this).GetComponent<Collider>();
Bounds val2 = (Bounds)(isOcean ? new Bounds(-val / 2f, val) : component.bounds);
int num = TerrainMeta.WaterMap.Index(TerrainMeta.NormalizeX(((Bounds)(ref val2)).min.x));
int num2 = TerrainMeta.WaterMap.Index(TerrainMeta.NormalizeZ(((Bounds)(ref val2)).max.x));
int num3 = TerrainMeta.WaterMap.Index(TerrainMeta.NormalizeX(((Bounds)(ref val2)).min.z));
int num4 = TerrainMeta.WaterMap.Index(TerrainMeta.NormalizeZ(((Bounds)(ref val2)).max.z));
if (isOcean || (component is BoxCollider && ((Component)this).transform.rotation == Quaternion.identity))
{
float num5 = TerrainMeta.NormalizeY(((Bounds)(ref val2)).max.y);
for (int i = num3; i <= num4; i++)
{
for (int j = num; j <= num2; j++)
{
float height = TerrainMeta.WaterMap.GetHeight01(j, i);
if (num5 > height)
{
TerrainMeta.WaterMap.SetHeight(j, i, num5);
}
}
}
}
else
{
Vector3 val3 = default(Vector3);
Ray val4 = default(Ray);
RaycastHit val5 = default(RaycastHit);
for (int k = num3; k <= num4; k++)
{
float normZ = TerrainMeta.WaterMap.Coordinate(k);
for (int l = num; l <= num2; l++)
{
float normX = TerrainMeta.WaterMap.Coordinate(l);
((Vector3)(ref val3))._002Ector(TerrainMeta.DenormalizeX(normX), ((Bounds)(ref val2)).max.y + 1f, TerrainMeta.DenormalizeZ(normZ));
((Ray)(ref val4))._002Ector(val3, Vector3.down);
if (component.Raycast(val4, ref val5, ((Bounds)(ref val2)).size.y + 1f + 1f))
{
float num6 = TerrainMeta.NormalizeY(((RaycastHit)(ref val5)).point.y);
float height2 = TerrainMeta.WaterMap.GetHeight01(l, k);
if (num6 > height2)
{
TerrainMeta.WaterMap.SetHeight(l, k, num6);
}
}
}
}
}
GameManager.Destroy((Component)(object)this);
}
}