PO/Library/Artifacts/41/41167b871aa532a7099b178d61b...

196 lines
9.6 KiB
Plaintext
Raw Normal View History

2022-01-12 10:06:03 +03:00
<0F>&P2019.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>`<00><00>y<EFBFBD> TabButtonnusing System;
using UnityEditor;
using UnityEngine;
namespace Unity.PlasticSCM.Editor.UI
{
internal class TabButton
{
internal bool DrawTabButton(
string buttonText,
bool wasActive,
float width)
{
bool isCloseButtonClicked;
return DrawClosableTabButton(
buttonText,
wasActive,
false,
width,
null,
out isCloseButtonClicked);
}
internal bool DrawClosableTabButton(
string buttonText,
bool wasActive,
bool isClosable,
float width,
Action repaintAction,
out bool isCloseButtonClicked)
{
isCloseButtonClicked = false;
GUIContent buttonContent = new GUIContent(buttonText);
GUIStyle buttonStyle = (wasActive) ?
UnityStyles.PlasticWindow.ActiveTabButton :
EditorStyles.toolbarButton;
Rect toggleRect = GUILayoutUtility.GetRect(
buttonContent, buttonStyle,
GUILayout.Width(width));
if (isClosable && Event.current.type == EventType.MouseMove)
{
if (mCloseButtonRect.Contains(Event.current.mousePosition))
{
SetCloseButtonState(
CloseButtonState.Hovered,
repaintAction);
}
else
{
SetCloseButtonState(
CloseButtonState.Normal,
repaintAction);
}
}
if (isClosable && Event.current.type == EventType.MouseDown)
{
if (mCloseButtonRect.Contains(Event.current.mousePosition))
{
SetCloseButtonState(
CloseButtonState.Clicked,
repaintAction);
Event.current.Use();
}
}
if (isClosable && Event.current.type == EventType.MouseUp)
{
if (mCloseButtonRect.Contains(Event.current.mousePosition))
{
Event.current.Use();
isCloseButtonClicked = true;
}
if (IsTabClickWithMiddleButton(toggleRect, Event.current))
{
Event.current.Use();
isCloseButtonClicked = true;
}
SetCloseButtonState(
CloseButtonState.Normal,
repaintAction);
}
bool isActive = GUI.Toggle(
toggleRect, wasActive, buttonText, buttonStyle);
if (isClosable && toggleRect.height > 1)
{
mCloseButtonRect = DrawCloseButton(
toggleRect,
mCloseButtonState);
}
if (wasActive)
{
DrawUnderline(toggleRect);
}
return isActive;
}
static Rect DrawCloseButton(
Rect toggleRect,
CloseButtonState state)
{
int closeButtonSize = 15;
GUIContent closeImage = new GUIContent(GetCloseImage(state));
Rect closeTabRect = new Rect(
toggleRect.xMax - closeButtonSize - 1,
toggleRect.y + (toggleRect.height / 2 - closeButtonSize / 2),
closeButtonSize,
closeButtonSize);
GUI.Button(closeTabRect, closeImage, EditorStyles.label);
return new Rect(
closeTabRect.x - 1,
closeTabRect.y - 1,
closeTabRect.width + 2,
closeTabRect.height + 2);
}
static void DrawUnderline(Rect toggleRect)
{
GUIStyle activeTabStyle =
UnityStyles.PlasticWindow.ActiveTabUnderline;
Rect underlineRect = new Rect(
toggleRect.x,
toggleRect.yMax - activeTabStyle.fixedHeight,
toggleRect.width,
activeTabStyle.fixedHeight);
GUI.Label(underlineRect, string.Empty, activeTabStyle);
}
static bool IsTabClickWithMiddleButton(Rect toggleRect, Event currentEvent)
{
if (currentEvent.button != 2)
return false;
return toggleRect.height > 1 &&
toggleRect.Contains(Event.current.mousePosition);
}
static Texture GetCloseImage(CloseButtonState state)
{
if (state == CloseButtonState.Hovered)
return Images.GetHoveredCloseIcon();
if (state == CloseButtonState.Clicked)
return Images.GetClickedCloseIcon();
return Images.GetCloseIcon();
}
void SetCloseButtonState(
CloseButtonState newState,
Action repaintAction)
{
if (mCloseButtonState == newState)
return;
mCloseButtonState = newState;
if (repaintAction != null)
repaintAction();
}
Rect mCloseButtonRect;
CloseButtonState mCloseButtonState;
enum CloseButtonState
{
Normal,
Clicked,
Hovered,
}
}
}
TabButtonUnity.PlasticSCM.Editor.UI