mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
syntax
This commit is contained in:
parent
83c8beac5e
commit
eb4ccd54b7
@ -3,14 +3,11 @@
|
||||
|
||||
namespace Mirror
|
||||
{
|
||||
|
||||
[CustomPropertyDrawer(typeof(SceneAttribute))]
|
||||
public class SceneDrawer : PropertyDrawer
|
||||
{
|
||||
|
||||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
|
||||
{
|
||||
|
||||
if (property.propertyType == SerializedPropertyType.String)
|
||||
{
|
||||
SceneAsset sceneObject = GetSceneObject(property.stringValue);
|
||||
@ -33,8 +30,11 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
EditorGUI.LabelField(position, label.text, "Use [Scene] with strings.");
|
||||
}
|
||||
}
|
||||
|
||||
protected SceneAsset GetSceneObject(string sceneObjectName)
|
||||
{
|
||||
if (string.IsNullOrEmpty(sceneObjectName))
|
||||
|
Loading…
Reference in New Issue
Block a user