PO/Library/Artifacts/24/24ccd5e454247abb498a8da3b38...

128 lines
8.9 KiB
Plaintext
Raw Normal View History

2022-01-12 10:06:03 +03:00
<0F>#<23>2019.4.19f1<00><><EFBFBD><EFBFBD> <00><>f<EFBFBD><66>!<21>5<>9<EFBFBD>4Q<0E><>B<00>7<00><><EFBFBD><EFBFBD><EFBFBD><00><00><00><><00> E<00> <00><00>#<00>.<00>,<00>5a<00> <00><00>#<00>.<00>,<00><00><00>r<00> <00><00># <00>.<00>,
<00>H<00><><00><><EFBFBD><EFBFBD><EFBFBD> <01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD> @<00><00><00> Q<00>j<00><00><00>J<00><><EFBFBD><EFBFBD><00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD><00><00><00><00><00>j<00><><EFBFBD><EFBFBD><EFBFBD><00>\<00><00><><EFBFBD><EFBFBD><EFBFBD><00>H<00>r<00><><EFBFBD><EFBFBD><00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>@<00><00><00>Q<00>j<00>H<00>w<00><><EFBFBD><EFBFBD><00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>@<00><00><00>Q<00>j<00>H<00><><00><><EFBFBD><EFBFBD><00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>@<00><00><00>Q<00>j<00>y<00>
<00> <00><00>#!<00>.<00>,"<00><00><><00><><EFBFBD><EFBFBD>#@1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>$<00><00><00>%.<00>j<00>&<00><00><><00><><EFBFBD><EFBFBD>'<00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>(<00><00><00><00>)<00>j<00><><EFBFBD><EFBFBD><EFBFBD>*<00>H<00><><00><><EFBFBD><EFBFBD><EFBFBD>+<00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>,@<00><00><00>-Q<00>j<00>.y<00>
<00> /<00><00>#0<00>.<00>,1<00> <00><>2@<00><00><> 3@<00><00>#4<00>.<00>,5<00>H<00><><00><><EFBFBD><EFBFBD>6<01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>7@<00><00><00>8Q<00>j<00>9H<00><><00><><EFBFBD><EFBFBD>:<01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>;@<00><00><00><Q<00>j<00>=H<00><><00><><EFBFBD><EFBFBD>><01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>?@<00><00><00>@Q<00>j<00>AMonoImporterPPtr<EditorExtension>m_FileIDm_PathIDPPtr<PrefabInstance>m_ExternalObjectsSourceAssetIdentifiertypeassemblynamem_UsedFileIDsm_DefaultReferencesexecutionOrdericonm_UserDatam_AssetBundleNamem_AssetBundleVariants<00><><EFBFBD>G<EFBFBD><47>܏Z56<35>:!@i<>J*<00><00>7<00><><EFBFBD><EFBFBD><EFBFBD><00><00><00><><00>E<00> <00><00><00>.<00><00>(a<00> <00><00><00>.<00><00><00><00>r<00> <00><00> <00>.<00>
<00>H<00><><00><><EFBFBD><EFBFBD><EFBFBD> <01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD> @<00><00><00> Q<00>j<00>H<00><><00><><EFBFBD><EFBFBD><EFBFBD><01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>@<00><00><00>Q<00>j<00><00><00>=<00><><EFBFBD><EFBFBD><01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD><01><00><00><00><00>j<00><><EFBFBD><EFBFBD><EFBFBD><01>H<00><><00><><EFBFBD><EFBFBD><EFBFBD><01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>@<00><00><00>Q<00>j<00>y<00>
<00> <00><00><00>.<00><00>y<00>Q <00><00><00>.<00> <00><00><00>X!H<00>i<00><><EFBFBD><EFBFBD>"<10>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>#@<00><00><00>$Q<00>j<00>%H<00>u<00><><EFBFBD><EFBFBD>&<10>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>'@<00><00><00>(Q<00>j<00>)PPtr<EditorExtension>m_FileIDm_PathIDPPtr<PrefabInstance>m_DefaultReferencesm_Iconm_ExecutionOrderm_ClassNamem_Namespace\<00>y<EFBFBD>`P<00>y<EFBFBD>EventTriggerEditor<00>using System;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UnityEditor.EventSystems
{
[CustomEditor(typeof(EventTrigger), true)]
public class EventTriggerEditor : Editor
{
SerializedProperty m_DelegatesProperty;
GUIContent m_IconToolbarMinus;
GUIContent m_EventIDName;
GUIContent[] m_EventTypes;
GUIContent m_AddButonContent;
protected virtual void OnEnable()
{
m_DelegatesProperty = serializedObject.FindProperty("m_Delegates");
m_AddButonContent = EditorGUIUtility.TrTextContent("Add New Event Type");
m_EventIDName = new GUIContent("");
// Have to create a copy since otherwise the tooltip will be overwritten.
m_IconToolbarMinus = new GUIContent(EditorGUIUtility.IconContent("Toolbar Minus"));
m_IconToolbarMinus.tooltip = "Remove all events in this list.";
string[] eventNames = Enum.GetNames(typeof(EventTriggerType));
m_EventTypes = new GUIContent[eventNames.Length];
for (int i = 0; i < eventNames.Length; ++i)
{
m_EventTypes[i] = new GUIContent(eventNames[i]);
}
}
public override void OnInspectorGUI()
{
serializedObject.Update();
int toBeRemovedEntry = -1;
EditorGUILayout.Space();
Vector2 removeButtonSize = GUIStyle.none.CalcSize(m_IconToolbarMinus);
for (int i = 0; i < m_DelegatesProperty.arraySize; ++i)
{
SerializedProperty delegateProperty = m_DelegatesProperty.GetArrayElementAtIndex(i);
SerializedProperty eventProperty = delegateProperty.FindPropertyRelative("eventID");
SerializedProperty callbacksProperty = delegateProperty.FindPropertyRelative("callback");
m_EventIDName.text = eventProperty.enumDisplayNames[eventProperty.enumValueIndex];
EditorGUILayout.PropertyField(callbacksProperty, m_EventIDName);
Rect callbackRect = GUILayoutUtility.GetLastRect();
Rect removeButtonPos = new Rect(callbackRect.xMax - removeButtonSize.x - 8, callbackRect.y + 1, removeButtonSize.x, removeButtonSize.y);
if (GUI.Button(removeButtonPos, m_IconToolbarMinus, GUIStyle.none))
{
toBeRemovedEntry = i;
}
EditorGUILayout.Space();
}
if (toBeRemovedEntry > -1)
{
RemoveEntry(toBeRemovedEntry);
}
Rect btPosition = GUILayoutUtility.GetRect(m_AddButonContent, GUI.skin.button);
const float addButonWidth = 200f;
btPosition.x = btPosition.x + (btPosition.width - addButonWidth) / 2;
btPosition.width = addButonWidth;
if (GUI.Button(btPosition, m_AddButonContent))
{
ShowAddTriggermenu();
}
serializedObject.ApplyModifiedProperties();
}
private void RemoveEntry(int toBeRemovedEntry)
{
m_DelegatesProperty.DeleteArrayElementAtIndex(toBeRemovedEntry);
}
void ShowAddTriggermenu()
{
// Now create the menu, add items and show it
GenericMenu menu = new GenericMenu();
for (int i = 0; i < m_EventTypes.Length; ++i)
{
bool active = true;
// Check if we already have a Entry for the current eventType, if so, disable it
for (int p = 0; p < m_DelegatesProperty.arraySize; ++p)
{
SerializedProperty delegateEntry = m_DelegatesProperty.GetArrayElementAtIndex(p);
SerializedProperty eventProperty = delegateEntry.FindPropertyRelative("eventID");
if (eventProperty.enumValueIndex == i)
{
active = false;
}
}
if (active)
menu.AddItem(m_EventTypes[i], false, OnAddNewSelected, i);
else
menu.AddDisabledItem(m_EventTypes[i]);
}
menu.ShowAsContext();
Event.current.Use();
}
private void OnAddNewSelected(object index)
{
int selected = (int)index;
m_DelegatesProperty.arraySize += 1;
SerializedProperty delegateEntry = m_DelegatesProperty.GetArrayElementAtIndex(m_DelegatesProperty.arraySize - 1);
SerializedProperty eventProperty = delegateEntry.FindPropertyRelative("eventID");
eventProperty.enumValueIndex = selected;
serializedObject.ApplyModifiedProperties();
}
}
}
EventTriggerEditorUnityEditor.EventSystems