-
Notifications
You must be signed in to change notification settings - Fork 461
Expand file tree
/
Copy pathNetcodeForGameObjectsProjectSettings.cs
More file actions
43 lines (38 loc) · 1.46 KB
/
NetcodeForGameObjectsProjectSettings.cs
File metadata and controls
43 lines (38 loc) · 1.46 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
using UnityEditor;
using UnityEngine;
namespace Unity.Netcode.GameObjects.Editor.Configuration
{
/// <summary>
/// A <see cref="ScriptableSingleton{T}"/> of type <see cref="NetcodeForGameObjectsProjectSettings"/>.
/// </summary>
[FilePath("ProjectSettings/NetcodeForGameObjects.asset", FilePathAttribute.Location.ProjectFolder)]
public class NetcodeForGameObjectsProjectSettings : ScriptableSingleton<NetcodeForGameObjectsProjectSettings>
{
internal static readonly string DefaultNetworkPrefabsPath = "Assets/DefaultNetworkPrefabs.asset";
/// <summary>
/// The path and name for the DefaultNetworkPrefabs asset.
/// </summary>
[SerializeField] public string NetworkPrefabsPath = DefaultNetworkPrefabsPath;
/// <summary>
/// A temporary network prefabs path used internally.
/// </summary>
public string TempNetworkPrefabsPath;
private void OnEnable()
{
if (NetworkPrefabsPath.Length == 0)
{
NetworkPrefabsPath = DefaultNetworkPrefabsPath;
}
TempNetworkPrefabsPath = NetworkPrefabsPath;
}
/// <summary>
/// Used to determine whether the default network prefabs asset should be generated or not.
/// </summary>
[SerializeField]
public bool GenerateDefaultNetworkPrefabs = true;
internal void SaveSettings()
{
Save(true);
}
}
}