Elin Modding Docs Doc
All Classes Namespaces
SpatialGen.cs
1using System;
2
3// Token: 0x020006E9 RID: 1769
4public class SpatialGen : EClass
5{
6 // Token: 0x0600330B RID: 13067 RVA: 0x00118410 File Offset: 0x00116610
7 public static Spatial CreateRecursive(string id, Spatial parent = null)
8 {
9 Spatial spatial = SpatialGen.Create(id, parent, true, -99999, -99999, 0);
10 foreach (SourceZone.Row row in EClass.sources.zones.rows)
11 {
12 if ((!row.tag.Contains("debug") || EClass.debug.enable) && row.parent == id)
13 {
14 SpatialGen.CreateRecursive(row.id, spatial);
15 }
16 }
17 return spatial;
18 }
19
20 // Token: 0x0600330C RID: 13068 RVA: 0x001184B4 File Offset: 0x001166B4
21 public static Spatial Create(string id, Spatial parent, bool register, int x = -99999, int y = -99999, int icon = 0)
22 {
23 SourceZone.Row row = EClass.sources.zones.map[id];
24 Spatial spatial = ClassCache.Create<Spatial>(row.type, "Elin");
25 if (x == -99999)
26 {
27 x = ((row.pos.Length != 0) ? row.pos[0] : -1000);
28 y = ((row.pos.Length != 0) ? row.pos[1] : -1000);
29 }
30 if (icon == 0 && row.pos.Length != 0)
31 {
32 icon = row.pos[2];
33 }
34 spatial.Create(id, x, y, icon);
35 if (register)
36 {
37 spatial.Register();
38 }
39 if (parent != null)
40 {
41 parent.AddChild(spatial);
42 }
43 spatial.OnAfterCreate();
44 return spatial;
45 }
46
47 // Token: 0x0600330D RID: 13069 RVA: 0x00118564 File Offset: 0x00116764
48 public static Zone CreateInstance(string id, ZoneInstance instance)
49 {
50 Zone topZone = EClass._zone.GetTopZone();
51 Zone zone = SpatialGen.Create(id, EClass._zone.Region, true, topZone.x, topZone.y, 0) as Zone;
52 zone.instance = instance;
53 instance.x = EClass.pc.pos.x;
54 instance.z = EClass.pc.pos.z;
55 instance.uidZone = EClass._zone.uid;
56 zone.dateExpire = EClass.world.date.GetRaw(0) + 1440;
57 return zone;
58 }
59}
Definition Zone.cs:14