This commit is contained in:
CortexCore
2024-03-31 23:31:00 +08:00
parent e179d2eb53
commit b7b89ee71a
641 changed files with 31286 additions and 22134 deletions

View File

@@ -0,0 +1,46 @@
using System;
using System.Collections;
using System.Collections.Generic;
using NUnit.Framework;
using UnityEngine;
using System.Text;
using UnityEngine.TestTools;
using System.Linq;
using UnityEditor;
using Random = UnityEngine.Random;
namespace BITKit
{
public class MiscTest
{
[Test]
public static void CheckPath()
{
var reportBuilder = new StringBuilder();
reportBuilder.AppendLine($"{nameof(EditorApplication.applicationPath)}:{EditorApplication.applicationPath}");
reportBuilder.AppendLine($"{nameof(Application.dataPath)}:{Application.dataPath}");
reportBuilder.AppendLine($"{nameof(Environment.CurrentDirectory)}:{Environment.CurrentDirectory}");
reportBuilder.AppendLine($"{nameof(Application.streamingAssetsPath)}:{Application.streamingAssetsPath}");
reportBuilder.AppendLine($"{nameof(Application.persistentDataPath)}:{Application.persistentDataPath}");
reportBuilder.AppendLine($"{nameof(Application.temporaryCachePath)}:{Application.temporaryCachePath}");
reportBuilder.AppendLine($"{nameof(Application.consoleLogPath)}:{Application.consoleLogPath}");
reportBuilder.AppendLine($"{nameof(Application.installerName)}:{Application.installerName}");
reportBuilder.AppendLine($"{nameof(Application.companyName)}:{Application.companyName}");
reportBuilder.AppendLine($"{nameof(Application.productName)}:{Application.productName}");
reportBuilder.AppendLine($"{nameof(Application.version)}:{Application.version}");
reportBuilder.AppendLine($"{nameof(Application.unityVersion)}:{Application.unityVersion}");
reportBuilder.AppendLine($"{nameof(Application.identifier)}:{Application.identifier}");
reportBuilder.AppendLine($"{nameof(Application.internetReachability)}:{Application.internetReachability}");
reportBuilder.AppendLine($"{nameof(Application.systemLanguage)}:{Application.systemLanguage}");
reportBuilder.AppendLine($"{nameof(Application.platform)}:{Application.platform}");
reportBuilder.AppendLine($"{nameof(Application.isMobilePlatform)}:{Application.isMobilePlatform}");
reportBuilder.AppendLine($"{nameof(Application.isConsolePlatform)}:{Application.isConsolePlatform}");
reportBuilder.AppendLine($"{nameof(Application.isEditor)}:{Application.isEditor}");
reportBuilder.AppendLine($"{nameof(Application.isFocused)}:{Application.isFocused}");
reportBuilder.AppendLine($"{nameof(Application.isPlaying)}:{Application.isPlaying}");
reportBuilder.AppendLine($"{nameof(Application.isBatchMode)}:{Application.isBatchMode}");
Debug.Log(reportBuilder.ToString());
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 137b91c090f4d7c48900b464f41cd207
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,30 @@
using System;
using System.Collections;
using System.Collections.Generic;
using NUnit.Framework;
using UnityEngine;
using System.Text;
using UnityEngine.TestTools;
using System.Linq;
namespace BITKit
{
public class PointerTest
{
public object value;
[Test]
public void MakeRefAndRefValue()
{
value = 64;
var typedReference = __makeref(value);
var field = typeof(PointerTest).GetField("value");
field.SetValueDirect(typedReference,128);
__refvalue(typedReference,object) = 128;
Debug.Log("预期值:128,实际值:"+value);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d7f67b1f1477cd8488ee9189cc6b805c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: