Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
d6746064de
@ -3,10 +3,19 @@ using UnityEngine;
|
|||||||
|
|
||||||
namespace MLAPI.Data
|
namespace MLAPI.Data
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// A class that represents a NetworkedPrefab
|
||||||
|
/// </summary>
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class NetworkedPrefab
|
public class NetworkedPrefab
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The name of the networked prefab
|
||||||
|
/// </summary>
|
||||||
public string name;
|
public string name;
|
||||||
|
/// <summary>
|
||||||
|
/// The gameobject of the prefab
|
||||||
|
/// </summary>
|
||||||
public GameObject prefab;
|
public GameObject prefab;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,13 +36,13 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Development|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Development|AnyCPU'">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
<OutputPath>..\..\MLAPI-Examples\Assets\</OutputPath>
|
<OutputPath>..\..\MLAPI-Examples\Assets\MLAPI\</OutputPath>
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
|
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
|
||||||
<RunCodeAnalysis>false</RunCodeAnalysis>
|
<RunCodeAnalysis>false</RunCodeAnalysis>
|
||||||
<DocumentationFile>
|
<DocumentationFile>
|
||||||
</DocumentationFile>
|
</DocumentationFile>
|
||||||
|
@ -153,15 +153,20 @@ namespace MLAPI.MonoBehaviours.Core
|
|||||||
|
|
||||||
private void OnValidate()
|
private void OnValidate()
|
||||||
{
|
{
|
||||||
|
if (NetworkConfig == null)
|
||||||
|
return; //May occur when the component is added
|
||||||
|
|
||||||
if(NetworkConfig.EnableSceneSwitching && !NetworkConfig.RegisteredScenes.Contains(SceneManager.GetActiveScene().name))
|
if(NetworkConfig.EnableSceneSwitching && !NetworkConfig.RegisteredScenes.Contains(SceneManager.GetActiveScene().name))
|
||||||
{
|
{
|
||||||
Debug.LogWarning("MLAPI: The active scene is not registered as a networked scene. The MLAPI has added it");
|
Debug.LogWarning("MLAPI: The active scene is not registered as a networked scene. The MLAPI has added it");
|
||||||
NetworkConfig.RegisteredScenes.Add(SceneManager.GetActiveScene().name);
|
NetworkConfig.RegisteredScenes.Add(SceneManager.GetActiveScene().name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!NetworkConfig.EnableSceneSwitching && NetworkConfig.HandleObjectSpawning)
|
if(!NetworkConfig.EnableSceneSwitching && NetworkConfig.HandleObjectSpawning)
|
||||||
{
|
{
|
||||||
Debug.LogWarning("MLAPI: Please be aware that Scene objects are NOT supported if SceneManagement is turned on, even if HandleObjectSpawning is turned on");
|
Debug.LogWarning("MLAPI: Please be aware that Scene objects are NOT supported if SceneManagement is turned on, even if HandleObjectSpawning is turned on");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(NetworkConfig.HandleObjectSpawning)
|
if(NetworkConfig.HandleObjectSpawning)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < NetworkConfig.NetworkedPrefabs.Count; i++)
|
for (int i = 0; i < NetworkConfig.NetworkedPrefabs.Count; i++)
|
||||||
@ -173,6 +178,7 @@ namespace MLAPI.MonoBehaviours.Core
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NetworkConfig.HandleObjectSpawning)
|
if (NetworkConfig.HandleObjectSpawning)
|
||||||
{
|
{
|
||||||
if(!string.IsNullOrEmpty(NetworkConfig.PlayerPrefabName))
|
if(!string.IsNullOrEmpty(NetworkConfig.PlayerPrefabName))
|
||||||
@ -198,7 +204,9 @@ namespace MLAPI.MonoBehaviours.Core
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!NetworkConfig.EnableEncryption)
|
if (!NetworkConfig.EnableEncryption)
|
||||||
|
{
|
||||||
RegenerateRSAKeys = false;
|
RegenerateRSAKeys = false;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(RegenerateRSAKeys)
|
if(RegenerateRSAKeys)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user