-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSectorChanger.vsl
40 lines (35 loc) · 1.36 KB
/
SectorChanger.vsl
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
////////////////////////
// Description : Edit by ghomist
extern int NewSector;
void main()
{
Group S1 = Group.Cast(ac.GetObjectByName("Sector_01"));
Group S2 = Group.Cast(ac.GetObjectByName("Sector_02"));
Group S3 = Group.Cast(ac.GetObjectByName("Sector_03"));
Group S4 = Group.Cast(ac.GetObjectByName("Sector_04"));
Group S5 = Group.Cast(ac.GetObjectByName("Sector_05"));
Group S6 = Group.Cast(ac.GetObjectByName("Sector_06"));
Group S7 = Group.Cast(ac.GetObjectByName("Sector_07"));
Group S8 = Group.Cast(ac.GetObjectByName("Sector_08"));
int count = ac.selection.Size();
for (int i=0; i<count; ++i) {
Entity3D ent = Entity3D.Cast(ac.selection[i]);
if (!ent) continue;
if(ent.IsInGroup(S1)) S1.RemoveObject(ent);
if(ent.IsInGroup(S2)) S2.RemoveObject(ent);
if(ent.IsInGroup(S3)) S3.RemoveObject(ent);
if(ent.IsInGroup(S4)) S4.RemoveObject(ent);
if(ent.IsInGroup(S5)) S5.RemoveObject(ent);
if(ent.IsInGroup(S6)) S6.RemoveObject(ent);
if(ent.IsInGroup(S7)) S7.RemoveObject(ent);
if(ent.IsInGroup(S8)) S8.RemoveObject(ent);
if(NewSector == 1) S1.AddObject(ent);
if(NewSector == 2) S2.AddObject(ent);
if(NewSector == 3) S3.AddObject(ent);
if(NewSector == 4) S4.AddObject(ent);
if(NewSector == 5) S5.AddObject(ent);
if(NewSector == 6) S6.AddObject(ent);
if(NewSector == 7) S7.AddObject(ent);
if(NewSector == 8) S8.AddObject(ent);
}
}