Elin Modding Docs Doc
Loading...
Searching...
No Matches
AM_Populate.cs
1using System;
2using UnityEngine;
3
4// Token: 0x02000158 RID: 344
6{
7 // Token: 0x17000287 RID: 647
8 // (get) Token: 0x06000A15 RID: 2581 RVA: 0x0003C22D File Offset: 0x0003A42D
9 public override int SubMenuModeIndex
10 {
11 get
12 {
13 return (int)this.mode;
14 }
15 }
16
17 // Token: 0x06000A16 RID: 2582 RVA: 0x0003C235 File Offset: 0x0003A435
18 public override void OnClickSubMenu(int a)
19 {
20 this.mode = a.ToEnum<AM_Populate.Mode>();
21 }
22
23 // Token: 0x06000A17 RID: 2583 RVA: 0x0003C244 File Offset: 0x0003A444
24 public override string OnSetSubMenuButton(int a, UIButton b)
25 {
26 if (a < 3)
27 {
28 return "populate" + a.ToEnum<AM_Populate.Mode>().ToString();
29 }
30 return null;
31 }
32
33 // Token: 0x06000A18 RID: 2584 RVA: 0x0003C278 File Offset: 0x0003A478
34 public override void OnProcessTiles(Point point, int dir)
35 {
36 if (this.timer < 0.1f)
37 {
38 return;
39 }
40 this.timer = 0f;
41 Cell cell = point.cell;
42 EClass._map.ForeachSphere(point.x, point.z, (float)this.brushRadius, delegate(Point p)
43 {
44 if (this.mode == AM_Populate.Mode.Delete || (this.mode == AM_Populate.Mode.New && this.firstClick))
45 {
46 p.SetObj(0, 1, 0);
47 }
48 if (this.mode != AM_Populate.Mode.Delete && !p.HasBlock && !p.HasObj)
49 {
50 for (int i = 0; i < 200; i++)
51 {
52 if (EClass.rnd(Mathf.Clamp(this.brushRadius * this.brushRadius - 3, 1, 10)) == 0)
53 {
54 if (EInput.isShiftDown)
55 {
56 bool flag = false;
57 for (int j = 0; j < 10000; j++)
58 {
59 p.cell.biome.Populate(p, false);
60 if (p.growth != null && p.growth.IsTree)
61 {
62 flag = true;
63 break;
64 }
65 }
66 if (!flag)
67 {
68 p.SetObj(0, 1, 0);
69 }
70 }
71 else
72 {
73 p.cell.biome.Populate(p, false);
74 }
75 }
76 if (this.brushRadius > 1 || p.HasObj)
77 {
78 break;
79 }
80 }
81 }
82 });
83 }
84
85 // Token: 0x04000903 RID: 2307
86 public AM_Populate.Mode mode;
87
88 // Token: 0x02000871 RID: 2161
89 public enum Mode
90 {
91 // Token: 0x04002415 RID: 9237
92 New,
93 // Token: 0x04002416 RID: 9238
94 Override,
95 // Token: 0x04002417 RID: 9239
96 Delete
97 }
98}
Definition Cell.cs:10
Definition Point.cs:11