您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

24 行
755 B

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
[CustomPropertyDrawer(typeof(SubtitleManager.Subtitle))]
public class SubtitlePropertyDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
var time = property.FindPropertyRelative("Time");
var text = property.FindPropertyRelative("Text");
var timeRect = new Rect(position);
timeRect.xMin = timeRect.xMax - 80;
var textRect = new Rect(position);
textRect.xMax -= 80;
time.floatValue = EditorGUI.FloatField(timeRect, time.floatValue);
text.stringValue = EditorGUI.DelayedTextField(textRect, text.stringValue);
}
}