forked from Unity-Technologies/com.unity.netcode.gameobjects
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMenuReference.cs
More file actions
50 lines (42 loc) · 995 Bytes
/
MenuReference.cs
File metadata and controls
50 lines (42 loc) · 995 Bytes
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
using System.Collections.Generic;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
[CreateAssetMenu(fileName = nameof(MenuReference), menuName = "Netcode/" + nameof(MenuReference))]
public class MenuReference : ScriptableObject, ISceneReference
{
#if UNITY_EDITOR
public SceneAsset MenuScene;
#endif
[SerializeField]
private string m_DisplayName;
[HideInInspector]
[SerializeField]
private List<string> m_ReferencedScenes;
#if UNITY_EDITOR
private void OnValidate()
{
if (m_ReferencedScenes == null)
{
m_ReferencedScenes = new List<string>();
}
else
{
m_ReferencedScenes.Clear();
}
if (MenuScene != null)
{
m_ReferencedScenes.Add(MenuScene.name);
}
}
#endif
public string GetDisplayName()
{
return m_DisplayName;
}
public List<string> GetReferencedScenes()
{
return m_ReferencedScenes;
}
}