1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-16 15:16:33 +09:00

Unity defines for read/write reflection

This commit is contained in:
lidgren
2014-08-13 06:50:12 +00:00
parent 715746eed3
commit 009c947f94
2 changed files with 8 additions and 0 deletions

View File

@@ -93,7 +93,11 @@ namespace Lidgren.Network
value = readMethod.Invoke(this, null);
// set the value
#if UNITY_WEBPLAYER || UNITY_4_5
var setMethod = fi.GetSetMethod();
#else
var setMethod = fi.SetMethod;
#endif
if (setMethod != null)
setMethod.Invoke(target, new object[] { value });
}

View File

@@ -78,7 +78,11 @@ namespace Lidgren.Network
foreach (PropertyInfo fi in fields)
{
#if UNITY_WEBPLAYER || UNITY_4_5
MethodInfo getMethod = fi.GetGetMethod();
#else
MethodInfo getMethod = fi.GetMethod;
#endif
if (getMethod != null)
{
object value = getMethod.Invoke(ob, null);