Files
Magical-Jumping-Bean/Library/metadata/7b/7bd96d76711152648a736c4d28d865f2
T

227 lines
13 KiB
Plaintext
Raw Normal View History

2019-09-29 19:40:54 -04:00
í5˜2019.2.3f1þÿÿÿÿÿ’3$øÌuñ옲e+ Í=^7€ÿÿÿÿ¦€²Ð¦¦¦€#¦€+H€3ÿÿÿÿ1€1€ÿÿÿÿ@Þ Q€j
H€<ÿÿÿÿ 1€1€ÿÿÿÿ @Þ
Q€jÕ€Iÿÿÿÿ1€1€ÿÿÿÿÀÞH€j€ÿÿÿÿ1€1€ÿÿÿÿ@ÞQ€j€PAssetMetaDataguiddata[0]data[1]data[2]data[3]pathNameoriginalNamelabelsassetStoreRef ÿÿfš†!ë5˜9Ý4QÁóBí7€ÿÿÿÿ¦€²
E Þ€#.€,5a Þ€#.€,€r Þ€# .€,
H€«€ÿÿÿÿ 1€1€ÿÿÿÿ @Þ
Q€jñ€JÿÿÿÿÀ1€1€ÿÿÿÿÞ€j€ÿÿÿÿ\€ÿÿÿÿH€rÿÿÿÿ1€1€ÿÿÿÿ@ÞQ€jH€wÿÿÿÿ1€1€ÿÿÿÿ@ÞQ€jH€€ÿÿÿÿ1€1€ÿÿÿÿ@ÞQ€jy
 Þ€#!.€,"€…ÿÿÿÿ#@1€1€ÿÿÿÿ$Þ%.€j&Õ€“ÿÿÿÿ'1€1€ÿÿÿÿ(ÀÞ)€j€ÿÿÿÿ*H€›€ÿÿÿÿ+1€1€ÿÿÿÿ,@Þ-Q€j.y
 /Þ€#0.€,1 €§2@¾€¶ 3@Þ€#4.€,5H€»ÿÿÿÿ61€1€ÿÿÿÿ7@Þ8Q€j9H€Æÿÿÿÿ:1€1€ÿÿÿÿ;@Þ<Q€j=H€Øÿÿÿÿ>1€1€ÿÿÿÿ?@Þ@Q€jAMonoImporterPPtr<EditorExtension>m_FileIDm_PathIDPPtr<PrefabInstance>m_ExternalObjectsSourceAssetIdentifiertypeassemblynamem_UsedFileIDsm_DefaultReferencesexecutionOrdericonm_UserDatam_AssetBundleNamem_AssetBundleVariantsÿÿ£Gñ×ÜZ56 :!@iÁJ*€7€ÿÿÿÿ¦€²E Þ.(a Þ.€r Þ .
H€«€ÿÿÿÿ 1€1€ÿÿÿÿ @Þ
Q€jH€ê€ÿÿÿÿ1€1€ÿÿÿÿ@ÞQ€jñ€=ÿÿÿÿ1€1€ÿÿÿÿÞ€j€ÿÿÿÿH€›€ÿÿÿÿ1€1€ÿÿÿÿ@ÞQ€jy
 Þ.y€Q Þ. Þ€X!H€iÿÿÿÿ"1€1€ÿÿÿÿ#@Þ$Q€j%H€uÿÿÿÿ&1€1€ÿÿÿÿ'@Þ(Q€j)PPtr<EditorExtension>m_FileIDm_PathIDPPtr<PrefabInstance>m_DefaultReferencesm_Iconm_ExecutionOrderm_ClassNamem_Namespace``\ày¯ÀÈ!·Ög%F¨7ÆÔ‚V/8Packages/com.unity.ugui/Runtime/UI/Core/MaskUtilities.csày¯
MaskUtilitiesL!using System.Collections.Generic;
using UnityEngine.EventSystems;
namespace UnityEngine.UI
{
/// <summary>
/// Mask related utility class. This class provides masking-specific utility functions.
/// </summary>
public class MaskUtilities
{
/// <summary>
/// Notify all IClippables under the given component that they need to recalculate clipping.
/// </summary>
/// <param name="mask">The object thats changed for whose children should be notified.</param>
public static void Notify2DMaskStateChanged(Component mask)
{
var components = ListPool<Component>.Get();
mask.GetComponentsInChildren(components);
for (var i = 0; i < components.Count; i++)
{
if (components[i] == null || components[i].gameObject == mask.gameObject)
continue;
var toNotify = components[i] as IClippable;
if (toNotify != null)
toNotify.RecalculateClipping();
}
ListPool<Component>.Release(components);
}
/// <summary>
/// Notify all IMaskable under the given component that they need to recalculate masking.
/// </summary>
/// <param name="mask">The object thats changed for whose children should be notified.</param>
public static void NotifyStencilStateChanged(Component mask)
{
var components = ListPool<Component>.Get();
mask.GetComponentsInChildren(components);
for (var i = 0; i < components.Count; i++)
{
if (components[i] == null || components[i].gameObject == mask.gameObject)
continue;
var toNotify = components[i] as IMaskable;
if (toNotify != null)
toNotify.RecalculateMasking();
}
ListPool<Component>.Release(components);
}
/// <summary>
/// Find a root Canvas.
/// </summary>
/// <param name="start">Transform to start the search at going up the hierarchy.</param>
/// <returns>Finds either the most root canvas, or the first canvas that overrides sorting.</returns>
public static Transform FindRootSortOverrideCanvas(Transform start)
{
var canvasList = ListPool<Canvas>.Get();
start.GetComponentsInParent(false, canvasList);
Canvas canvas = null;
for (int i = 0; i < canvasList.Count; ++i)
{
canvas = canvasList[i];
// We found the canvas we want to use break
if (canvas.overrideSorting)
break;
}
ListPool<Canvas>.Release(canvasList);
return canvas != null ? canvas.transform : null;
}
/// <summary>
/// Find the stencil depth for a given element.
/// </summary>
/// <param name="transform">The starting transform to search.</param>
/// <param name="stopAfter">Where the search of parents should stop</param>
/// <returns>What the proper stencil buffer index should be.</returns>
public static int GetStencilDepth(Transform transform, Transform stopAfter)
{
var depth = 0;
if (transform == stopAfter)
return depth;
var t = transform.parent;
var components = ListPool<Mask>.Get();
while (t != null)
{
t.GetComponents<Mask>(components);
for (var i = 0; i < components.Count; ++i)
{
if (components[i] != null && components[i].MaskEnabled() && components[i].graphic.IsActive())
{
++depth;
break;
}
}
if (t == stopAfter)
break;
t = t.parent;
}
ListPool<Mask>.Release(components);
return depth;
}
/// <summary>
/// Helper function to determine if the child is a descendant of father or is father.
/// </summary>
/// <param name="father">The transform to compare against.</param>
/// <param name="child">The starting transform to search up the hierarchy.</param>
/// <returns>Is child equal to father or is a descendant.</returns>
public static bool IsDescendantOrSelf(Transform father, Transform child)
{
if (father == null || child == null)
return false;
if (father == child)
return true;
while (child.parent != null)
{
if (child.parent == father)
return true;
child = child.parent;
}
return false;
}
/// <summary>
/// Find the correct RectMask2D for a given IClippable.
/// </summary>
/// <param name="clippable">Clippable to search from.</param>
/// <returns>The Correct RectMask2D</returns>
public static RectMask2D GetRectMaskForClippable(IClippable clippable)
{
List<RectMask2D> rectMaskComponents = ListPool<RectMask2D>.Get();
List<Canvas> canvasComponents = ListPool<Canvas>.Get();
RectMask2D componentToReturn = null;
clippable.gameObject.GetComponentsInParent(false, rectMaskComponents);
if (rectMaskComponents.Count > 0)
{
for (int rmi = 0; rmi < rectMaskComponents.Count; rmi++)
{
componentToReturn = rectMaskComponents[rmi];
if (componentToReturn.gameObject == clippable.gameObject)
{
componentToReturn = null;
continue;
}
if (!componentToReturn.isActiveAndEnabled)
{
componentToReturn = null;
continue;
}
clippable.gameObject.GetComponentsInParent(false, canvasComponents);
for (int i = canvasComponents.Count - 1; i >= 0; i--)
{
if (!IsDescendantOrSelf(canvasComponents[i].transform, componentToReturn.transform) && canvasComponents[i].overrideSorting)
{
componentToReturn = null;
break;
}
}
break;
}
}
ListPool<RectMask2D>.Release(rectMaskComponents);
ListPool<Canvas>.Release(canvasComponents);
return componentToReturn;
}
/// <summary>
/// Search for all RectMask2D that apply to the given RectMask2D (includes self).
/// </summary>
/// <param name="clipper">Starting clipping object.</param>
/// <param name="masks">The list of Rect masks</param>
public static void GetRectMasksForClip(RectMask2D clipper, List<RectMask2D> masks)
{
masks.Clear();
List<Canvas> canvasComponents = ListPool<Canvas>.Get();
List<RectMask2D> rectMaskComponents = ListPool<RectMask2D>.Get();
clipper.transform.GetComponentsInParent(false, rectMaskComponents);
if (rectMaskComponents.Count > 0)
{
clipper.transform.GetComponentsInParent(false, canvasComponents);
for (int i = rectMaskComponents.Count - 1; i >= 0; i--)
{
if (!rectMaskComponents[i].IsActive())
continue;
bool shouldAdd = true;
for (int j = canvasComponents.Count - 1; j >= 0; j--)
{
if (!IsDescendantOrSelf(canvasComponents[j].transform, rectMaskComponents[i].transform) && canvasComponents[j].overrideSorting)
{
shouldAdd = false;
break;
}
}
if (shouldAdd)
masks.Add(rectMaskComponents[i]);
}
}
ListPool<RectMask2D>.Release(rectMaskComponents);