This commit is contained in:
vis2k 2020-03-09 16:21:36 +01:00
parent 83c8beac5e
commit eb4ccd54b7

View File

@ -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))