Skip to content

Commit

Permalink
Remove reflection code
Browse files Browse the repository at this point in the history
See #5, #10
  • Loading branch information
muckSponge committed Feb 1, 2020
1 parent a22fecc commit 08d3db3
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 146 deletions.
2 changes: 1 addition & 1 deletion UnityAsync/Assets/UnityAsync/AwaitInstructionAwaiter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public bool Evaluate()
// if owner is destroyed, behaves like a UnityEngine.Coroutine, ie:
// "With this object's death, the thread of prophecy is severed. Restore a saved game to restore the
// weave of fate, or persist in the doomed world you have created."
if(!owner.IsAlive())
if(!owner)
return true;

// if not completed, return false to put it back into a queue for next frame
Expand Down
16 changes: 0 additions & 16 deletions UnityAsync/Assets/UnityAsync/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,6 @@ namespace UnityAsync
{
public static class Extensions
{
#if !ENABLE_IL2CPP

static readonly Func<Object, IntPtr> ObjectPtrGetter;

static Extensions() => ReflectionUtility.GenerateFieldGetter("m_CachedPtr", out ObjectPtrGetter);

[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static bool IsAlive(this Object o) => ObjectPtrGetter(o) != IntPtr.Zero;

#else

[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static bool IsAlive(this Object o) => o != null;

#endif

/// <summary>
/// Link the <see cref="UnityAsync.IAwaitInstruction"/>'s lifespan to a <see cref="UnityEngine.Object"/> and
/// configure the type of update cycle it should be evaluated on.
Expand Down
9 changes: 0 additions & 9 deletions UnityAsync/Assets/UnityAsync/Plugins.meta

This file was deleted.

Binary file not shown.
34 changes: 0 additions & 34 deletions UnityAsync/Assets/UnityAsync/Plugins/System.Runtime.dll.meta

This file was deleted.

83 changes: 0 additions & 83 deletions UnityAsync/Assets/UnityAsync/ReflectionUtility.cs

This file was deleted.

3 changes: 0 additions & 3 deletions UnityAsync/Assets/UnityAsync/ReflectionUtility.cs.meta

This file was deleted.

0 comments on commit 08d3db3

Please sign in to comment.