first commit
This commit is contained in:
34
Assets/AVProVideo/Editor/Scripts/MediaHintsDrawer.cs
Normal file
34
Assets/AVProVideo/Editor/Scripts/MediaHintsDrawer.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright 2015-2025 RenderHeads Ltd. All rights reserved.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
namespace RenderHeads.Media.AVProVideo.Editor
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(MediaHints))]
|
||||
public class MediaHintsDrawer : PropertyDrawer
|
||||
{
|
||||
public override float GetPropertyHeight(SerializedProperty property, GUIContent label) { return 0f; }
|
||||
|
||||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
|
||||
{
|
||||
EditorGUI.BeginProperty(position, GUIContent.none, property);
|
||||
|
||||
SerializedProperty propHintsTransparency = property.FindPropertyRelative("transparency");
|
||||
SerializedProperty propHintsAlphaPacking = property.FindPropertyRelative("alphaPacking");
|
||||
SerializedProperty propHintsStereoPacking = property.FindPropertyRelative("stereoPacking");
|
||||
|
||||
EditorGUILayout.PropertyField(propHintsTransparency);
|
||||
if ((TransparencyMode)propHintsTransparency.enumValueIndex == TransparencyMode.Transparent)
|
||||
{
|
||||
EditorGUILayout.PropertyField(propHintsAlphaPacking);
|
||||
}
|
||||
|
||||
EditorGUILayout.PropertyField(propHintsStereoPacking);
|
||||
|
||||
EditorGUI.EndProperty();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user