Files
Magical-Jumping-Bean/Library/metadata/30/309b0604924786544a3786ec4073c5a1
T

137 lines
9.6 KiB
Plaintext
Raw Normal View History

2019-09-29 19:40:54 -04:00
í&„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€j€H€wÿÿÿÿ€1€1€ÿÿÿÿ@Þ€€Q€j€H€€ÿÿÿÿ€1€1€ÿÿÿÿ@Þ€€Q€j€y€
€ Þ€#!€.€,"€€…ÿÿÿÿ#@1€1€ÿÿÿÿ$Þ€€%.€j€&Õ€“ÿÿÿÿ'€1€1€ÿÿÿÿ(ÀÞ€€)€j€ÿÿÿÿ*€H€›€ÿÿÿÿ+€1€1€ÿÿÿÿ,@Þ€€-Q€j€.y€
€ /Þ€#0€.€,1€ €§2@¾€¶ 3@Þ€#4€.€,5€H€»ÿÿÿÿ6€1€1€ÿÿÿÿ7@Þ€€8Q€j€9H€Æÿÿÿÿ:€1€1€ÿÿÿÿ;@Þ€€<Q€j€=H€Øÿÿÿÿ>€1€1€ÿÿÿÿ?@Þ€€@Q€j€AMonoImporterPPtr<EditorExtension>m_FileIDm_PathIDPPtr<PrefabInstance>m_ExternalObjectsSourceAssetIdentifiertypeassemblynamem_UsedFileIDsm_DefaultReferencesexecutionOrdericonm_UserDatam_AssetBundleNamem_AssetBundleVariantsÿÿ£Gñ×Ü�Z56 :!@iÁJ*�€7€ÿÿÿÿ€¦€²€E€ Þ€€.€€(a€ Þ€€.€€†€r€ Þ€ €.€
€H€«€ÿÿÿÿ €1€1€ÿÿÿÿ @Þ€€
Q€j€H€ê€ÿÿÿÿ€1€1€ÿÿÿÿ@Þ€€Q€j€ñ€=ÿÿÿÿ€1€1€ÿÿÿÿ€Þ€€€j€ÿÿÿÿ€H€›€ÿÿÿÿ€1€1€ÿÿÿÿ@Þ€€Q€j€y€
€ Þ€€.€€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_Namespacepp\ày¯Ð¤¹`@)thE¤shÎ7\FPackages/com.unity.ugui/Tests/Runtime/Layout/ContentSizeFitterTests.csày¯ContentSizeFitterTestsusing System.Collections.Generic;
using System.IO;
using NUnit.Framework;
using UnityEditor;
using UnityEngine;
using UnityEngine.TestTools;
using UnityEngine.UI;
using UnityEngine.UI.Tests;
namespace LayoutTests
{
class ContentSizeFitterTests : IPrebuildSetup
{
const string kPrefabPath = "Assets/Resources/ContentSizeFitterTests.prefab";
private GameObject m_PrefabRoot;
private ContentSizeFitter m_ContentSizeFitter;
private RectTransform m_RectTransform;
public void Setup()
{
#if UNITY_EDITOR
var rootGO = new GameObject("rootGo");
GameObject canvasGO = new GameObject("Canvas", typeof(RectTransform), typeof(Canvas));
canvasGO.transform.SetParent(rootGO.transform);
var canvas = canvasGO.GetComponent<Canvas>();
canvas.referencePixelsPerUnit = 100;
var testGO = new GameObject("TestObject", typeof(RectTransform), typeof(ContentSizeFitter));
testGO.transform.SetParent(canvasGO.transform);
if (!Directory.Exists("Assets/Resources/"))
Directory.CreateDirectory("Assets/Resources/");
PrefabUtility.SaveAsPrefabAsset(rootGO, kPrefabPath);
GameObject.DestroyImmediate(rootGO);
#endif
}
[SetUp]
public void TestSetup()
{
m_PrefabRoot = Object.Instantiate(Resources.Load("ContentSizeFitterTests")) as GameObject;
m_ContentSizeFitter = m_PrefabRoot.GetComponentInChildren<ContentSizeFitter>();
m_ContentSizeFitter.enabled = true;
m_RectTransform = m_ContentSizeFitter.GetComponent<RectTransform>();
m_RectTransform.sizeDelta = new Vector2(50, 50);
GameObject testObject = m_ContentSizeFitter.gameObject;
// set up components
var componentA = testObject.AddComponent<LayoutElement>();
componentA.minWidth = 5;
componentA.minHeight = 10;
componentA.preferredWidth = 100;
componentA.preferredHeight = 105;
componentA.flexibleWidth = 0;
componentA.flexibleHeight = 0;
componentA.enabled = true;
var componentB = testObject.AddComponent<LayoutElement>();
componentB.minWidth = 15;
componentB.minHeight = 20;
componentB.preferredWidth = 110;
componentB.preferredHeight = 115;
componentB.flexibleWidth = 0;
componentB.flexibleHeight = 0;
componentB.enabled = true;
var componentC = testObject.AddComponent<LayoutElement>();
componentC.minWidth = 25;
componentC.minHeight = 30;
componentC.preferredWidth = 120;
componentC.preferredHeight = 125;
componentC.flexibleWidth = 0;
componentC.flexibleHeight = 0;
componentC.enabled = true;
}
[TearDown]
public void TearDown()
{
m_PrefabRoot = null;
m_ContentSizeFitter = null;
m_RectTransform = null;
Object.Destroy(m_PrefabRoot);
}
[Test]
public void TestFitModeUnconstrained()
{
m_ContentSizeFitter.horizontalFit = ContentSizeFitter.FitMode.Unconstrained;
m_ContentSizeFitter.verticalFit = ContentSizeFitter.FitMode.Unconstrained;
m_ContentSizeFitter.SetLayoutHorizontal();
m_ContentSizeFitter.SetLayoutVertical();
Assert.AreEqual(50, m_RectTransform.rect.width);
Assert.AreEqual(50, m_RectTransform.rect.height);
}
[Test]
public void TestFitModeMinSize()
{
m_ContentSizeFitter.horizontalFit = ContentSizeFitter.FitMode.MinSize;
m_ContentSizeFitter.verticalFit = ContentSizeFitter.FitMode.MinSize;
m_ContentSizeFitter.SetLayoutHorizontal();
m_ContentSizeFitter.SetLayoutVertical();
Assert.AreEqual(25, m_RectTransform.rect.width);
Assert.AreEqual(30, m_RectTransform.rect.height);
}
[Test]
public void TestFitModePreferredSize()
{
m_ContentSizeFitter.horizontalFit = ContentSizeFitter.FitMode.PreferredSize;
m_ContentSizeFitter.verticalFit = ContentSizeFitter.FitMode.PreferredSize;
m_ContentSizeFitter.SetLayoutHorizontal();
m_ContentSizeFitter.SetLayoutVertical();
Assert.AreEqual(120, m_RectTransform.rect.width);
Assert.AreEqual(125, m_RectTransform.rect.height);