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 33
44namespace MLAPI . Data
55{
6+ /// <summary>
7+ /// A class that represents a NetworkedPrefab
8+ /// </summary>
69 [ Serializable ]
710 public class NetworkedPrefab
811 {
12+ /// <summary>
13+ /// The name of the networked prefab
14+ /// </summary>
915 public string name ;
16+ /// <summary>
17+ /// The gameobject of the prefab
18+ /// </summary>
1019 public GameObject prefab ;
1120 }
1221}
Original file line number Diff line number Diff line change 3636 </PropertyGroup >
3737 <PropertyGroup Condition =" '$(Configuration)|$(Platform)' == 'Development|AnyCPU'" >
3838 <DebugSymbols >true</DebugSymbols >
39- <OutputPath >..\..\MLAPI-Examples\Assets\</OutputPath >
39+ <OutputPath >..\..\MLAPI-Examples\Assets\MLAPI\ </OutputPath >
4040 <DefineConstants >DEBUG;TRACE</DefineConstants >
4141 <DebugType >full</DebugType >
4242 <PlatformTarget >AnyCPU</PlatformTarget >
4343 <ErrorReport >prompt</ErrorReport >
4444 <CodeAnalysisRuleSet >MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet >
45- <GenerateSerializationAssemblies >Auto </GenerateSerializationAssemblies >
45+ <GenerateSerializationAssemblies >Off </GenerateSerializationAssemblies >
4646 <RunCodeAnalysis >false</RunCodeAnalysis >
4747 <DocumentationFile >
4848 </DocumentationFile >
Original file line number Diff line number Diff line change @@ -153,15 +153,20 @@ public bool IsClientConnected
153153
154154 private void OnValidate ( )
155155 {
156+ if ( NetworkConfig == null )
157+ return ; //May occur when the component is added
158+
156159 if ( NetworkConfig . EnableSceneSwitching && ! NetworkConfig . RegisteredScenes . Contains ( SceneManager . GetActiveScene ( ) . name ) )
157160 {
158161 Debug . LogWarning ( "MLAPI: The active scene is not registered as a networked scene. The MLAPI has added it" ) ;
159162 NetworkConfig . RegisteredScenes . Add ( SceneManager . GetActiveScene ( ) . name ) ;
160163 }
164+
161165 if ( ! NetworkConfig . EnableSceneSwitching && NetworkConfig . HandleObjectSpawning )
162166 {
163167 Debug . LogWarning ( "MLAPI: Please be aware that Scene objects are NOT supported if SceneManagement is turned on, even if HandleObjectSpawning is turned on" ) ;
164168 }
169+
165170 if ( NetworkConfig . HandleObjectSpawning )
166171 {
167172 for ( int i = 0 ; i < NetworkConfig . NetworkedPrefabs . Count ; i ++ )
@@ -173,6 +178,7 @@ private void OnValidate()
173178 }
174179 }
175180 }
181+
176182 if ( NetworkConfig . HandleObjectSpawning )
177183 {
178184 if ( ! string . IsNullOrEmpty ( NetworkConfig . PlayerPrefabName ) )
@@ -198,7 +204,9 @@ private void OnValidate()
198204 }
199205
200206 if ( ! NetworkConfig . EnableEncryption )
207+ {
201208 RegenerateRSAKeys = false ;
209+ }
202210 else
203211 {
204212 if ( RegenerateRSAKeys )
You can’t perform that action at this time.
0 commit comments