20 lines
555 B
C#
Raw Permalink Normal View History

2021-11-12 16:21:13 +08:00
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using UnityEditor;
using UnityEngine;
[CustomPropertyDrawer(typeof(AppSecretAttribute))]
public class AppSecretDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
var name = ((AppSecretAttribute) attribute).Name;
if (!string.IsNullOrEmpty(name))
{
label.text = name;
}
EditorGUI.PropertyField(position, property, label);
}
}