From 15740faf9fe9fe4be08965098bbf2947e096aeeb Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 14 Aug 2019 22:50:43 +0800 Subject: +Unity Runtime code --- Runtime/Graphs/UnityEngine.Graphs/TestHelpers.cs | 33 ++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Runtime/Graphs/UnityEngine.Graphs/TestHelpers.cs (limited to 'Runtime/Graphs/UnityEngine.Graphs/TestHelpers.cs') diff --git a/Runtime/Graphs/UnityEngine.Graphs/TestHelpers.cs b/Runtime/Graphs/UnityEngine.Graphs/TestHelpers.cs new file mode 100644 index 0000000..feb438b --- /dev/null +++ b/Runtime/Graphs/UnityEngine.Graphs/TestHelpers.cs @@ -0,0 +1,33 @@ +#if TESTING + +using UnityEngine; + +namespace UnityEngine.Graphs +{ + public class Testing + { + public class Object + { + public string name; + } + + public class ObjectSub1 : Object { } + public class ObjectSub2 : Object { } + + // fake animation curve. can't seem to be able to initialize real one out of Unity + public class AnimationCurve + { + public WrapMode postWrapMode; + public WrapMode preWrapMode; + public Keyframe[] keys; + public AnimationCurve(params Keyframe[] frames) { keys = frames; } + } + + public static bool AmIRunningInMono() + { + // internet says this is a supported way of detecting mono runtime + return System.Type.GetType ("Mono.Runtime") != null; + } + } +} +#endif -- cgit v1.1-26-g67d0