-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReferences.cs
More file actions
173 lines (162 loc) · 4.04 KB
/
References.cs
File metadata and controls
173 lines (162 loc) · 4.04 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using GHPC.Vehicle;
namespace CustomMissionUtility
{
public static class References
{
public enum Theater {
EasternHills,
Outskirts,
NorthFields,
PointAlpha,
Grafenwoehr
}
public enum Vehicles {
BMP1_NVA,
BMP1_Soviet,
BMP1P_NVA,
BMP1P_Soviet,
BMP2_NVA,
BMP2_Soviet,
BRDM2_NVA,
BRDM2_Soviet,
BTR60_NVA,
BTR60_Soviet,
Static_9K111_NVA,
Static_9K111_Soviet,
Static_SPG9_NVA,
Static_SPG9_Soviet,
Ural_NVA,
Ural_Soviet,
T62,
T64R,
T64A_1974,
T64A_1979,
T64A_1981,
T64A_1983,
T64A_1984,
T64B,
T80B,
BTR70,
GopnikCar,
T55A,
T72_Ural,
T72_LEM,
T72_LEM_Mod,
T72_UV1,
T72_UV2,
T72M,
T72M1,
PT76B,
T34,
T54A,
M1,
M1IP,
M60A1,
M60A1_AOS,
M60A1_RISE_Early,
M60A1_RISE_Late,
M60A3,
M60A3_TTS,
M2Bradley,
M113,
M923,
Static_TOW,
Mi24_Falanga,
Mi24V_NVA,
Mi24V_Soviet,
Mi_8,
Mi_2,
OH_58A,
AH_1,
Count,
}
internal static string[] VicGameIds = new string[] {
"BMP1",
"BMP1 Soviet",
"BMP1P (Variant)",
"BMP1P (Variant) Soviet",
"BMP2",
"BMP2 Soviet",
"BRDM2",
"BRDM2 Soviet",
"BTR60PB",
"BTR60PB Soviet",
"9K111",
"9K111 Soviet",
"SPG9",
"SPG9 Soviet",
"Ural",
"Ural Soviet",
"T62",
"T64R",
"T64A 1974",
"T64A 1979",
"T64A 1981",
"T64A 1983",
"T64A 1984",
"T64B",
"T80B",
"BTR70",
"UAZ469",
"T55A",
"T72 Ural",
"T72 Gill (Variant)",
"T72 Ural LEM",
"T72 UV1 (Variant)",
"T72 UV2 Variant",
"T72M",
"T72M1",
"PT76B",
"T-34-85",
"T54A",
"M1",
"M1IP",
"M60A1",
"M60A1 AOS",
"M60A1 RISE Passive Early",
"M60A1 RISE Passive Late",
"M60A3",
"M60A3 TTS",
"M2 Bradley",
"M113",
"M923",
"TOW",
"Mi24",
"Mi24V NVA",
"Mi24V soviet",
"Mi-8",
"Mi-2",
"OH-58A",
"AH-1"
};
private static bool vics_done = false;
private static Vehicle[] vehicles;
private static Dictionary<int, GameObject> VicsLookup = new Dictionary<int, GameObject>() { };
public static GameObject GetVehicle(Vehicles id)
{
return VicsLookup[(int)id];
}
private static GameObject FindVehicle(string id)
{
return vehicles.Where(v => v.name == id).FirstOrDefault().gameObject;
}
private static void AddVehicleRef(int ref_id, string game_id)
{
VicsLookup.Add(ref_id, FindVehicle(game_id));
}
internal static void GetVicReferences() {
if (vics_done) return;
vehicles = Resources.FindObjectsOfTypeAll<Vehicle>();
for (int i = 0; i < (int)Vehicles.Count; i++) {
AddVehicleRef(i, VicGameIds[i]);
}
vics_done = true;
}
}
}