1
This commit is contained in:
46
Src/UnityPluginsSupport/Tests/MiscTest.cs
Normal file
46
Src/UnityPluginsSupport/Tests/MiscTest.cs
Normal 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());
|
||||
}
|
||||
}
|
||||
}
|
11
Src/UnityPluginsSupport/Tests/MiscTest.cs.meta
Normal file
11
Src/UnityPluginsSupport/Tests/MiscTest.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 137b91c090f4d7c48900b464f41cd207
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
30
Src/UnityPluginsSupport/Tests/PointerTest.cs
Normal file
30
Src/UnityPluginsSupport/Tests/PointerTest.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
11
Src/UnityPluginsSupport/Tests/PointerTest.cs.meta
Normal file
11
Src/UnityPluginsSupport/Tests/PointerTest.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d7f67b1f1477cd8488ee9189cc6b805c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user