diff options
author | chai <chaifix@163.com> | 2022-03-10 14:07:40 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2022-03-10 14:07:40 +0800 |
commit | 22891bf59032ba88262824255a706d652031384b (patch) | |
tree | 7595439ba9966c9402d37e37cee5e8cf098757d5 /Assets/ThirdParty/AmplifyShaderEditor/Plugins/Editor/Utils/UpperLeftWidgetHelper.cs | |
parent | 8b04ea73e540067f83870b61d89db4868fea5e8a (diff) |
* move folder
Diffstat (limited to 'Assets/ThirdParty/AmplifyShaderEditor/Plugins/Editor/Utils/UpperLeftWidgetHelper.cs')
-rw-r--r-- | Assets/ThirdParty/AmplifyShaderEditor/Plugins/Editor/Utils/UpperLeftWidgetHelper.cs | 91 |
1 files changed, 0 insertions, 91 deletions
diff --git a/Assets/ThirdParty/AmplifyShaderEditor/Plugins/Editor/Utils/UpperLeftWidgetHelper.cs b/Assets/ThirdParty/AmplifyShaderEditor/Plugins/Editor/Utils/UpperLeftWidgetHelper.cs deleted file mode 100644 index 9e92fe2d..00000000 --- a/Assets/ThirdParty/AmplifyShaderEditor/Plugins/Editor/Utils/UpperLeftWidgetHelper.cs +++ /dev/null @@ -1,91 +0,0 @@ -using System; -using UnityEngine; -using UnityEditor; - -namespace AmplifyShaderEditor -{ - public class UpperLeftWidgetHelper - { - public int DrawWidget( ParentNode owner, int selectedIndex, GUIContent[] displayedOptions ) - { - if( owner.DropdownEditing ) - { - int newValue = owner.EditorGUIPopup( owner.DropdownRect, selectedIndex, displayedOptions, UIUtils.PropertyPopUp ); - if( newValue != selectedIndex ) - { - owner.DropdownEditing = false; - } - return newValue; - } - return selectedIndex; - } - - public int DrawWidget( ParentNode owner, int selectedIndex, string[] displayedOptions ) - { - if( owner.DropdownEditing ) - { - int newValue = owner.EditorGUIPopup( owner.DropdownRect, selectedIndex, displayedOptions, UIUtils.PropertyPopUp ); - if( newValue != selectedIndex ) - { - owner.DropdownEditing = false; - } - return newValue; - } - return selectedIndex; - } - - public int DrawWidget( ParentNode owner, int selectedIndex, string[] displayedOptions, int[] optionValues ) - { - if( owner.DropdownEditing ) - { - int newValue = owner.EditorGUIIntPopup( owner.DropdownRect, selectedIndex, displayedOptions, optionValues, UIUtils.PropertyPopUp ); - if( newValue != selectedIndex ) - { - owner.DropdownEditing = false; - } - return newValue; - } - return selectedIndex; - } - - // GC free version - public void DrawWidget<TEnum>( ref TEnum selectedIndex, ParentNode owner, Action<ParentNode> callback ) where TEnum : struct - { - if( owner.DropdownEditing ) - { - Enum asEnumType = selectedIndex as Enum; - if( asEnumType != null ) - { - EditorGUI.BeginChangeCheck(); - selectedIndex = ( owner.EditorGUIEnumPopup( owner.DropdownRect, asEnumType, UIUtils.PropertyPopUp ) as TEnum? ).Value; - if( EditorGUI.EndChangeCheck() ) - { - owner.DropdownEditing = false; - if( callback != null ) - callback( owner ); - } - } - } - } - - /* - * USE THIS OVERRIDE IN CASE THE NODE DOESN'T HAVE PREVIEW - */ - //public override void AfterCommonInit() - //{ - // base.AfterCommonInit(); - // if( PaddingTitleLeft == 0 ) - // { - // PaddingTitleLeft = Constants.PropertyPickerWidth + Constants.IconsLeftRightMargin; - // if( PaddingTitleRight == 0 ) - // PaddingTitleRight = Constants.PropertyPickerWidth + Constants.IconsLeftRightMargin; - // } - //} - - - /* - * USE THE SOURCE CODE BELOW INTO THE NODE YOU WANT THE WIDGET TO SHOW - */ - //private UpperLeftWidgetHelper m_upperLeftWidget = new UpperLeftWidgetHelper(); - } -} |