File tree Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 3
3
4
4
namespace MLAPI . Data
5
5
{
6
+ /// <summary>
7
+ /// A class that represents a NetworkedPrefab
8
+ /// </summary>
6
9
[ Serializable ]
7
10
public class NetworkedPrefab
8
11
{
12
+ /// <summary>
13
+ /// The name of the networked prefab
14
+ /// </summary>
9
15
public string name ;
16
+ /// <summary>
17
+ /// The gameobject of the prefab
18
+ /// </summary>
10
19
public GameObject prefab ;
11
20
}
12
21
}
Original file line number Diff line number Diff line change 36
36
</PropertyGroup >
37
37
<PropertyGroup Condition =" '$(Configuration)|$(Platform)' == 'Development|AnyCPU'" >
38
38
<DebugSymbols >true</DebugSymbols >
39
- <OutputPath >..\..\MLAPI-Examples\Assets\</OutputPath >
39
+ <OutputPath >..\..\MLAPI-Examples\Assets\MLAPI\ </OutputPath >
40
40
<DefineConstants >DEBUG;TRACE</DefineConstants >
41
41
<DebugType >full</DebugType >
42
42
<PlatformTarget >AnyCPU</PlatformTarget >
43
43
<ErrorReport >prompt</ErrorReport >
44
44
<CodeAnalysisRuleSet >MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet >
45
- <GenerateSerializationAssemblies >Auto </GenerateSerializationAssemblies >
45
+ <GenerateSerializationAssemblies >Off </GenerateSerializationAssemblies >
46
46
<RunCodeAnalysis >false</RunCodeAnalysis >
47
47
<DocumentationFile >
48
48
</DocumentationFile >
Original file line number Diff line number Diff line change @@ -153,15 +153,20 @@ public bool IsClientConnected
153
153
154
154
private void OnValidate ( )
155
155
{
156
+ if ( NetworkConfig == null )
157
+ return ; //May occur when the component is added
158
+
156
159
if ( NetworkConfig . EnableSceneSwitching && ! NetworkConfig . RegisteredScenes . Contains ( SceneManager . GetActiveScene ( ) . name ) )
157
160
{
158
161
Debug . LogWarning ( "MLAPI: The active scene is not registered as a networked scene. The MLAPI has added it" ) ;
159
162
NetworkConfig . RegisteredScenes . Add ( SceneManager . GetActiveScene ( ) . name ) ;
160
163
}
164
+
161
165
if ( ! NetworkConfig . EnableSceneSwitching && NetworkConfig . HandleObjectSpawning )
162
166
{
163
167
Debug . LogWarning ( "MLAPI: Please be aware that Scene objects are NOT supported if SceneManagement is turned on, even if HandleObjectSpawning is turned on" ) ;
164
168
}
169
+
165
170
if ( NetworkConfig . HandleObjectSpawning )
166
171
{
167
172
for ( int i = 0 ; i < NetworkConfig . NetworkedPrefabs . Count ; i ++ )
@@ -173,6 +178,7 @@ private void OnValidate()
173
178
}
174
179
}
175
180
}
181
+
176
182
if ( NetworkConfig . HandleObjectSpawning )
177
183
{
178
184
if ( ! string . IsNullOrEmpty ( NetworkConfig . PlayerPrefabName ) )
@@ -198,7 +204,9 @@ private void OnValidate()
198
204
}
199
205
200
206
if ( ! NetworkConfig . EnableEncryption )
207
+ {
201
208
RegenerateRSAKeys = false ;
209
+ }
202
210
else
203
211
{
204
212
if ( RegenerateRSAKeys )
You can’t perform that action at this time.
0 commit comments