Files
Magical-Jumping-Bean/Library/metadata/97/97a05971510726f438153cd4987526fb
T

143 lines
10 KiB
Plaintext
Raw Normal View History

2019-09-29 19:40:54 -04:00
í)h2019.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_Namespace|€\ày¯àxy
•pbOƒQÃM‰Wb¿QPackages/com.unity.test-framework/UnityEditor.TestRunner/GUI/TestListGuiHelper.csày¯TestListGuiHelperusing System;
using System.IO;
using System.Linq;
using UnityEditor.ProjectWindowCallback;
using UnityEditor.Scripting.ScriptCompilation;
using UnityEngine;
namespace UnityEditor.TestTools.TestRunner.GUI
{
internal class TestListGUIHelper
{
private const string kResourcesTemplatePath = "Resources/ScriptTemplates";
private const string kAssemblyDefinitionTestTemplate = "92-Assembly Definition-NewTestAssembly.asmdef.txt";
private const string kAssemblyDefinitionEditModeTestTemplate =
"92-Assembly Definition-NewEditModeTestAssembly.asmdef.txt";
private const string kTestScriptTemplate = "83-C# Script-NewTestScript.cs.txt";
private const string kNewTestScriptName = "NewTestScript.cs";
private const string kNunit = "nunit.framework.dll";
[MenuItem("Assets/Create/Testing/Tests Assembly Folder", false, 83)]
public static void MenuItemAddFolderAndAsmDefForTesting()
{
AddFolderAndAsmDefForTesting();
}
[MenuItem("Assets/Create/Testing/Tests Assembly Folder", true, 83)]
public static bool MenuItemAddFolderAndAsmDefForTestingWithValidation()
{
return !SelectedFolderContainsTestAssembly();
}
public static void AddFolderAndAsmDefForTesting(bool isEditorOnly = false)
{
ProjectWindowUtil.CreateFolderWithTemplates("Tests",
isEditorOnly ? kAssemblyDefinitionEditModeTestTemplate : kAssemblyDefinitionTestTemplate);
}
public static bool SelectedFolderContainsTestAssembly()
{
var theNearestCustomScriptAssembly = GetTheNearestCustomScriptAssembly();
if (theNearestCustomScriptAssembly != null)
{
return theNearestCustomScriptAssembly.PrecompiledReferences != null && theNearestCustomScriptAssembly.PrecompiledReferences.Any(x => Path.GetFileName(x) == kNunit);
}
return false;
}
[MenuItem("Assets/Create/Testing/C# Test Script", false, 83)]
public static void AddTest()
{
var basePath = Path.Combine(EditorApplication.applicationContentsPath, kResourcesTemplatePath);
var destPath = Path.Combine(GetActiveFolderPath(), kNewTestScriptName);
var templatePath = Path.Combine(basePath, kTestScriptTemplate);
var icon = EditorGUIUtility.IconContent("cs Script Icon").image as Texture2D;
ProjectWindowUtil.StartNameEditingIfProjectWindowExists(0,
ScriptableObject.CreateInstance<DoCreateScriptAsset>(), destPath, icon, templatePath);
AssetDatabase.Refresh();
}
[MenuItem("Assets/Create/Testing/C# Test Script", true, 83)]
public static bool CanAddScriptAndItWillCompile()
{
return CanAddEditModeTestScriptAndItWillCompile() || CanAddPlayModeTestScriptAndItWillCompile();
}
public static bool CanAddEditModeTestScriptAndItWillCompile()
{
var theNearestCustomScriptAssembly = GetTheNearestCustomScriptAssembly();
if (theNearestCustomScriptAssembly != null)
{
return (theNearestCustomScriptAssembly.AssemblyFlags & AssemblyFlags.EditorOnly) ==
AssemblyFlags.EditorOnly;
}
var activeFolderPath = GetActiveFolderPath();
return activeFolderPath.ToLower().Contains("/editor");
}
public static bool CanAddPlayModeTestScriptAndItWillCompile()
{
if (PlayerSettings.playModeTestRunnerEnabled)
{
return true;
}
var theNearestCustomScriptAssembly = GetTheNearestCustomScriptAssembly();
if (theNearestCustomScriptAssembly == null)
{
return false;
}
var hasTestAssemblyFlag = theNearestCustomScriptAssembly.PrecompiledReferences != null && theNearestCustomScriptAssembly.PrecompiledReferences.Any(x => Path.GetFileName(x) == kNunit);;
var editorOnlyAssembly = (theNearestCustomScriptAssembly.AssemblyFlags & AssemblyFlags.EditorOnly) != 0;
return hasTestAssemblyFlag && !editorOnlyAssembly;
}
public static string GetActiveFolderPath()
{
var path = "Assets";
foreach (var obj in Selection.GetFiltered(typeof(UnityEngine.Object), SelectionMode.Assets))
{
path = AssetDatabase.GetAssetPath(obj);
if (!string.IsNullOrEmpty(path) && File.Exists(path))
{
path = Path.GetDirectoryName(path);
break;
}
}
return path;
}
private static CustomScriptAssembly GetTheNearestCustomScriptAssembly()
{
CustomScriptAssembly findCustomScriptAssemblyFromScriptPath;
try
{
findCustomScriptAssemblyFromScriptPath =
EditorCompilationInterface.Instance.FindCustomScriptAssemblyFromScriptPath(
Path.Combine(GetActiveFolderPath(), "Foo.cs"));
}
catch (Exception)
{
return null;
}
return findCustomScriptAssemblyFromScriptPath;