1
This commit is contained in:
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);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user