diff --git a/Assets/Log.meta b/Assets/Log.meta
new file mode 100644
index 0000000..4a9f806
--- /dev/null
+++ b/Assets/Log.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: d7bae51a3913b984380f561b9de2ec0a
+folderAsset: yes
+timeCreated: 1468956714
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Log/Editor.meta b/Assets/Log/Editor.meta
new file mode 100644
index 0000000..b0624f5
--- /dev/null
+++ b/Assets/Log/Editor.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 66c5add3ed5f12c4a8564c4eb5a148b4
+folderAsset: yes
+timeCreated: 1468981638
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Log/Editor/2016-07-28.log.meta b/Assets/Log/Editor/2016-07-28.log.meta
new file mode 100644
index 0000000..c64b6da
--- /dev/null
+++ b/Assets/Log/Editor/2016-07-28.log.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 00de81cfa12d79542ad172e04fa198b2
+timeCreated: 1469666581
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Log/Editor/2016-07-29.log.meta b/Assets/Log/Editor/2016-07-29.log.meta
new file mode 100644
index 0000000..3e54305
--- /dev/null
+++ b/Assets/Log/Editor/2016-07-29.log.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: c6ebea9b76dbdfa409a397efb75f97b7
+timeCreated: 1469747499
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Log/Editor/Log2Console.meta b/Assets/Log/Editor/Log2Console.meta
new file mode 100644
index 0000000..15598df
--- /dev/null
+++ b/Assets/Log/Editor/Log2Console.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 5fb840d1a868f704c82760cc925c73c0
+folderAsset: yes
+timeCreated: 1468981673
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Log/Editor/Log2Console/Log2Console.exe.config b/Assets/Log/Editor/Log2Console/Log2Console.exe.config
new file mode 100644
index 0000000..62e7b15
--- /dev/null
+++ b/Assets/Log/Editor/Log2Console/Log2Console.exe.config
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Assets/Log/Editor/Log2Console/Log2Console.exe.config.meta b/Assets/Log/Editor/Log2Console/Log2Console.exe.config.meta
new file mode 100644
index 0000000..bb818e3
--- /dev/null
+++ b/Assets/Log/Editor/Log2Console/Log2Console.exe.config.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: d7dbce948daeafc4a8d64508afba6945
+timeCreated: 1468981673
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Log/Editor/Log2Console/Log2Console.exe.meta b/Assets/Log/Editor/Log2Console/Log2Console.exe.meta
new file mode 100644
index 0000000..7cffdd8
--- /dev/null
+++ b/Assets/Log/Editor/Log2Console/Log2Console.exe.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 946013e54fd388149a1aa703cef31260
+timeCreated: 1468981673
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Log/Editor/Log2Console/log4net.dll.meta b/Assets/Log/Editor/Log2Console/log4net.dll.meta
new file mode 100644
index 0000000..be6e29c
--- /dev/null
+++ b/Assets/Log/Editor/Log2Console/log4net.dll.meta
@@ -0,0 +1,24 @@
+fileFormatVersion: 2
+guid: e0ca4996a54296f458034ced9dafccb8
+timeCreated: 1468981673
+licenseType: Pro
+PluginImporter:
+ serializedVersion: 1
+ iconMap: {}
+ executionOrder: {}
+ isPreloaded: 0
+ platformData:
+ Any:
+ enabled: 0
+ settings: {}
+ Editor:
+ enabled: 1
+ settings:
+ DefaultValueInitialized: true
+ WindowsStoreApps:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Log/Editor/LoggerUtility.rar b/Assets/Log/Editor/LoggerUtility.rar
new file mode 100644
index 0000000..3e98007
Binary files /dev/null and b/Assets/Log/Editor/LoggerUtility.rar differ
diff --git a/Assets/Log/Editor/LoggerUtility.rar.meta b/Assets/Log/Editor/LoggerUtility.rar.meta
new file mode 100644
index 0000000..c629944
--- /dev/null
+++ b/Assets/Log/Editor/LoggerUtility.rar.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: ff273ab578bc0f34fbbf8647412ae1ca
+timeCreated: 1468982290
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Log/ILogExtensions.cs b/Assets/Log/ILogExtensions.cs
new file mode 100644
index 0000000..ade5036
--- /dev/null
+++ b/Assets/Log/ILogExtensions.cs
@@ -0,0 +1,35 @@
+using System;
+using log4net;
+
+public static class ILogExtentions
+{
+ private static log4net.ILog log =
+ log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
+ private static void usage()
+ {
+ log.Debug("usage");
+ }
+
+ public static void Trace(this ILog log, string message, Exception exception)
+ {
+ log.Logger.Log(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType,
+ log4net.Core.Level.Trace, message, exception);
+ }
+
+ public static void Trace(this ILog log, string message)
+ {
+ log.Trace(message, null);
+ }
+
+ public static void Verbose(this ILog log, string message, Exception exception)
+ {
+ log.Logger.Log(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType,
+ log4net.Core.Level.Verbose, message, exception);
+ }
+
+ public static void Verbose(this ILog log, string message)
+ {
+ log.Verbose(message, null);
+ }
+}
\ No newline at end of file
diff --git a/Assets/Log/ILogExtensions.cs.meta b/Assets/Log/ILogExtensions.cs.meta
new file mode 100644
index 0000000..126fa1d
--- /dev/null
+++ b/Assets/Log/ILogExtensions.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 602b8a4193c359440926533b9b168e4e
+timeCreated: 1468989533
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Log/LoggerConfig.xml b/Assets/Log/LoggerConfig.xml
new file mode 100644
index 0000000..344102e
--- /dev/null
+++ b/Assets/Log/LoggerConfig.xml
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Assets/Log/LoggerConfig.xml.meta b/Assets/Log/LoggerConfig.xml.meta
new file mode 100644
index 0000000..0032dd2
--- /dev/null
+++ b/Assets/Log/LoggerConfig.xml.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: b765d0c26d0196c4a9642def00172b64
+timeCreated: 1468957534
+licenseType: Pro
+TextScriptImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Log/TestAssert.cs b/Assets/Log/TestAssert.cs
new file mode 100644
index 0000000..3bf35b8
--- /dev/null
+++ b/Assets/Log/TestAssert.cs
@@ -0,0 +1,151 @@
+
+using System;
+
+public enum lev
+{
+ Trace,
+ Debug,
+ Info,
+ Warn,
+ Error,
+ Fatal,
+}
+
+public static class TestAssert
+{
+ public static bool isEnabled
+ {
+ get
+ {
+#if UNITY_EDITOR
+ return true;
+#else
+ return false;
+#endif
+ }
+ }
+
+ public static void Throw()
+ {
+ Throw("Assert hit!");
+ }
+
+ public static void Throw(string message)
+ {
+ throw new ZenjectException(message);
+ }
+
+ public static void Throw(string message, params object[] parameters)
+ {
+ throw new ZenjectException(
+ FormatString(message, parameters));
+ }
+ public static string FormatString(string format, params object[] parameters)
+ {
+ // doin this funky loop to ensure nulls are replaced with "NULL"
+ // and that the original parameters array will not be modified
+ if (parameters != null && parameters.Length > 0)
+ {
+ object[] paramToUse = parameters;
+
+ foreach (object cur in parameters)
+ {
+ if (cur == null)
+ {
+ paramToUse = new object[parameters.Length];
+
+ for (int i = 0; i < parameters.Length; ++i)
+ {
+ paramToUse[i] = parameters[i] ?? "NULL";
+ }
+
+ break;
+ }
+ }
+
+ format = string.Format(format, paramToUse);
+ }
+
+ return format;
+ }
+
+
+ public static void That(bool condition, Func messageGenerator)
+ {
+ if (!condition)
+ {
+
+ Throw("Assert hit! " + messageGenerator());
+ }
+ }
+
+ public static void That(
+ bool condition, string message, params object[] parameters)
+ {
+ if (!condition)
+ {
+ Throw("Assert hit! " + FormatString(message, parameters));
+ }
+ }
+
+ public static void That(bool condition, Enum level, string message)
+ {
+ if (!condition)
+ {
+ if (level == null)
+ {
+ TestLoadConfig.log.Error("请输入lev的枚举类型");
+ Throw("Assert hit! ");
+ }
+ int pass = Convert.ToInt16(level);
+ switch (pass)
+ {
+ case (int)lev.Trace:
+ TestLoadConfig.log.Trace("Assert hit!!!" + message);
+ break;
+ case (int)lev.Debug:
+ TestLoadConfig.log.Debug("Assert hit!!!" + message);
+ break;
+ case (int)lev.Info:
+ TestLoadConfig.log.Info("Assert hit!!!" + message);
+ break;
+ case (int)lev.Warn:
+ TestLoadConfig.log.Warn("Assert hit!!!" + message);
+ break;
+ case (int)lev.Error:
+ TestLoadConfig.log.Error(message);
+ Throw("Assert hit! ");
+ break;
+ case (int)lev.Fatal:
+ TestLoadConfig.log.Fatal(message);
+ Throw("Assert hit! ");
+ break;
+ default:
+ TestLoadConfig.log.Error("请输入lev的枚举类型");
+ Throw("Assert hit! ");
+ break;
+ }
+ }
+ }
+
+
+ public static void getLevel(Enum level,string message)
+ {
+
+ }
+}
+
+[System.Diagnostics.DebuggerStepThrough]
+public class ZenjectException : Exception
+{
+ public ZenjectException(string message)
+ : base(message)
+ {
+ }
+
+ public ZenjectException(
+ string message, Exception innerException)
+ : base(message, innerException)
+ {
+ }
+}
\ No newline at end of file
diff --git a/Assets/Log/TestAssert.cs.meta b/Assets/Log/TestAssert.cs.meta
new file mode 100644
index 0000000..4701658
--- /dev/null
+++ b/Assets/Log/TestAssert.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 195a6c7aaa763064db9e0a6af7d5454a
+timeCreated: 1469011686
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Log/TestDebugLog.cs b/Assets/Log/TestDebugLog.cs
new file mode 100644
index 0000000..0e04b1f
--- /dev/null
+++ b/Assets/Log/TestDebugLog.cs
@@ -0,0 +1,28 @@
+using UnityEngine;
+
+public class TestDebugLog : MonoBehaviour {
+
+ // Use this for initialization
+ void Start () {
+
+ }
+
+ // Update is called once per frame
+ void Update () {
+ if (Input.GetMouseButtonDown(0))
+ {
+ Debug.Log("Clink The Mouse");
+ TestLoadConfig.log.Trace("跟踪信息");
+ TestLoadConfig.log.Debug("测试信息");
+ TestLoadConfig.log.Info("提示信息");
+ TestLoadConfig.log.Warn("警告信息");
+ TestLoadConfig.log.Error("一般错误信息");
+ TestLoadConfig.log.Fatal("致命错误信息");
+
+ TestAssert.That(true, lev.Debug, "TestDebugLog GetMouseButtonDown|");
+ }
+
+ }
+
+
+}
diff --git a/Assets/Log/TestDebugLog.cs.meta b/Assets/Log/TestDebugLog.cs.meta
new file mode 100644
index 0000000..d28d69d
--- /dev/null
+++ b/Assets/Log/TestDebugLog.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: dcffa1cd18236584c8831c73a3711986
+timeCreated: 1468957959
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Log/TestLoadConfig.cs b/Assets/Log/TestLoadConfig.cs
new file mode 100644
index 0000000..d7a8cad
--- /dev/null
+++ b/Assets/Log/TestLoadConfig.cs
@@ -0,0 +1,17 @@
+using UnityEngine;
+using log4net;
+using log4net.Config;
+using System.IO;
+
+public class TestLoadConfig : MonoBehaviour {
+
+ public static readonly ILog log = LogManager.GetLogger(typeof(TestLoadConfig));
+ private const string LOG4NET_CONF_FILE_PATH = "/Log/LoggerConfig.xml";
+ static TestLoadConfig()
+ {
+ string confFilePath = Application.dataPath + LOG4NET_CONF_FILE_PATH;
+ Debug.Log(confFilePath);
+ FileInfo fileInfo=new FileInfo(confFilePath);
+ XmlConfigurator.Configure(fileInfo);
+ }
+}
diff --git a/Assets/Log/TestLoadConfig.cs.meta b/Assets/Log/TestLoadConfig.cs.meta
new file mode 100644
index 0000000..56d4ee6
--- /dev/null
+++ b/Assets/Log/TestLoadConfig.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: a76e48873e78b0c47ae94202b7ce417c
+timeCreated: 1468957553
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Log/log4net.dll.meta b/Assets/Log/log4net.dll.meta
new file mode 100644
index 0000000..9a15fe1
--- /dev/null
+++ b/Assets/Log/log4net.dll.meta
@@ -0,0 +1,24 @@
+fileFormatVersion: 2
+guid: beb9162069f3dd9438b0419c10ea863c
+timeCreated: 1469067416
+licenseType: Pro
+PluginImporter:
+ serializedVersion: 1
+ iconMap: {}
+ executionOrder: {}
+ isPreloaded: 0
+ platformData:
+ Any:
+ enabled: 1
+ settings: {}
+ Editor:
+ enabled: 0
+ settings:
+ DefaultValueInitialized: true
+ WindowsStoreApps:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Log/test.unity b/Assets/Log/test.unity
new file mode 100644
index 0000000..1eb52bc
Binary files /dev/null and b/Assets/Log/test.unity differ
diff --git a/Assets/Log/test.unity.meta b/Assets/Log/test.unity.meta
new file mode 100644
index 0000000..d2594da
--- /dev/null
+++ b/Assets/Log/test.unity.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 697fc033004b3fa46925c5dd0ad900dc
+timeCreated: 1468956318
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/StrangeIoc.meta b/Assets/StrangeIoc.meta
new file mode 100644
index 0000000..fbf190e
--- /dev/null
+++ b/Assets/StrangeIoc.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: eac026f662996d54fbe5bba4d032858d
+folderAsset: yes
+timeCreated: 1468886829
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/StrangeIoc/scripts.meta b/Assets/StrangeIoc/scripts.meta
new file mode 100644
index 0000000..5abd75e
--- /dev/null
+++ b/Assets/StrangeIoc/scripts.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 35ed4d577fc349f41b9a089ae70f2b10
+folderAsset: yes
+timeCreated: 1468886838
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/StrangeIoc/scripts/DOTween.meta b/Assets/StrangeIoc/scripts/DOTween.meta
new file mode 100644
index 0000000..96ef3cb
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/DOTween.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 1a8a3dc295af2d3458ffeeb7243a0221
+folderAsset: yes
+timeCreated: 1469660856
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/StrangeIoc/scripts/DOTween/DOTween.XML b/Assets/StrangeIoc/scripts/DOTween/DOTween.XML
new file mode 100644
index 0000000..33c9717
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/DOTween/DOTween.XML
@@ -0,0 +1,2438 @@
+
+
+
+ DOTween
+
+
+
+
+ Types of autoPlay behaviours
+
+
+
+ No tween is automatically played
+
+
+ Only Sequences are automatically played
+
+
+ Only Tweeners are automatically played
+
+
+ All tweens are automatically played
+
+
+
+ What axis to constrain in case of Vector tweens
+
+
+
+ Called the first time the tween is set in a playing state, after any eventual delay
+
+
+
+ Used in place of System.Func, which is not available in mscorlib.
+
+
+
+
+ Used in place of System.Action.
+
+
+
+
+ Public so it can be used by lose scripts related to DOTween (like DOTweenAnimation)
+
+
+
+
+ Used to separate DOTween class from the MonoBehaviour instance (in order to use static constructors on DOTween).
+ Contains all instance-based methods
+
+
+
+ Used internally inside Unity Editor, as a trick to update DOTween's inspector at every frame
+
+
+
+ Directly sets the current max capacity of Tweeners and Sequences
+ (meaning how many Tweeners and Sequences can be running at the same time),
+ so that DOTween doesn't need to automatically increase them in case the max is reached
+ (which might lead to hiccups when that happens).
+ Sequences capacity must be less or equal to Tweeners capacity
+ (if you pass a low Tweener capacity it will be automatically increased to match the Sequence's).
+ Beware: use this method only when there are no tweens running.
+
+ Max Tweeners capacity.
+ Default: 200
+ Max Sequences capacity.
+ Default: 50
+
+
+
+ This class contains a C# port of the easing equations created by Robert Penner (http://robertpenner.com/easing).
+
+
+
+
+ Easing equation function for a bounce (exponentially decaying parabolic bounce) easing in: accelerating from zero velocity.
+
+
+ Current time (in frames or seconds).
+
+
+ Expected easing duration (in frames or seconds).
+
+ Unused: here to keep same delegate for all ease types.
+ Unused: here to keep same delegate for all ease types.
+
+ The eased value.
+
+
+
+
+ Easing equation function for a bounce (exponentially decaying parabolic bounce) easing out: decelerating from zero velocity.
+
+
+ Current time (in frames or seconds).
+
+
+ Expected easing duration (in frames or seconds).
+
+ Unused: here to keep same delegate for all ease types.
+ Unused: here to keep same delegate for all ease types.
+
+ The eased value.
+
+
+
+
+ Easing equation function for a bounce (exponentially decaying parabolic bounce) easing in/out: acceleration until halfway, then deceleration.
+
+
+ Current time (in frames or seconds).
+
+
+ Expected easing duration (in frames or seconds).
+
+ Unused: here to keep same delegate for all ease types.
+ Unused: here to keep same delegate for all ease types.
+
+ The eased value.
+
+
+
+
+ Returns a value between 0 and 1 (inclusive) based on the elapsed time and ease selected
+
+
+
+
+ Returns a value between 0 and 1 (inclusive) based on the elapsed time and ease selected
+
+
+
+
+ Used to interpret AnimationCurves as eases.
+ Public so it can be used by external ease factories
+
+
+
+
+ Additional notices passed to plugins when updating.
+ Public so it can be used by custom plugins. Internally, only PathPlugin uses it
+
+
+
+
+ None
+
+
+
+
+ Lets the plugin know that we restarted or rewinded
+
+
+
+
+ Public only so custom shortcuts can access some of these methods
+
+
+
+
+ Returns a Vector3 with z = 0
+
+
+
+
+ Returns the 2D angle between two vectors
+
+
+
+
+ Struct that stores two colors (used for LineRenderer tweens)
+
+
+
+
+ Used for tween callbacks
+
+
+
+
+ Used for tween callbacks
+
+
+
+
+ Used for custom and animationCurve-based ease functions. Must return a value between 0 and 1.
+
+
+
+
+ Straight Quaternion plugin. Instead of using Vector3 values accepts Quaternion values directly.
+ Beware: doesn't work with LoopType.Incremental (neither directly nor if inside a LoopType.Incremental Sequence).
+ To use it, call DOTween.To with the plugin parameter overload, passing it PureQuaternionPlugin.Plug() as first parameter
+ (do not use any of the other public PureQuaternionPlugin methods):
+ DOTween.To(PureQuaternionPlugin.Plug(), ()=> myQuaternionProperty, x=> myQuaternionProperty = x, myQuaternionEndValue, duration);
+
+
+
+
+ Plug this plugin inside a DOTween.To call.
+ Example:
+ DOTween.To(PureQuaternionPlugin.Plug(), ()=> myQuaternionProperty, x=> myQuaternionProperty = x, myQuaternionEndValue, duration);
+
+
+
+ INTERNAL: do not use
+
+
+ INTERNAL: do not use
+
+
+ INTERNAL: do not use
+
+
+ INTERNAL: do not use
+
+
+ INTERNAL: do not use
+
+
+ INTERNAL: do not use
+
+
+ INTERNAL: do not use
+
+
+
+ Main DOTween class. Contains static methods to create and control tweens in a generic way
+
+
+
+ DOTween's version
+
+
+ If TRUE (default) makes tweens slightly slower but safer, automatically taking care of a series of things
+ (like targets becoming null while a tween is playing).
+ Default: TRUE
+
+
+ If TRUE you will get a DOTween report when exiting play mode (only in the Editor).
+ Useful to know how many max Tweeners and Sequences you reached and optimize your final project accordingly.
+ Beware, this will slightly slow down your tweens while inside Unity Editor.
+ Default: FALSE
+
+
+ Global DOTween timeScale.
+ Default: 1
+
+
+ If TRUE, DOTween will use Time.smoothDeltaTime instead of Time.deltaTime for UpdateType.Normal and UpdateType.Late tweens
+ (unless they're set as timeScaleIndependent, in which case this setting will be ignored).
+ Setting this to TRUE will lead to smoother animations.
+ Default: FALSE
+
+
+ DOTween's log behaviour.
+ Default: LogBehaviour.ErrorsOnly
+
+
+ If TRUE draws path gizmos in Unity Editor (if the gizmos button is active).
+ Deactivate this if you want to avoid gizmos overhead while in Unity Editor
+
+
+ Default updateType for new tweens.
+ Default: UpdateType.Normal
+
+
+ Sets whether Unity's timeScale should be taken into account by default or not.
+ Default: false
+
+
+ Default autoPlay behaviour for new tweens.
+ Default: AutoPlay.All
+
+
+ Default autoKillOnComplete behaviour for new tweens.
+ Default: TRUE
+
+
+ Default loopType applied to all new tweens.
+ Default: LoopType.Restart
+
+
+ If TRUE all newly created tweens are set as recyclable, otherwise not.
+ Default: FALSE
+
+
+ Default ease applied to all new Tweeners (not to Sequences which always have Ease.Linear as default).
+ Default: Ease.InOutQuad
+
+
+ Default overshoot/amplitude used for eases
+ Default: 1.70158f
+
+
+ Default period used for eases
+ Default: 0
+
+
+
+ Must be called once, before the first ever DOTween call/reference,
+ otherwise it will be called automatically and will use default options.
+ Calling it a second time won't have any effect.
+ You can chain SetCapacity
to this method, to directly set the max starting size of Tweeners and Sequences:
+ DOTween.Init(false, false, LogBehaviour.Default).SetCapacity(100, 20);
+
+ If TRUE all new tweens will be set for recycling, meaning that when killed,
+ instead of being destroyed, they will be put in a pool and reused instead of creating new tweens. This option allows you to avoid
+ GC allocations by reusing tweens, but you will have to take care of tween references, since they might result active
+ even if they were killed (since they might have been respawned and are now being used for other tweens).
+ If you want to automatically set your tween references to NULL when a tween is killed
+ you can use the OnKill callback like this:
+ .OnKill(()=> myTweenReference = null)
+ You can change this setting at any time by changing the static property,
+ or you can set the recycling behaviour for each tween separately, using:
+ SetRecyclable(bool recyclable)
+ Default: FALSE
+ If TRUE makes tweens slightly slower but safer, automatically taking care of a series of things
+ (like targets becoming null while a tween is playing).
+ You can change this setting at any time by changing the static property.
+ Default: FALSE
+ Type of logging to use.
+ You can change this setting at any time by changing the static property.
+ Default: ErrorsOnly
+
+
+
+ Directly sets the current max capacity of Tweeners and Sequences
+ (meaning how many Tweeners and Sequences can be running at the same time),
+ so that DOTween doesn't need to automatically increase them in case the max is reached
+ (which might lead to hiccups when that happens).
+ Sequences capacity must be less or equal to Tweeners capacity
+ (if you pass a low Tweener capacity it will be automatically increased to match the Sequence's).
+ Beware: use this method only when there are no tweens running.
+
+ Max Tweeners capacity.
+ Default: 200
+ Max Sequences capacity.
+ Default: 50
+
+
+
+ Kills all tweens, clears all cached tween pools and plugins and resets the max Tweeners/Sequences capacities to the default values.
+
+ If TRUE also destroys DOTween's gameObject and resets its initializiation, default settings and everything else
+ (so that next time you use it it will need to be re-initialized)
+
+
+
+ Clears all cached tween pools.
+
+
+
+
+ Checks all active tweens to find and remove eventually invalid ones (usually because their targets became NULL)
+ and returns the total number of invalid tweens found and removed.
+ Automatically called when loading a new scene if is TRUE.
+ BEWARE: this is a slightly expensive operation so use it with care
+
+
+
+ Tweens a property or field to the given value using default plugins
+ A getter for the field or property to tween.
+ Example usage with lambda:()=> myProperty
+ A setter for the field or property to tween
+ Example usage with lambda:x=> myProperty = x
+ The end value to reachThe tween's duration
+
+
+ Tweens a property or field to the given value using default plugins
+ A getter for the field or property to tween.
+ Example usage with lambda:()=> myProperty
+ A setter for the field or property to tween
+ Example usage with lambda:x=> myProperty = x
+ The end value to reachThe tween's duration
+
+
+ Tweens a property or field to the given value using default plugins
+ A getter for the field or property to tween.
+ Example usage with lambda:()=> myProperty
+ A setter for the field or property to tween
+ Example usage with lambda:x=> myProperty = x
+ The end value to reachThe tween's duration
+
+
+ Tweens a property or field to the given value using default plugins
+ A getter for the field or property to tween.
+ Example usage with lambda:()=> myProperty
+ A setter for the field or property to tween
+ Example usage with lambda:x=> myProperty = x
+ The end value to reachThe tween's duration
+
+
+ Tweens a property or field to the given value using default plugins
+ A getter for the field or property to tween.
+ Example usage with lambda:()=> myProperty
+ A setter for the field or property to tween
+ Example usage with lambda:x=> myProperty = x
+ The end value to reachThe tween's duration
+
+
+ Tweens a property or field to the given value using default plugins
+ A getter for the field or property to tween.
+ Example usage with lambda:()=> myProperty
+ A setter for the field or property to tween
+ Example usage with lambda:x=> myProperty = x
+ The end value to reachThe tween's duration
+
+
+ Tweens a property or field to the given value using default plugins
+ A getter for the field or property to tween.
+ Example usage with lambda:()=> myProperty
+ A setter for the field or property to tween
+ Example usage with lambda:x=> myProperty = x
+ The end value to reachThe tween's duration
+
+
+ Tweens a property or field to the given value using default plugins
+ A getter for the field or property to tween.
+ Example usage with lambda:()=> myProperty
+ A setter for the field or property to tween
+ Example usage with lambda:x=> myProperty = x
+ The end value to reachThe tween's duration
+
+
+ Tweens a property or field to the given value using default plugins
+ A getter for the field or property to tween.
+ Example usage with lambda:()=> myProperty
+ A setter for the field or property to tween
+ Example usage with lambda:x=> myProperty = x
+ The end value to reachThe tween's duration
+
+
+ Tweens a property or field to the given value using default plugins
+ A getter for the field or property to tween.
+ Example usage with lambda:()=> myProperty
+ A setter for the field or property to tween
+ Example usage with lambda:x=> myProperty = x
+ The end value to reachThe tween's duration
+
+
+ Tweens a property or field to the given value using default plugins
+ A getter for the field or property to tween.
+ Example usage with lambda:()=> myProperty
+ A setter for the field or property to tween
+ Example usage with lambda:x=> myProperty = x
+ The end value to reachThe tween's duration
+
+
+ Tweens a property or field to the given value using default plugins
+ A getter for the field or property to tween.
+ Example usage with lambda:()=> myProperty
+ A setter for the field or property to tween
+ Example usage with lambda:x=> myProperty = x
+ The end value to reachThe tween's duration
+
+
+ Tweens a property or field to the given value using default plugins
+ A getter for the field or property to tween.
+ Example usage with lambda:()=> myProperty
+ A setter for the field or property to tween
+ Example usage with lambda:x=> myProperty = x
+ The end value to reachThe tween's duration
+
+
+ Tweens a property or field to the given value using default plugins
+ A getter for the field or property to tween.
+ Example usage with lambda:()=> myProperty
+ A setter for the field or property to tween
+ Example usage with lambda:x=> myProperty = x
+ The end value to reachThe tween's duration
+
+
+ Tweens a property or field to the given value using a custom plugin
+ The plugin to use. Each custom plugin implements a static Get()
method
+ you'll need to call to assign the correct plugin in the correct way, like this:
+ CustomPlugin.Get()
+ A getter for the field or property to tween.
+ Example usage with lambda:()=> myProperty
+ A setter for the field or property to tween
+ Example usage with lambda:x=> myProperty = x
+ The end value to reachThe tween's duration
+
+
+ Tweens only one axis of a Vector3 to the given value using default plugins.
+ A getter for the field or property to tween.
+ Example usage with lambda:()=> myProperty
+ A setter for the field or property to tween
+ Example usage with lambda:x=> myProperty = x
+ The end value to reachThe tween's duration
+ The axis to tween
+
+
+ Tweens only the alpha of a Color to the given value using default plugins
+ A getter for the field or property to tween.
+ Example usage with lambda:()=> myProperty
+ A setter for the field or property to tween
+ Example usage with lambda:x=> myProperty = x
+ The end value to reachThe tween's duration
+
+
+ Tweens a virtual property from the given start to the given end value
+ and implements a setter that allows to use that value with an external method or a lambda
+ Example:
+ To(MyMethod, 0, 12, 0.5f);
+ Where MyMethod is a function that accepts a float parameter (which will be the result of the virtual tween)
+ The action to perform with the tweened value
+ The value to start from
+ The end value to reach
+ The duration of the virtual tween
+
+
+
+ Punches a Vector3 towards the given direction and then back to the starting one
+ as if it was connected to the starting position via an elastic.
+ This tween type generates some GC allocations at startup
+ A getter for the field or property to tween.
+ Example usage with lambda:()=> myProperty
+ A setter for the field or property to tween
+ Example usage with lambda:x=> myProperty = x
+ The direction and strength of the punch
+ The duration of the tween
+ Indicates how much will the punch vibrate
+ Represents how much (0 to 1) the vector will go beyond the starting position when bouncing backwards.
+ 1 creates a full oscillation between the direction and the opposite decaying direction,
+ while 0 oscillates only between the starting position and the decaying direction
+
+
+ Shakes a Vector3 with the given values.
+ A getter for the field or property to tween.
+ Example usage with lambda:()=> myProperty
+ A setter for the field or property to tween
+ Example usage with lambda:x=> myProperty = x
+ The duration of the tween
+ The shake strength
+ Indicates how much will the shake vibrate
+ Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware).
+ Setting it to 0 will shake along a single direction and behave like a random punch.
+ If TRUE only shakes on the X Y axis (looks better with things like cameras).
+
+
+ Shakes a Vector3 with the given values.
+ A getter for the field or property to tween.
+ Example usage with lambda:()=> myProperty
+ A setter for the field or property to tween
+ Example usage with lambda:x=> myProperty = x
+ The duration of the tween
+ The shake strength on each axis
+ Indicates how much will the shake vibrate
+ Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware).
+ Setting it to 0 will shake along a single direction and behave like a random punch.
+
+
+ Tweens a property or field to the given values using default plugins.
+ Ease is applied between each segment and not as a whole.
+ This tween type generates some GC allocations at startup
+ A getter for the field or property to tween.
+ Example usage with lambda:()=> myProperty
+ A setter for the field or property to tween
+ Example usage with lambda:x=> myProperty = x
+ The end values to reach for each segment. This array must have the same length as durations
+ The duration of each segment. This array must have the same length as endValues
+
+
+
+ Returns a new to be used for tween groups
+
+
+
+ Completes all tweens and returns the number of actual tweens completed
+ (meaning tweens that don't have infinite loops and were not already complete)
+ For Sequences only: if TRUE also internal Sequence callbacks will be fired,
+ otherwise they will be ignored
+
+
+ Completes all tweens with the given ID or target and returns the number of actual tweens completed
+ (meaning the tweens that don't have infinite loops and were not already complete)
+ For Sequences only: if TRUE internal Sequence callbacks will be fired,
+ otherwise they will be ignored
+
+
+ Flips all tweens (changing their direction to forward if it was backwards and viceversa),
+ then returns the number of actual tweens flipped
+
+
+ Flips the tweens with the given ID or target (changing their direction to forward if it was backwards and viceversa),
+ then returns the number of actual tweens flipped
+
+
+ Sends all tweens to the given position (calculating also eventual loop cycles) and returns the actual tweens involved
+
+
+ Sends all tweens with the given ID or target to the given position (calculating also eventual loop cycles)
+ and returns the actual tweens involved
+
+
+ Kills all tweens and returns the number of actual tweens killed
+ If TRUE completes the tweens before killing them
+
+
+ Kills all tweens and returns the number of actual tweens killed
+ If TRUE completes the tweens before killing them
+ Eventual IDs or targets to exclude from the killing
+
+
+ Kills all tweens with the given ID or target and returns the number of actual tweens killed
+ If TRUE completes the tweens before killing them
+
+
+ Pauses all tweens and returns the number of actual tweens paused
+
+
+ Pauses all tweens with the given ID or target and returns the number of actual tweens paused
+ (meaning the tweens that were actually playing and have been paused)
+
+
+ Plays all tweens and returns the number of actual tweens played
+ (meaning tweens that were not already playing or complete)
+
+
+ Plays all tweens with the given ID or target and returns the number of actual tweens played
+ (meaning the tweens that were not already playing or complete)
+
+
+ Plays all tweens with the given target and the given ID, and returns the number of actual tweens played
+ (meaning the tweens that were not already playing or complete)
+
+
+ Plays backwards all tweens and returns the number of actual tweens played
+ (meaning tweens that were not already started, playing backwards or rewinded)
+
+
+ Plays backwards all tweens with the given ID or target and returns the number of actual tweens played
+ (meaning the tweens that were not already started, playing backwards or rewinded)
+
+
+ Plays forward all tweens and returns the number of actual tweens played
+ (meaning tweens that were not already playing forward or complete)
+
+
+ Plays forward all tweens with the given ID or target and returns the number of actual tweens played
+ (meaning the tweens that were not already playing forward or complete)
+
+
+ Restarts all tweens, then returns the number of actual tweens restarted
+
+
+ Restarts all tweens with the given ID or target, then returns the number of actual tweens restarted
+
+
+ Restarts all tweens with the given target and the given ID, and returns the number of actual tweens played
+ (meaning the tweens that were not already playing or complete)
+
+
+ Rewinds and pauses all tweens, then returns the number of actual tweens rewinded
+ (meaning tweens that were not already rewinded)
+
+
+ Rewinds and pauses all tweens with the given ID or target, then returns the number of actual tweens rewinded
+ (meaning the tweens that were not already rewinded)
+
+
+ Smoothly rewinds all tweens (delays excluded), then returns the number of actual tweens rewinding/rewinded
+ (meaning tweens that were not already rewinded).
+ A "smooth rewind" animates the tween to its start position,
+ skipping all elapsed loops (except in case of LoopType.Incremental) while keeping the animation fluent.
+ Note that a tween that was smoothly rewinded will have its play direction flipped
+
+
+ Smoothly rewinds all tweens (delays excluded) with the given ID or target, then returns the number of actual tweens rewinding/rewinded
+ (meaning the tweens that were not already rewinded).
+ A "smooth rewind" animates the tween to its start position,
+ skipping all elapsed loops (except in case of LoopType.Incremental) while keeping the animation fluent.
+ Note that a tween that was smoothly rewinded will have its play direction flipped
+
+
+ Toggles the play state of all tweens and returns the number of actual tweens toggled
+ (meaning tweens that could be played or paused, depending on the toggle state)
+
+
+ Toggles the play state of all tweens with the given ID or target and returns the number of actual tweens toggled
+ (meaning the tweens that could be played or paused, depending on the toggle state)
+
+
+
+ Returns TRUE if a tween with the given ID or target is active (regardless if it's playing or not).
+ You can also use this to know if a shortcut tween is active for a given target.
+ Example:
+ transform.DOMoveX(45, 1); // transform is automatically added as the tween target
+ DOTween.IsTweening(transform); // Returns true
+
+
+
+
+ Returns the total number of active and playing tweens.
+ A tween is considered as playing even if its delay is actually playing
+
+
+
+
+ Returns a list of all active tweens in a playing state.
+ Returns NULL if there are no active playing tweens.
+ Beware: each time you call this method a new list is generated, so use it for debug only
+
+
+
+
+ Returns a list of all active tweens in a paused state.
+ Returns NULL if there are no active paused tweens.
+ Beware: each time you call this method a new list is generated, so use it for debug only
+
+
+
+
+ Returns a list of all active tweens with the given id.
+ Returns NULL if there are no active tweens with the given id.
+ Beware: each time you call this method a new list is generated
+ If TRUE returns only the tweens with the given ID that are currently playing
+
+
+
+
+ Returns a list of all active tweens with the given target.
+ Returns NULL if there are no active tweens with the given target.
+ Beware: each time you call this method a new list is generated
+ If TRUE returns only the tweens with the given target that are currently playing
+
+
+
+
+ Creates virtual tweens that can be used to change other elements via their OnUpdate calls
+
+
+
+
+ Tweens a virtual float.
+ You can add regular settings to the generated tween,
+ but do not use SetUpdate
or you will overwrite the onVirtualUpdate parameter
+
+ The value to start from
+ The value to tween to
+ The duration of the tween
+ A callback which must accept a parameter of type float, called at each update
+
+
+
+ Returns a value based on the given ease and lifetime percentage (0 to 1)
+ The value to start from when lifetimePercentage is 0
+ The value to reach when lifetimePercentage is 1
+ The time percentage (0 to 1) at which the value should be taken
+ The type of ease
+
+
+ Returns a value based on the given ease and lifetime percentage (0 to 1)
+ The value to start from when lifetimePercentage is 0
+ The value to reach when lifetimePercentage is 1
+ The time percentage (0 to 1) at which the value should be taken
+ The type of ease
+ Eventual overshoot to use with Back ease
+
+
+ Returns a value based on the given ease and lifetime percentage (0 to 1)
+ The value to start from when lifetimePercentage is 0
+ The value to reach when lifetimePercentage is 1
+ The time percentage (0 to 1) at which the value should be taken
+ The type of ease
+ Eventual amplitude to use with Elastic easeType
+ Eventual period to use with Elastic easeType
+
+
+ Returns a value based on the given ease and lifetime percentage (0 to 1)
+ The value to start from when lifetimePercentage is 0
+ The value to reach when lifetimePercentage is 1
+ The time percentage (0 to 1) at which the value should be taken
+ The AnimationCurve to use for ease
+
+
+ Fires the given callback after the given time.
+ Callback delay
+ Callback to fire when the delay has expired
+ If TRUE (default) ignores Unity's timeScale
+
+
+
+ Don't assign this! It's assigned automatically when creating 0 duration tweens
+
+
+
+
+ Don't assign this! It's assigned automatically when setting the ease to an AnimationCurve or to a custom ease function
+
+
+
+
+ Allows to wrap ease method in special ways, adding extra features
+
+
+
+
+ Converts the given ease so that it also creates a stop-motion effect, by playing the tween at the given FPS
+
+ FPS at which the tween should be played
+ Ease type
+
+
+
+ Converts the given ease so that it also creates a stop-motion effect, by playing the tween at the given FPS
+
+ FPS at which the tween should be played
+ AnimationCurve to use for the ease
+
+
+
+ Converts the given ease so that it also creates a stop-motion effect, by playing the tween at the given FPS
+
+ FPS at which the tween should be played
+ Custom ease function to use
+
+
+
+ Used to allow method chaining with DOTween.Init
+
+
+
+
+ Directly sets the current max capacity of Tweeners and Sequences
+ (meaning how many Tweeners and Sequences can be running at the same time),
+ so that DOTween doesn't need to automatically increase them in case the max is reached
+ (which might lead to hiccups when that happens).
+ Sequences capacity must be less or equal to Tweeners capacity
+ (if you pass a low Tweener capacity it will be automatically increased to match the Sequence's).
+ Beware: use this method only when there are no tweens running.
+
+ Max Tweeners capacity.
+ Default: 200
+ Max Sequences capacity.
+ Default: 50
+
+
+
+ Path mode (used to determine correct LookAt orientation)
+
+
+
+ Ignores the path mode (and thus LookAt behaviour)
+
+
+ Regular 3D path
+
+
+ 2D top-down path
+
+
+ 2D side-scroller path
+
+
+
+ Type of path to use with DOPath tweens
+
+
+
+ Linear, composed of straight segments between each waypoint
+
+
+ Curved path (which uses Catmull-Rom curves)
+
+
+
+ Path control point
+
+
+
+
+ Gets the point on the path at the given percentage (0 to 1)
+
+ The percentage (0 to 1) at which to get the point
+ If TRUE constant speed is taken into account, otherwise not
+
+
+
+ This plugin generates some GC allocations at startup
+
+
+
+
+ Path plugin works exclusively with Transforms
+
+
+
+
+ Rotation mode used with DORotate methods
+
+
+
+
+ Fastest way that never rotates beyond 360°
+
+
+
+
+ Fastest way that rotates beyond 360°
+
+
+
+
+ Adds the given rotation to the transform using world axis and an advanced precision mode
+ (like when using transform.Rotate(Space.World)).
+ In this mode the end value is is always considered relative
+
+
+
+
+ Adds the given rotation to the transform's local axis
+ (like when rotating an object with the "local" switch enabled in Unity's editor or using transform.Rotate(Space.Self)).
+ In this mode the end value is is always considered relative
+
+
+
+
+ Type of scramble to apply to string tweens
+
+
+
+
+ No scrambling of characters
+
+
+
+
+ A-Z + a-z + 0-9 characters
+
+
+
+
+ A-Z characters
+
+
+
+
+ a-z characters
+
+
+
+
+ 0-9 characters
+
+
+
+
+ Custom characters
+
+
+
+
+ Methods that extend Tween objects and allow to control or get data from them
+
+
+
+ Completes the tween
+
+
+ Completes the tween
+ For Sequences only: if TRUE also internal Sequence callbacks will be fired,
+ otherwise they will be ignored
+
+
+ Flips the direction of this tween (backwards if it was going forward or viceversa)
+
+
+ Forces the tween to initialize its settings immediately
+
+
+ Send the tween to the given position in time
+ Time position to reach
+ (if higher than the whole tween duration the tween will simply reach its end)
+ If TRUE will play the tween after reaching the given position, otherwise it will pause it
+
+
+ Kills the tween
+ If TRUE completes the tween before killing it
+
+
+ Pauses the tween
+
+
+ Plays the tween
+
+
+ Sets the tween in a backwards direction and plays it
+
+
+ Sets the tween in a forward direction and plays it
+
+
+ Restarts the tween from the beginning
+ If TRUE includes the eventual tween delay, otherwise skips it
+
+
+ Rewinds and pauses the tween
+ If TRUE includes the eventual tween delay, otherwise skips it
+
+
+ Smoothly rewinds the tween (delays excluded).
+ A "smooth rewind" animates the tween to its start position,
+ skipping all elapsed loops (except in case of LoopType.Incremental) while keeping the animation fluent.
+ If called on a tween who is still waiting for its delay to happen, it will simply set the delay to 0 and pause the tween.
+ Note that a tween that was smoothly rewinded will have its play direction flipped
+
+
+ Plays the tween if it was paused, pauses it if it was playing
+
+
+ Send a path tween to the given waypoint.
+ Has no effect if this is not a path tween.
+ BEWARE, this is a special utility method:
+ it works only with Linear eases. Also, the lookAt direction might be wrong after calling this and might need to be set manually
+ (because it relies on a smooth path movement and doesn't work well with jumps that encompass dramatic direction changes)
+ Waypoint index to reach
+ (if higher than the max waypoint index the tween will simply go to the last one)
+ If TRUE will play the tween after reaching the given waypoint, otherwise it will pause it
+
+
+
+ Creates a yield instruction that waits until the tween is killed or complete.
+ It can be used inside a coroutine as a yield.
+ Example usage:yield return myTween.WaitForCompletion();
+
+
+
+
+ Creates a yield instruction that waits until the tween is killed or rewinded.
+ It can be used inside a coroutine as a yield.
+ Example usage:yield return myTween.WaitForRewind();
+
+
+
+
+ Creates a yield instruction that waits until the tween is killed.
+ It can be used inside a coroutine as a yield.
+ Example usage:yield return myTween.WaitForKill();
+
+
+
+
+ Creates a yield instruction that waits until the tween is killed or has gone through the given amount of loops.
+ It can be used inside a coroutine as a yield.
+ Example usage:yield return myTween.WaitForElapsedLoops(2);
+
+ Elapsed loops to wait for
+
+
+
+ Creates a yield instruction that waits until the tween is killed or has reached the given position (loops included, delays excluded).
+ It can be used inside a coroutine as a yield.
+ Example usage:yield return myTween.WaitForPosition(2.5f);
+
+ Position (loops included, delays excluded) to wait for
+
+
+
+ Creates a yield instruction that waits until the tween is killed or started
+ (meaning when the tween is set in a playing state the first time, after any eventual delay).
+ It can be used inside a coroutine as a yield.
+ Example usage:yield return myTween.WaitForStart();
+
+
+
+ Returns the total number of loops completed by this tween
+
+
+ Returns the eventual delay set for this tween
+
+
+ Returns the duration of this tween (delays excluded).
+ NOTE: when using settings like SpeedBased, the duration will be recalculated when the tween starts
+ If TRUE returns the full duration loops included,
+ otherwise the duration of a single loop cycle
+
+
+ Returns the elapsed time for this tween (delays exluded)
+ If TRUE returns the elapsed time since startup loops included,
+ otherwise the elapsed time within the current loop cycle
+
+
+ Returns the elapsed percentage (0 to 1) of this tween (delays exluded)
+ If TRUE returns the elapsed percentage since startup loops included,
+ otherwise the elapsed percentage within the current loop cycle
+
+
+ Returns the elapsed percentage (0 to 1) of this tween (delays exluded),
+ based on a single loop, and calculating eventual backwards Yoyo loops as 1 to 0 instead of 0 to 1
+
+
+ Returns FALSE if this tween has been killed.
+ BEWARE: if this tween is recyclable it might have been spawned again for another use and thus return TRUE anyway.
+ When working with recyclable tweens you should take care to know when a tween has been killed and manually set your references to NULL.
+ If you want to be sure your references are set to NULL when a tween is killed you can use the OnKill
callback like this:
+ .OnKill(()=> myTweenReference = null)
+
+
+ Returns TRUE if this tween was reversed and is set to go backwards
+
+
+ Returns TRUE if the tween is complete
+ (silently fails and returns FALSE if the tween has been killed)
+
+
+ Returns TRUE if this tween has been initialized
+
+
+ Returns TRUE if this tween is playing
+
+
+ Returns the total number of loops set for this tween
+ (returns -1 if the loops are infinite)
+
+
+
+ Returns a point on a path based on the given path percentage.
+ Returns Vector3.zero
if this is not a path tween, if the tween is invalid, or if the path is not yet initialized.
+ A path is initialized after its tween starts, or immediately if the tween was created with the Path Editor (DOTween Pro feature).
+ You can force a path to be initialized by calling myTween.ForceInit()
.
+
+ Percentage of the path (0 to 1) on which to get the point
+
+
+
+ Returns an array of points that can be used to draw the path.
+ Note that this method generates allocations, because it creates a new array.
+ Returns NULL
if this is not a path tween, if the tween is invalid, or if the path is not yet initialized.
+ A path is initialized after its tween starts, or immediately if the tween was created with the Path Editor (DOTween Pro feature).
+ You can force a path to be initialized by calling myTween.ForceInit()
.
+
+ How many points to create for each path segment (waypoint to waypoint).
+ Only used in case of non-Linear paths
+
+
+
+ Returns the length of a path.
+ Returns -1 if this is not a path tween, if the tween is invalid, or if the path is not yet initialized.
+ A path is initialized after its tween starts, or immediately if the tween was created with the Path Editor (DOTween Pro feature).
+ You can force a path to be initialized by calling myTween.ForceInit()
.
+
+
+
+
+ Types of loop
+
+
+
+ Each loop cycle restarts from the beginning
+
+
+ The tween moves forward and backwards at alternate cycles
+
+
+ Continuously increments the tween at the end of each loop cycle (A to B, B to B+(A-B), and so on), thus always moving "onward".
+ In case of String tweens works only if the tween is set as relative
+
+
+
+ Controls other tweens as a group
+
+
+
+
+ Methods that extend known Unity objects and allow to directly create and control tweens from their instances
+
+
+
+ Tweens an AudioSource's volume to the given value.
+ Also stores the AudioSource as the tween's target so it can be used for filtered operations
+ The end value to reach (0 to 1)The duration of the tween
+
+
+ Tweens an AudioSource's pitch to the given value.
+ Also stores the AudioSource as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+
+
+ Tweens a Camera's aspect
to the given value.
+ Also stores the camera as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+
+
+ Tweens a Camera's backgroundColor to the given value.
+ Also stores the camera as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+
+
+ Tweens a Camera's farClipPlane
to the given value.
+ Also stores the camera as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+
+
+ Tweens a Camera's fieldOfView
to the given value.
+ Also stores the camera as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+
+
+ Tweens a Camera's nearClipPlane
to the given value.
+ Also stores the camera as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+
+
+ Tweens a Camera's orthographicSize
to the given value.
+ Also stores the camera as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+
+
+ Tweens a Camera's pixelRect
to the given value.
+ Also stores the camera as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+
+
+ Tweens a Camera's rect
to the given value.
+ Also stores the camera as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+
+
+ Shakes a Camera's localPosition along its relative X Y axes with the given values.
+ Also stores the camera as the tween's target so it can be used for filtered operations
+ The duration of the tween
+ The shake strength
+ Indicates how much will the shake vibrate
+ Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware).
+ Setting it to 0 will shake along a single direction.
+
+
+ Shakes a Camera's localPosition along its relative X Y axes with the given values.
+ Also stores the camera as the tween's target so it can be used for filtered operations
+ The duration of the tween
+ The shake strength on each axis
+ Indicates how much will the shake vibrate
+ Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware).
+ Setting it to 0 will shake along a single direction.
+
+
+ Shakes a Camera's localRotation.
+ Also stores the camera as the tween's target so it can be used for filtered operations
+ The duration of the tween
+ The shake strength
+ Indicates how much will the shake vibrate
+ Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware).
+ Setting it to 0 will shake along a single direction.
+
+
+ Shakes a Camera's localRotation.
+ Also stores the camera as the tween's target so it can be used for filtered operations
+ The duration of the tween
+ The shake strength on each axis
+ Indicates how much will the shake vibrate
+ Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware).
+ Setting it to 0 will shake along a single direction.
+
+
+ Tweens a Light's color to the given value.
+ Also stores the light as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+
+
+ Tweens a Light's intensity to the given value.
+ Also stores the light as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+
+
+ Tweens a Light's shadowStrength to the given value.
+ Also stores the light as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+
+
+ Tweens a LineRenderer's color to the given value.
+ Also stores the LineRenderer as the tween's target so it can be used for filtered operations.
+ Note that this method requires to also insert the start colors for the tween,
+ since LineRenderers have no way to get them.
+ The start value to tween from
+ The end value to reachThe duration of the tween
+
+
+ Tweens a Material's color to the given value.
+ Also stores the material as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+
+
+ Tweens a Material's named color property to the given value.
+ Also stores the material as the tween's target so it can be used for filtered operations
+ The end value to reach
+ The name of the material property to tween (like _Tint or _SpecColor)
+ The duration of the tween
+
+
+ Tweens a Material's alpha color to the given value
+ (will have no effect unless your material supports transparency).
+ Also stores the material as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+
+
+ Tweens a Material's alpha color to the given value
+ (will have no effect unless your material supports transparency).
+ Also stores the material as the tween's target so it can be used for filtered operations
+ The end value to reach
+ The name of the material property to tween (like _Tint or _SpecColor)
+ The duration of the tween
+
+
+ Tweens a Material's named float property to the given value.
+ Also stores the material as the tween's target so it can be used for filtered operations
+ The end value to reach
+ The name of the material property to tween
+ The duration of the tween
+
+
+ Tweens a Material's texture offset to the given value.
+ Also stores the material as the tween's target so it can be used for filtered operations
+ The end value to reach
+ The duration of the tween
+
+
+ Tweens a Material's named texture offset property to the given value.
+ Also stores the material as the tween's target so it can be used for filtered operations
+ The end value to reach
+ The name of the material property to tween
+ The duration of the tween
+
+
+ Tweens a Material's texture scale to the given value.
+ Also stores the material as the tween's target so it can be used for filtered operations
+ The end value to reach
+ The duration of the tween
+
+
+ Tweens a Material's named texture scale property to the given value.
+ Also stores the material as the tween's target so it can be used for filtered operations
+ The end value to reach
+ The name of the material property to tween
+ The duration of the tween
+
+
+ Tweens a Material's named Vector property to the given value.
+ Also stores the material as the tween's target so it can be used for filtered operations
+ The end value to reach
+ The name of the material property to tween
+ The duration of the tween
+
+
+ Tweens a Rigidbody's position to the given value.
+ Also stores the rigidbody as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Tweens a Rigidbody's X position to the given value.
+ Also stores the rigidbody as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Tweens a Rigidbody's Y position to the given value.
+ Also stores the rigidbody as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Tweens a Rigidbody's Z position to the given value.
+ Also stores the rigidbody as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Tweens a Rigidbody's rotation to the given value.
+ Also stores the rigidbody as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+ Rotation mode
+
+
+ Tweens a Rigidbody's rotation so that it will look towards the given position.
+ Also stores the rigidbody as the tween's target so it can be used for filtered operations
+ The position to look atThe duration of the tween
+ Eventual axis constraint for the rotation
+ The vector that defines in which direction up is (default: Vector3.up)
+
+
+ Tweens a Rigidbody's position to the given value, while also applying a jump effect along the Y axis.
+ Returns a Sequence instead of a Tweener.
+ Also stores the Rigidbody as the tween's target so it can be used for filtered operations
+ The end value to reach
+ Power of the jump (the max height of the jump is represented by this plus the final Y offset)
+ Total number of jumps
+ The duration of the tween
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Tweens a TrailRenderer's startWidth/endWidth to the given value.
+ Also stores the TrailRenderer as the tween's target so it can be used for filtered operations
+ The end startWidth to reachThe end endWidth to reach
+ The duration of the tween
+
+
+ Tweens a TrailRenderer's time to the given value.
+ Also stores the TrailRenderer as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+
+
+ Tweens a Transform's position to the given value.
+ Also stores the transform as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Tweens a Transform's X position to the given value.
+ Also stores the transform as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Tweens a Transform's Y position to the given value.
+ Also stores the transform as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Tweens a Transform's Z position to the given value.
+ Also stores the transform as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Tweens a Transform's localPosition to the given value.
+ Also stores the transform as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Tweens a Transform's X localPosition to the given value.
+ Also stores the transform as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Tweens a Transform's Y localPosition to the given value.
+ Also stores the transform as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Tweens a Transform's Z localPosition to the given value.
+ Also stores the transform as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Tweens a Transform's rotation to the given value.
+ Also stores the transform as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+ Rotation mode
+
+
+ Tweens a Transform's rotation to the given value using pure quaternion values.
+ Also stores the transform as the tween's target so it can be used for filtered operations.
+ PLEASE NOTE: DORotate, which takes Vector3 values, is the preferred rotation method.
+ This method was implemented for very special cases, and doesn't support LoopType.Incremental loops
+ (neither for itself nor if placed inside a LoopType.Incremental Sequence)
+
+ The end value to reachThe duration of the tween
+
+
+ Tweens a Transform's localRotation to the given value.
+ Also stores the transform as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+ Rotation mode
+
+
+ Tweens a Transform's rotation to the given value using pure quaternion values.
+ Also stores the transform as the tween's target so it can be used for filtered operations.
+ PLEASE NOTE: DOLocalRotate, which takes Vector3 values, is the preferred rotation method.
+ This method was implemented for very special cases, and doesn't support LoopType.Incremental loops
+ (neither for itself nor if placed inside a LoopType.Incremental Sequence)
+
+ The end value to reachThe duration of the tween
+
+
+ Tweens a Transform's localScale to the given value.
+ Also stores the transform as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+
+
+ Tweens a Transform's localScale uniformly to the given value.
+ Also stores the transform as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+
+
+ Tweens a Transform's X localScale to the given value.
+ Also stores the transform as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+
+
+ Tweens a Transform's Y localScale to the given value.
+ Also stores the transform as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+
+
+ Tweens a Transform's Z localScale to the given value.
+ Also stores the transform as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+
+
+ Tweens a Transform's rotation so that it will look towards the given position.
+ Also stores the transform as the tween's target so it can be used for filtered operations
+ The position to look atThe duration of the tween
+ Eventual axis constraint for the rotation
+ The vector that defines in which direction up is (default: Vector3.up)
+
+
+ Punches a Transform's localPosition towards the given direction and then back to the starting one
+ as if it was connected to the starting position via an elastic.
+ The direction and strength of the punch (added to the Transform's current position)
+ The duration of the tween
+ Indicates how much will the punch vibrate
+ Represents how much (0 to 1) the vector will go beyond the starting position when bouncing backwards.
+ 1 creates a full oscillation between the punch direction and the opposite direction,
+ while 0 oscillates only between the punch and the start position
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Punches a Transform's localScale towards the given size and then back to the starting one
+ as if it was connected to the starting scale via an elastic.
+ The punch strength (added to the Transform's current scale)
+ The duration of the tween
+ Indicates how much will the punch vibrate
+ Represents how much (0 to 1) the vector will go beyond the starting size when bouncing backwards.
+ 1 creates a full oscillation between the punch scale and the opposite scale,
+ while 0 oscillates only between the punch scale and the start scale
+
+
+ Punches a Transform's localRotation towards the given size and then back to the starting one
+ as if it was connected to the starting rotation via an elastic.
+ The punch strength (added to the Transform's current rotation)
+ The duration of the tween
+ Indicates how much will the punch vibrate
+ Represents how much (0 to 1) the vector will go beyond the starting rotation when bouncing backwards.
+ 1 creates a full oscillation between the punch rotation and the opposite rotation,
+ while 0 oscillates only between the punch and the start rotation
+
+
+ Shakes a Transform's localPosition with the given values.
+ The duration of the tween
+ The shake strength
+ Indicates how much will the shake vibrate
+ Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware).
+ Setting it to 0 will shake along a single direction.
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Shakes a Transform's localPosition with the given values.
+ The duration of the tween
+ The shake strength on each axis
+ Indicates how much will the shake vibrate
+ Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware).
+ Setting it to 0 will shake along a single direction.
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Shakes a Transform's localRotation.
+ The duration of the tween
+ The shake strength
+ Indicates how much will the shake vibrate
+ Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware).
+ Setting it to 0 will shake along a single direction.
+
+
+ Shakes a Transform's localRotation.
+ The duration of the tween
+ The shake strength on each axis
+ Indicates how much will the shake vibrate
+ Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware).
+ Setting it to 0 will shake along a single direction.
+
+
+ Shakes a Transform's localScale.
+ The duration of the tween
+ The shake strength
+ Indicates how much will the shake vibrate
+ Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware).
+ Setting it to 0 will shake along a single direction.
+
+
+ Shakes a Transform's localScale.
+ The duration of the tween
+ The shake strength on each axis
+ Indicates how much will the shake vibrate
+ Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware).
+ Setting it to 0 will shake along a single direction.
+
+
+ Tweens a Transform's position to the given value, while also applying a jump effect along the Y axis.
+ Returns a Sequence instead of a Tweener.
+ Also stores the transform as the tween's target so it can be used for filtered operations
+ The end value to reach
+ Power of the jump (the max height of the jump is represented by this plus the final Y offset)
+ Total number of jumps
+ The duration of the tween
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Tweens a Transform's localPosition to the given value, while also applying a jump effect along the Y axis.
+ Returns a Sequence instead of a Tweener.
+ Also stores the transform as the tween's target so it can be used for filtered operations
+ The end value to reach
+ Power of the jump (the max height of the jump is represented by this plus the final Y offset)
+ Total number of jumps
+ The duration of the tween
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Tweens a Transform's position through the given path waypoints, using the chosen path algorithm.
+ Also stores the transform as the tween's target so it can be used for filtered operations
+ The waypoints to go through
+ The duration of the tween
+ The type of path: Linear (straight path) or CatmullRom (curved CatmullRom path)
+ The path mode: 3D, side-scroller 2D, top-down 2D
+ The resolution of the path (useless in case of Linear paths): higher resolutions make for more detailed curved paths but are more expensive.
+ Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints
+ The color of the path (shown when gizmos are active in the Play panel and the tween is running)
+
+
+ Tweens a Transform's localPosition through the given path waypoints, using the chosen path algorithm.
+ Also stores the transform as the tween's target so it can be used for filtered operations
+ The waypoint to go through
+ The duration of the tween
+ The type of path: Linear (straight path) or CatmullRom (curved CatmullRom path)
+ The path mode: 3D, side-scroller 2D, top-down 2D
+ The resolution of the path: higher resolutions make for more detailed curved paths but are more expensive.
+ Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints
+ The color of the path (shown when gizmos are active in the Play panel and the tween is running)
+
+
+ Tweens a Light's color to the given value,
+ in a way that allows other DOBlendableColor tweens to work together on the same target,
+ instead than fight each other as multiple DOColor would do.
+ Also stores the Light as the tween's target so it can be used for filtered operations
+ The value to tween toThe duration of the tween
+
+
+ Tweens a Material's color to the given value,
+ in a way that allows other DOBlendableColor tweens to work together on the same target,
+ instead than fight each other as multiple DOColor would do.
+ Also stores the Material as the tween's target so it can be used for filtered operations
+ The value to tween toThe duration of the tween
+
+
+ Tweens a Material's named color property to the given value,
+ in a way that allows other DOBlendableColor tweens to work together on the same target,
+ instead than fight each other as multiple DOColor would do.
+ Also stores the Material as the tween's target so it can be used for filtered operations
+ The value to tween to
+ The name of the material property to tween (like _Tint or _SpecColor)
+ The duration of the tween
+
+
+ Tweens a Transform's position BY the given value (as if you chained a SetRelative
),
+ in a way that allows other DOBlendableMove tweens to work together on the same target,
+ instead than fight each other as multiple DOMove would do.
+ Also stores the transform as the tween's target so it can be used for filtered operations
+ The value to tween byThe duration of the tween
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Tweens a Transform's localPosition BY the given value (as if you chained a SetRelative
),
+ in a way that allows other DOBlendableMove tweens to work together on the same target,
+ instead than fight each other as multiple DOMove would do.
+ Also stores the transform as the tween's target so it can be used for filtered operations
+ The value to tween byThe duration of the tween
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ EXPERIMENTAL METHOD - Tweens a Transform's rotation BY the given value (as if you chained a SetRelative
),
+ in a way that allows other DOBlendableRotate tweens to work together on the same target,
+ instead than fight each other as multiple DORotate would do.
+ Also stores the transform as the tween's target so it can be used for filtered operations
+ The value to tween byThe duration of the tween
+ Rotation mode
+
+
+ EXPERIMENTAL METHOD - Tweens a Transform's lcoalRotation BY the given value (as if you chained a SetRelative
),
+ in a way that allows other DOBlendableRotate tweens to work together on the same target,
+ instead than fight each other as multiple DORotate would do.
+ Also stores the transform as the tween's target so it can be used for filtered operations
+ The value to tween byThe duration of the tween
+ Rotation mode
+
+
+ Tweens a Transform's localScale BY the given value (as if you chained a SetRelative
),
+ in a way that allows other DOBlendableScale tweens to work together on the same target,
+ instead than fight each other as multiple DOScale would do.
+ Also stores the transform as the tween's target so it can be used for filtered operations
+ The value to tween byThe duration of the tween
+
+
+
+ Completes all tweens that have this target as a reference
+ (meaning tweens that were started from this target, or that had this target added as an Id)
+ and returns the total number of tweens completed
+ (meaning the tweens that don't have infinite loops and were not already complete)
+
+ For Sequences only: if TRUE also internal Sequence callbacks will be fired,
+ otherwise they will be ignored
+
+
+
+ Completes all tweens that have this target as a reference
+ (meaning tweens that were started from this target, or that had this target added as an Id)
+ and returns the total number of tweens completed
+ (meaning the tweens that don't have infinite loops and were not already complete)
+
+ For Sequences only: if TRUE also internal Sequence callbacks will be fired,
+ otherwise they will be ignored
+
+
+
+ Kills all tweens that have this target as a reference
+ (meaning tweens that were started from this target, or that had this target added as an Id)
+ and returns the total number of tweens killed.
+
+ If TRUE completes the tween before killing it
+
+
+
+ Kills all tweens that have this target as a reference
+ (meaning tweens that were started from this target, or that had this target added as an Id)
+ and returns the total number of tweens killed.
+
+ If TRUE completes the tween before killing it
+
+
+
+ Flips the direction (backwards if it was going forward or viceversa) of all tweens that have this target as a reference
+ (meaning tweens that were started from this target, or that had this target added as an Id)
+ and returns the total number of tweens flipped.
+
+
+
+
+ Flips the direction (backwards if it was going forward or viceversa) of all tweens that have this target as a reference
+ (meaning tweens that were started from this target, or that had this target added as an Id)
+ and returns the total number of tweens flipped.
+
+
+
+
+ Sends to the given position all tweens that have this target as a reference
+ (meaning tweens that were started from this target, or that had this target added as an Id)
+ and returns the total number of tweens involved.
+
+ Time position to reach
+ (if higher than the whole tween duration the tween will simply reach its end)
+ If TRUE will play the tween after reaching the given position, otherwise it will pause it
+
+
+
+ Sends to the given position all tweens that have this target as a reference
+ (meaning tweens that were started from this target, or that had this target added as an Id)
+ and returns the total number of tweens involved.
+
+ Time position to reach
+ (if higher than the whole tween duration the tween will simply reach its end)
+ If TRUE will play the tween after reaching the given position, otherwise it will pause it
+
+
+
+ Pauses all tweens that have this target as a reference
+ (meaning tweens that were started from this target, or that had this target added as an Id)
+ and returns the total number of tweens paused.
+
+
+
+
+ Pauses all tweens that have this target as a reference
+ (meaning tweens that were started from this target, or that had this target added as an Id)
+ and returns the total number of tweens paused.
+
+
+
+
+ Plays all tweens that have this target as a reference
+ (meaning tweens that were started from this target, or that had this target added as an Id)
+ and returns the total number of tweens played.
+
+
+
+
+ Plays all tweens that have this target as a reference
+ (meaning tweens that were started from this target, or that had this target added as an Id)
+ and returns the total number of tweens played.
+
+
+
+
+ Plays backwards all tweens that have this target as a reference
+ (meaning tweens that were started from this target, or that had this target added as an Id)
+ and returns the total number of tweens played.
+
+
+
+
+ Plays backwards all tweens that have this target as a reference
+ (meaning tweens that were started from this target, or that had this target added as an Id)
+ and returns the total number of tweens played.
+
+
+
+
+ Plays forward all tweens that have this target as a reference
+ (meaning tweens that were started from this target, or that had this target added as an Id)
+ and returns the total number of tweens played.
+
+
+
+
+ Plays forward all tweens that have this target as a reference
+ (meaning tweens that were started from this target, or that had this target added as an Id)
+ and returns the total number of tweens played.
+
+
+
+
+ Restarts all tweens that have this target as a reference
+ (meaning tweens that were started from this target, or that had this target added as an Id)
+ and returns the total number of tweens restarted.
+
+
+
+
+ Restarts all tweens that have this target as a reference
+ (meaning tweens that were started from this target, or that had this target added as an Id)
+ and returns the total number of tweens restarted.
+
+
+
+
+ Rewinds all tweens that have this target as a reference
+ (meaning tweens that were started from this target, or that had this target added as an Id)
+ and returns the total number of tweens rewinded.
+
+
+
+
+ Rewinds all tweens that have this target as a reference
+ (meaning tweens that were started from this target, or that had this target added as an Id)
+ and returns the total number of tweens rewinded.
+
+
+
+
+ Smoothly rewinds all tweens that have this target as a reference
+ (meaning tweens that were started from this target, or that had this target added as an Id)
+ and returns the total number of tweens rewinded.
+
+
+
+
+ Smoothly rewinds all tweens that have this target as a reference
+ (meaning tweens that were started from this target, or that had this target added as an Id)
+ and returns the total number of tweens rewinded.
+
+
+
+
+ Toggles the paused state (plays if it was paused, pauses if it was playing) of all tweens that have this target as a reference
+ (meaning tweens that were started from this target, or that had this target added as an Id)
+ and returns the total number of tweens involved.
+
+
+
+
+ Toggles the paused state (plays if it was paused, pauses if it was playing) of all tweens that have this target as a reference
+ (meaning tweens that were started from this target, or that had this target added as an Id)
+ and returns the total number of tweens involved.
+
+
+
+
+ This class serves only as a utility class to store tween settings to apply on multiple tweens.
+ It is in no way needed otherwise, since you can directly apply tween settings to a tween via chaining
+
+
+
+ A variable you can eventually Clear and reuse when needed,
+ to avoid instantiating TweenParams objects
+
+
+ Creates a new TweenParams object, which you can use to store tween settings
+ to pass to multiple tweens via myTween.SetAs(myTweenParms)
+
+
+ Clears and resets this TweenParams instance using default values,
+ so it can be reused without instantiating another one
+
+
+ Sets the autoKill behaviour of the tween.
+ Has no effect if the tween has already started
+ If TRUE the tween will be automatically killed when complete
+
+
+ Sets an ID for the tween, which can then be used as a filter with DOTween's static methods.
+ The ID to assign to this tween. Can be an int, a string, an object or anything else.
+
+
+ Sets the target for the tween, which can then be used as a filter with DOTween's static methods.
+ IMPORTANT: use it with caution. If you just want to set an ID for the tween use SetId
instead.
+ When using shorcuts the shortcut target is already assigned as the tween's target,
+ so using this method will overwrite it and prevent shortcut-operations like myTarget.DOPause from working correctly.
+ The target to assign to this tween. Can be an int, a string, an object or anything else.
+
+
+ Sets the looping options for the tween.
+ Has no effect if the tween has already started
+ Number of cycles to play (-1 for infinite - will be converted to 1 in case the tween is nested in a Sequence)
+ Loop behaviour type (default: LoopType.Restart)
+
+
+ Sets the ease of the tween.
+ If applied to Sequences eases the whole sequence animation
+ Eventual overshoot or amplitude to use with Back or Elastic easeType (default is 1.70158)
+ Eventual period to use with Elastic easeType (default is 0)
+
+
+ Sets the ease of the tween using an AnimationCurve.
+ If applied to Sequences eases the whole sequence animation
+
+
+ Sets the ease of the tween using a custom ease function.
+ If applied to Sequences eases the whole sequence animation
+
+
+ Sets the recycling behaviour for the tween.
+ If TRUE the tween will be recycled after being killed, otherwise it will be destroyed.
+
+
+ Sets the update type to the one defined in DOTween.defaultUpdateType (UpdateType.Normal unless changed)
+ and lets you choose if it should be independent from Unity's Time.timeScale
+ If TRUE the tween will ignore Unity's Time.timeScale
+
+
+ Sets the type of update (default or independent) for the tween
+ The type of update (default: UpdateType.Normal)
+ If TRUE the tween will ignore Unity's Time.timeScale
+
+
+ Sets the onStart callback for the tween.
+ Called the first time the tween is set in a playing state, after any eventual delay
+
+
+ Sets the onPlay callback for the tween.
+ Called when the tween is set in a playing state, after any eventual delay.
+ Also called each time the tween resumes playing from a paused state
+
+
+ Sets the onRewind callback for the tween.
+ Called when the tween is rewinded,
+ either by calling Rewind
or by reaching the start position while playing backwards.
+ Rewinding a tween that is already rewinded will not fire this callback
+
+
+ Sets the onUpdate callback for the tween.
+ Called each time the tween updates
+
+
+ Sets the onStepComplete callback for the tween.
+ Called the moment the tween completes one loop cycle, even when going backwards
+
+
+ Sets the onComplete callback for the tween.
+ Called the moment the tween reaches its final forward position, loops included
+
+
+ Sets the onKill callback for the tween.
+ Called the moment the tween is killed
+
+
+ Sets the onWaypointChange callback for the tween.
+ Called when a path tween reaches a new waypoint
+
+
+ Sets a delayed startup for the tween.
+ Has no effect on Sequences or if the tween has already started
+
+
+ If isRelative is TRUE sets the tween as relative
+ (the endValue will be calculated as startValue + endValue
instead than being used directly).
+ Has no effect on Sequences or if the tween has already started
+
+
+ If isSpeedBased is TRUE sets the tween as speed based
+ (the duration will represent the number of units the tween moves x second).
+ Has no effect on Sequences, nested tweens, or if the tween has already started
+
+
+
+ Methods that extend Tween objects and allow to set their parameters
+
+
+
+ Sets the autoKill behaviour of the tween.
+ Has no effect if the tween has already started
+
+
+ Sets the autoKill behaviour of the tween.
+ Has no effect if the tween has already started
+ If TRUE the tween will be automatically killed when complete
+
+
+ Sets an ID for the tween, which can then be used as a filter with DOTween's static methods.
+ The ID to assign to this tween. Can be an int, a string, an object or anything else.
+
+
+ Sets the target for the tween, which can then be used as a filter with DOTween's static methods.
+ IMPORTANT: use it with caution. If you just want to set an ID for the tween use SetId
instead.
+ When using shorcuts the shortcut target is already assigned as the tween's target,
+ so using this method will overwrite it and prevent shortcut-operations like myTarget.DOPause from working correctly.
+ The target to assign to this tween. Can be an int, a string, an object or anything else.
+
+
+ Sets the looping options for the tween.
+ Has no effect if the tween has already started
+ Number of cycles to play (-1 for infinite - will be converted to 1 in case the tween is nested in a Sequence)
+
+
+ Sets the looping options for the tween.
+ Has no effect if the tween has already started
+ Number of cycles to play (-1 for infinite - will be converted to 1 in case the tween is nested in a Sequence)
+ Loop behaviour type (default: LoopType.Restart)
+
+
+ Sets the ease of the tween.
+ If applied to Sequences eases the whole sequence animation
+
+
+ Sets the ease of the tween.
+ If applied to Sequences eases the whole sequence animation
+
+ Eventual overshoot to use with Back or Flash ease (default is 1.70158).
+ In case of Flash ease it sets the total number of flashes that will happen.
+ Using an even number will complete the tween on the starting value, while an odd one will complete it on the end value.
+
+
+
+ Sets the ease of the tween.
+ If applied to Sequences eases the whole sequence animation
+ Eventual amplitude to use with Elastic easeType or overshoot to use with Flash easeType (default is 1.70158).
+ In case of Flash ease it sets the total number of flashes that will happen.
+ Using an even number will complete the tween on the starting value, while an odd one will complete it on the end value.
+
+ Eventual period to use with Elastic or Flash easeType (default is 0).
+ In case of Flash ease it indicates the power in time of the ease, and must be between -1 and 1.
+ 0 is balanced, 1 weakens the ease with time, -1 starts the ease weakened and gives it power towards the end.
+
+
+
+ Sets the ease of the tween using an AnimationCurve.
+ If applied to Sequences eases the whole sequence animation
+
+
+ Sets the ease of the tween using a custom ease function (which must return a value between 0 and 1).
+ If applied to Sequences eases the whole sequence animation
+
+
+ Allows the tween to be recycled after being killed.
+
+
+ Sets the recycling behaviour for the tween.
+ If TRUE the tween will be recycled after being killed, otherwise it will be destroyed.
+
+
+ Sets the update type to UpdateType.Normal and lets you choose if it should be independent from Unity's Time.timeScale
+ If TRUE the tween will ignore Unity's Time.timeScale
+
+
+ Sets the type of update for the tween
+ The type of update (defalt: UpdateType.Normal)
+
+
+ Sets the type of update for the tween and lets you choose if it should be independent from Unity's Time.timeScale
+ The type of update
+ If TRUE the tween will ignore Unity's Time.timeScale
+
+
+ Sets the onStart callback for the tween.
+ Called the first time the tween is set in a playing state, after any eventual delay
+
+
+ Sets the onPlay callback for the tween.
+ Called when the tween is set in a playing state, after any eventual delay.
+ Also called each time the tween resumes playing from a paused state
+
+
+ Sets the onPlay callback for the tween.
+ Called when the tween state changes from playing to paused.
+ If the tween has autoKill set to FALSE, this is called also when the tween reaches completion.
+
+
+ Sets the onRewind callback for the tween.
+ Called when the tween is rewinded,
+ either by calling Rewind
or by reaching the start position while playing backwards.
+ Rewinding a tween that is already rewinded will not fire this callback
+
+
+ Sets the onUpdate callback for the tween.
+ Called each time the tween updates
+
+
+ Sets the onStepComplete callback for the tween.
+ Called the moment the tween completes one loop cycle, even when going backwards
+
+
+ Sets the onComplete callback for the tween.
+ Called the moment the tween reaches its final forward position, loops included
+
+
+ Sets the onKill callback for the tween.
+ Called the moment the tween is killed
+
+
+ Sets the onWaypointChange callback for the tween.
+ Called when a path tween's current waypoint changes
+
+
+ Sets the parameters of the tween (id, ease, loops, delay, timeScale, callbacks, etc) as the parameters of the given one.
+ Doesn't copy specific SetOptions settings: those will need to be applied manually each time.
+ Has no effect if the tween has already started.
+ NOTE: the tween's target
will not be changed
+ Tween from which to copy the parameters
+
+
+ Sets the parameters of the tween (id, ease, loops, delay, timeScale, callbacks, etc) as the parameters of the given TweenParams.
+ Has no effect if the tween has already started.
+ TweenParams from which to copy the parameters
+
+
+ Adds the given tween to the end of the Sequence.
+ Has no effect if the Sequence has already started
+ The tween to append
+
+
+ Adds the given tween to the beginning of the Sequence, pushing forward the other nested content.
+ Has no effect if the Sequence has already started
+ The tween to prepend
+
+
+ Inserts the given tween at the same time position of the last tween, callback or intervale added to the Sequence.
+ Note that, in case of a Join after an interval, the insertion time will be the time where the interval starts, not where it finishes.
+ Has no effect if the Sequence has already started
+
+
+ Inserts the given tween at the given time position in the Sequence,
+ automatically adding an interval if needed.
+ Has no effect if the Sequence has already started
+ The time position where the tween will be placed
+ The tween to insert
+
+
+ Adds the given interval to the end of the Sequence.
+ Has no effect if the Sequence has already started
+ The interval duration
+
+
+ Adds the given interval to the beginning of the Sequence, pushing forward the other nested content.
+ Has no effect if the Sequence has already started
+ The interval duration
+
+
+ Adds the given callback to the end of the Sequence.
+ Has no effect if the Sequence has already started
+ The callback to append
+
+
+ Adds the given callback to the beginning of the Sequence, pushing forward the other nested content.
+ Has no effect if the Sequence has already started
+ The callback to prepend
+
+
+ Inserts the given callback at the given time position in the Sequence,
+ automatically adding an interval if needed.
+ Has no effect if the Sequence has already started
+ The time position where the callback will be placed
+ The callback to insert
+
+
+ Changes a TO tween into a FROM tween: sets the current target's position as the tween's endValue
+ then immediately sends the target to the previously set endValue.
+
+
+ Changes a TO tween into a FROM tween: sets the current target's position as the tween's endValue
+ then immediately sends the target to the previously set endValue.
+ If TRUE the FROM value will be calculated as relative to the current one
+
+
+ Sets a delayed startup for the tween.
+ Has no effect on Sequences or if the tween has already started
+
+
+ Sets the tween as relative
+ (the endValue will be calculated as startValue + endValue
instead than being used directly).
+ Has no effect on Sequences or if the tween has already started
+
+
+ If isRelative is TRUE sets the tween as relative
+ (the endValue will be calculated as startValue + endValue
instead than being used directly).
+ Has no effect on Sequences or if the tween has already started
+
+
+ If isSpeedBased is TRUE sets the tween as speed based
+ (the duration will represent the number of units the tween moves x second).
+ Has no effect on Sequences, nested tweens, or if the tween has already started
+
+
+ If isSpeedBased is TRUE sets the tween as speed based
+ (the duration will represent the number of units the tween moves x second).
+ Has no effect on Sequences, nested tweens, or if the tween has already started
+
+
+ Options for float tweens
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Options for Vector2 tweens
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Options for Vector2 tweens
+ Selecting an axis will tween the vector only on that axis, leaving the others untouched
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Options for Vector3 tweens
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Options for Vector3 tweens
+ Selecting an axis will tween the vector only on that axis, leaving the others untouched
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Options for Vector4 tweens
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Options for Vector4 tweens
+ Selecting an axis will tween the vector only on that axis, leaving the others untouched
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Options for Quaternion tweens
+ If TRUE (default) the rotation will take the shortest route, and will not rotate more than 360°.
+ If FALSE the rotation will be fully accounted. Is always FALSE if the tween is set as relative
+
+
+ Options for Color tweens
+ If TRUE only the alpha value of the color will be tweened
+
+
+ Options for Vector4 tweens
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Options for Vector4 tweens
+ If TRUE, rich text will be interpreted correctly while animated,
+ otherwise all tags will be considered as normal text
+ The type of scramble to use, if any
+ A string containing the characters to use for scrambling.
+ Use as many characters as possible (minimum 10) because DOTween uses a fast scramble mode which gives better results with more characters.
+ Leave it to NULL to use default ones
+
+
+ Options for Vector3Array tweens
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Options for Vector3Array tweens
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Options for Path tweens (created via the DOPath
shortcut)
+ The eventual movement axis to lock. You can input multiple axis if you separate them like this:
+ AxisConstrain.X | AxisConstraint.Y
+ The eventual rotation axis to lock. You can input multiple axis if you separate them like this:
+ AxisConstrain.X | AxisConstraint.Y
+
+
+ Options for Path tweens (created via the DOPath
shortcut)
+ If TRUE the path will be automatically closed
+ The eventual movement axis to lock. You can input multiple axis if you separate them like this:
+ AxisConstrain.X | AxisConstraint.Y
+ The eventual rotation axis to lock. You can input multiple axis if you separate them like this:
+ AxisConstrain.X | AxisConstraint.Y
+
+
+ Additional LookAt options for Path tweens (created via the DOPath
shortcut).
+ Orients the target towards the given position.
+ Must be chained directly to the tween creation method or to a SetOptions
+ The position to look at
+ The eventual direction to consider as "forward".
+ If left to NULL defaults to the regular forward side of the transform
+ The vector that defines in which direction up is (default: Vector3.up)
+
+
+ Additional LookAt options for Path tweens (created via the DOPath
shortcut).
+ Orients the target towards another transform.
+ Must be chained directly to the tween creation method or to a SetOptions
+ The transform to look at
+ The eventual direction to consider as "forward".
+ If left to NULL defaults to the regular forward side of the transform
+ The vector that defines in which direction up is (default: Vector3.up)
+
+
+ Additional LookAt options for Path tweens (created via the DOPath
shortcut).
+ Orients the target to the path, with the given lookAhead.
+ Must be chained directly to the tween creation method or to a SetOptions
+ The percentage of lookAhead to use (0 to 1)
+ The eventual direction to consider as "forward".
+ If left to NULL defaults to the regular forward side of the transform
+ The vector that defines in which direction up is (default: Vector3.up)
+
+
+
+ Types of log behaviours
+
+
+
+ Log only warnings and errors
+
+
+ Log warnings, errors and additional infos
+
+
+ Log only errors
+
+
+
+ Indicates either a Tweener or a Sequence
+
+
+
+ TimeScale for the tween
+
+
+ If TRUE the tween wil go backwards
+
+
+ Id (usable for filtering with DOTween static methods). Can be an int, a string, an object, or anything else
+
+
+ Tween target (usable for filtering with DOTween static methods). Automatically set by tween creation shorcuts
+
+
+ Called when the tween is set in a playing state, after any eventual delay.
+ Also called each time the tween resumes playing from a paused state
+
+
+ Called when the tween state changes from playing to paused.
+ If the tween has autoKill set to FALSE, this is called also when the tween reaches completion.
+
+
+ Called when the tween is rewinded,
+ either by calling Rewind
or by reaching the start position while playing backwards.
+ Rewinding a tween that is already rewinded will not fire this callback
+
+
+ Called each time the tween updates
+
+
+ Called the moment the tween completes one loop cycle
+
+
+ Called the moment the tween reaches completion (loops included)
+
+
+ Called the moment the tween is killed
+
+
+ Called when a path tween's current waypoint changes
+
+
+ Gets and sets the time position (loops included, delays excluded) of the tween
+
+
+
+ Animates a single value
+
+
+
+ Changes the start value of a tween and rewinds it (without pausing it).
+ Has no effect with tweens that are inside Sequences
+ The new start value
+ If bigger than 0 applies it as the new tween duration
+
+
+ Changes the end value of a tween and rewinds it (without pausing it).
+ Has no effect with tweens that are inside Sequences
+ The new end value
+ If bigger than 0 applies it as the new tween duration
+ If TRUE the start value will become the current target's value, otherwise it will stay the same
+
+
+ Changes the end value of a tween and rewinds it (without pausing it).
+ Has no effect with tweens that are inside Sequences
+ The new end value
+ If TRUE the start value will become the current target's value, otherwise it will stay the same
+
+
+ Changes the start and end value of a tween and rewinds it (without pausing it).
+ Has no effect with tweens that are inside Sequences
+ The new start value
+ The new end value
+ If bigger than 0 applies it as the new tween duration
+
+
+
+ Used internally
+
+
+
+
+ Update type
+
+
+
+ Updates every frame during Update calls
+
+
+ Updates every frame during LateUpdate calls
+
+
+ Updates using FixedUpdate calls
+
+
+
diff --git a/Assets/StrangeIoc/scripts/DOTween/DOTween.XML.meta b/Assets/StrangeIoc/scripts/DOTween/DOTween.XML.meta
new file mode 100644
index 0000000..2e7dc4d
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/DOTween/DOTween.XML.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 4962522449f608046a8aeca9f259cd8c
+timeCreated: 1469660863
+licenseType: Pro
+TextScriptImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/StrangeIoc/scripts/DOTween/DOTween.dll.mdb b/Assets/StrangeIoc/scripts/DOTween/DOTween.dll.mdb
new file mode 100644
index 0000000..c970dea
Binary files /dev/null and b/Assets/StrangeIoc/scripts/DOTween/DOTween.dll.mdb differ
diff --git a/Assets/StrangeIoc/scripts/DOTween/DOTween.dll.mdb.meta b/Assets/StrangeIoc/scripts/DOTween/DOTween.dll.mdb.meta
new file mode 100644
index 0000000..91eb814
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/DOTween/DOTween.dll.mdb.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 6cb5544f23c708a429a1e88aee745782
+timeCreated: 1469660857
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/StrangeIoc/scripts/DOTween/DOTween.dll.meta b/Assets/StrangeIoc/scripts/DOTween/DOTween.dll.meta
new file mode 100644
index 0000000..b1078ae
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/DOTween/DOTween.dll.meta
@@ -0,0 +1,24 @@
+fileFormatVersion: 2
+guid: d98ad7aee75400a49a308765b0fff0dc
+timeCreated: 1469660863
+licenseType: Pro
+PluginImporter:
+ serializedVersion: 1
+ iconMap: {}
+ executionOrder: {}
+ isPreloaded: 0
+ platformData:
+ Any:
+ enabled: 1
+ settings: {}
+ Editor:
+ enabled: 0
+ settings:
+ DefaultValueInitialized: true
+ WindowsStoreApps:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/StrangeIoc/scripts/DOTween/DOTween43.dll.addon b/Assets/StrangeIoc/scripts/DOTween/DOTween43.dll.addon
new file mode 100644
index 0000000..508fad4
Binary files /dev/null and b/Assets/StrangeIoc/scripts/DOTween/DOTween43.dll.addon differ
diff --git a/Assets/StrangeIoc/scripts/DOTween/DOTween43.dll.addon.meta b/Assets/StrangeIoc/scripts/DOTween/DOTween43.dll.addon.meta
new file mode 100644
index 0000000..767dc58
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/DOTween/DOTween43.dll.addon.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: f7cf9ca8a672e524488ce95dbda7b488
+timeCreated: 1469660857
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/StrangeIoc/scripts/DOTween/DOTween43.dll.mdb.addon b/Assets/StrangeIoc/scripts/DOTween/DOTween43.dll.mdb.addon
new file mode 100644
index 0000000..1aaeac4
Binary files /dev/null and b/Assets/StrangeIoc/scripts/DOTween/DOTween43.dll.mdb.addon differ
diff --git a/Assets/StrangeIoc/scripts/DOTween/DOTween43.dll.mdb.addon.meta b/Assets/StrangeIoc/scripts/DOTween/DOTween43.dll.mdb.addon.meta
new file mode 100644
index 0000000..b60122d
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/DOTween/DOTween43.dll.mdb.addon.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 62a0ffcc58a18da4ea8c70e3f2dd9a53
+timeCreated: 1469660857
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/StrangeIoc/scripts/DOTween/DOTween43.xml.addon b/Assets/StrangeIoc/scripts/DOTween/DOTween43.xml.addon
new file mode 100644
index 0000000..f0efe2b
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/DOTween/DOTween43.xml.addon
@@ -0,0 +1,85 @@
+
+
+
+ DOTween43
+
+
+
+
+ Methods that extend known Unity objects and allow to directly create and control tweens from their instances.
+ These, as all DOTween43 methods, require Unity 4.3 or later.
+
+
+
+ Tweens a Material's color using the given gradient
+ (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
+ Also stores the image as the tween's target so it can be used for filtered operations
+ The gradient to useThe duration of the tween
+
+
+ Tweens a Material's named color property using the given gradient
+ (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
+ Also stores the image as the tween's target so it can be used for filtered operations
+ The gradient to use
+ The name of the material property to tween (like _Tint or _SpecColor)
+ The duration of the tween
+
+
+ Tweens a SpriteRenderer's color to the given value.
+ Also stores the spriteRenderer as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+
+
+ Tweens a Material's alpha color to the given value.
+ Also stores the spriteRenderer as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+
+
+ Tweens a SpriteRenderer's color using the given gradient
+ (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
+ Also stores the image as the tween's target so it can be used for filtered operations
+ The gradient to useThe duration of the tween
+
+
+ Tweens a Rigidbody2D's position to the given value.
+ Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Tweens a Rigidbody2D's X position to the given value.
+ Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Tweens a Rigidbody2D's Y position to the given value.
+ Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Tweens a Rigidbody2D's rotation to the given value.
+ Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+
+
+ Tweens a Rigidbody2D's position to the given value, while also applying a jump effect along the Y axis.
+ Returns a Sequence instead of a Tweener.
+ Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations.
+ IMPORTANT: a rigidbody2D can't be animated in a jump arc using MovePosition, so the tween will directly set the position
+ The end value to reach
+ Power of the jump (the max height of the jump is represented by this plus the final Y offset)
+ Total number of jumps
+ The duration of the tween
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Tweens a SpriteRenderer's color to the given value,
+ in a way that allows other DOBlendableColor tweens to work together on the same target,
+ instead than fight each other as multiple DOColor would do.
+ Also stores the SpriteRenderer as the tween's target so it can be used for filtered operations
+ The value to tween toThe duration of the tween
+
+
+
diff --git a/Assets/StrangeIoc/scripts/DOTween/DOTween43.xml.addon.meta b/Assets/StrangeIoc/scripts/DOTween/DOTween43.xml.addon.meta
new file mode 100644
index 0000000..a7a95d2
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/DOTween/DOTween43.xml.addon.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 1a0dc752a926faf4ea2d0d3cda240fe8
+timeCreated: 1469660857
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/StrangeIoc/scripts/DOTween/DOTween46.dll.addon b/Assets/StrangeIoc/scripts/DOTween/DOTween46.dll.addon
new file mode 100644
index 0000000..9c38424
Binary files /dev/null and b/Assets/StrangeIoc/scripts/DOTween/DOTween46.dll.addon differ
diff --git a/Assets/StrangeIoc/scripts/DOTween/DOTween46.dll.addon.meta b/Assets/StrangeIoc/scripts/DOTween/DOTween46.dll.addon.meta
new file mode 100644
index 0000000..972fbbd
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/DOTween/DOTween46.dll.addon.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 2b2cfe3cf6c4ebe4286b625a0b984d26
+timeCreated: 1469660857
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/StrangeIoc/scripts/DOTween/DOTween46.dll.mdb.addon b/Assets/StrangeIoc/scripts/DOTween/DOTween46.dll.mdb.addon
new file mode 100644
index 0000000..a54c005
Binary files /dev/null and b/Assets/StrangeIoc/scripts/DOTween/DOTween46.dll.mdb.addon differ
diff --git a/Assets/StrangeIoc/scripts/DOTween/DOTween46.dll.mdb.addon.meta b/Assets/StrangeIoc/scripts/DOTween/DOTween46.dll.mdb.addon.meta
new file mode 100644
index 0000000..1443d95
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/DOTween/DOTween46.dll.mdb.addon.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 69c30a87e3082a0499ee6cfa61b2c5f3
+timeCreated: 1469660857
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/StrangeIoc/scripts/DOTween/DOTween46.xml.addon b/Assets/StrangeIoc/scripts/DOTween/DOTween46.xml.addon
new file mode 100644
index 0000000..35ff34d
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/DOTween/DOTween46.xml.addon
@@ -0,0 +1,214 @@
+
+
+
+ DOTween46
+
+
+
+
+ Various utils that require Unity 4.6 or later
+
+
+
+
+ Converts the anchoredPosition of the first RectTransform to the second RectTransform,
+ taking into consideration offset, anchors and pivot, and returns the new anchoredPosition
+
+
+
+
+ Methods that extend known Unity objects and allow to directly create and control tweens from their instances.
+ These, as all DOTween46 methods, require Unity 4.6 or later.
+
+
+
+ Tweens a CanvasGroup's alpha color to the given value.
+ Also stores the canvasGroup as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+
+
+ Tweens an Graphic's color to the given value.
+ Also stores the image as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+
+
+ Tweens an Graphic's alpha color to the given value.
+ Also stores the image as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+
+
+ Tweens an Image's color to the given value.
+ Also stores the image as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+
+
+ Tweens an Image's alpha color to the given value.
+ Also stores the image as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+
+
+ Tweens an Image's fillAmount to the given value.
+ Also stores the image as the tween's target so it can be used for filtered operations
+ The end value to reach (0 to 1)The duration of the tween
+
+
+ Tweens an Image's colors using the given gradient
+ (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
+ Also stores the image as the tween's target so it can be used for filtered operations
+ The gradient to useThe duration of the tween
+
+
+ Tweens an LayoutElement's flexibleWidth/Height to the given value.
+ Also stores the LayoutElement as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Tweens an LayoutElement's minWidth/Height to the given value.
+ Also stores the LayoutElement as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Tweens an LayoutElement's preferredWidth/Height to the given value.
+ Also stores the LayoutElement as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Tweens a Outline's effectColor to the given value.
+ Also stores the Outline as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+
+
+ Tweens a Outline's effectColor alpha to the given value.
+ Also stores the Outline as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+
+
+ Tweens a Outline's effectDistance to the given value.
+ Also stores the Outline as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+
+
+ Tweens a RectTransform's anchoredPosition to the given value.
+ Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Tweens a RectTransform's anchoredPosition X to the given value.
+ Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Tweens a RectTransform's anchoredPosition Y to the given value.
+ Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Tweens a RectTransform's anchoredPosition3D to the given value.
+ Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Tweens a RectTransform's sizeDelta to the given value.
+ Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Punches a RectTransform's anchoredPosition towards the given direction and then back to the starting one
+ as if it was connected to the starting position via an elastic.
+ Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ The direction and strength of the punch (added to the RectTransform's current position)
+ The duration of the tween
+ Indicates how much will the punch vibrate
+ Represents how much (0 to 1) the vector will go beyond the starting position when bouncing backwards.
+ 1 creates a full oscillation between the punch direction and the opposite direction,
+ while 0 oscillates only between the punch and the start position
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Shakes a RectTransform's anchoredPosition with the given values.
+ Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ The duration of the tween
+ The shake strength
+ Indicates how much will the shake vibrate
+ Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware).
+ Setting it to 0 will shake along a single direction.
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Shakes a RectTransform's anchoredPosition with the given values.
+ Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ The duration of the tween
+ The shake strength on each axis
+ Indicates how much will the shake vibrate
+ Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware).
+ Setting it to 0 will shake along a single direction.
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Tweens a RectTransform's anchoredPosition to the given value, while also applying a jump effect along the Y axis.
+ Returns a Sequence instead of a Tweener.
+ Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ The end value to reach
+ Power of the jump (the max height of the jump is represented by this plus the final Y offset)
+ Total number of jumps
+ The duration of the tween
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Tweens a Slider's value to the given value.
+ Also stores the Slider as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+ If TRUE the tween will smoothly snap all values to integers
+
+
+ Tweens a Text's color to the given value.
+ Also stores the Text as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+
+
+ Tweens a Text's alpha color to the given value.
+ Also stores the Text as the tween's target so it can be used for filtered operations
+ The end value to reachThe duration of the tween
+
+
+ Tweens a Text's text to the given value.
+ Also stores the Text as the tween's target so it can be used for filtered operations
+ The end string to tween toThe duration of the tween
+ If TRUE (default), rich text will be interpreted correctly while animated,
+ otherwise all tags will be considered as normal text
+ The type of scramble mode to use, if any
+ A string containing the characters to use for scrambling.
+ Use as many characters as possible (minimum 10) because DOTween uses a fast scramble mode which gives better results with more characters.
+ Leave it to NULL (default) to use default ones
+
+
+ Tweens a Graphic's color to the given value,
+ in a way that allows other DOBlendableColor tweens to work together on the same target,
+ instead than fight each other as multiple DOColor would do.
+ Also stores the Graphic as the tween's target so it can be used for filtered operations
+ The value to tween toThe duration of the tween
+
+
+ Tweens a Image's color to the given value,
+ in a way that allows other DOBlendableColor tweens to work together on the same target,
+ instead than fight each other as multiple DOColor would do.
+ Also stores the Image as the tween's target so it can be used for filtered operations
+ The value to tween toThe duration of the tween
+
+
+ Tweens a Text's color BY the given value,
+ in a way that allows other DOBlendableColor tweens to work together on the same target,
+ instead than fight each other as multiple DOColor would do.
+ Also stores the Text as the tween's target so it can be used for filtered operations
+ The value to tween toThe duration of the tween
+
+
+
diff --git a/Assets/StrangeIoc/scripts/DOTween/DOTween46.xml.addon.meta b/Assets/StrangeIoc/scripts/DOTween/DOTween46.xml.addon.meta
new file mode 100644
index 0000000..5cc27a8
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/DOTween/DOTween46.xml.addon.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: ee170b30b9c084f4486a89e3a2b0c726
+timeCreated: 1469660857
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/StrangeIoc/scripts/DOTween/DOTween50.dll.addon b/Assets/StrangeIoc/scripts/DOTween/DOTween50.dll.addon
new file mode 100644
index 0000000..3353626
Binary files /dev/null and b/Assets/StrangeIoc/scripts/DOTween/DOTween50.dll.addon differ
diff --git a/Assets/StrangeIoc/scripts/DOTween/DOTween50.dll.addon.meta b/Assets/StrangeIoc/scripts/DOTween/DOTween50.dll.addon.meta
new file mode 100644
index 0000000..5f3f21c
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/DOTween/DOTween50.dll.addon.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: e8d0c0023bc64c94da17edb1fad2a073
+timeCreated: 1469660857
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/StrangeIoc/scripts/DOTween/DOTween50.dll.mdb.addon b/Assets/StrangeIoc/scripts/DOTween/DOTween50.dll.mdb.addon
new file mode 100644
index 0000000..e80e6db
Binary files /dev/null and b/Assets/StrangeIoc/scripts/DOTween/DOTween50.dll.mdb.addon differ
diff --git a/Assets/StrangeIoc/scripts/DOTween/DOTween50.dll.mdb.addon.meta b/Assets/StrangeIoc/scripts/DOTween/DOTween50.dll.mdb.addon.meta
new file mode 100644
index 0000000..56916fb
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/DOTween/DOTween50.dll.mdb.addon.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 981ce60b489d3874481b7e18072872f6
+timeCreated: 1469660857
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/StrangeIoc/scripts/DOTween/DOTween50.xml.addon b/Assets/StrangeIoc/scripts/DOTween/DOTween50.xml.addon
new file mode 100644
index 0000000..7952aa7
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/DOTween/DOTween50.xml.addon
@@ -0,0 +1,112 @@
+
+
+
+ DOTween50
+
+
+
+
+ Methods that extend known Unity objects and allow to directly create and control tweens from their instances.
+ These, as all DOTween50 methods, require Unity 5.0 or later.
+
+
+
+ Tweens an AudioMixer's exposed float to the given value.
+ Also stores the AudioMixer as the tween's target so it can be used for filtered operations.
+ Note that you need to manually expose a float in an AudioMixerGroup in order to be able to tween it from an AudioMixer.
+ Name given to the exposed float to set
+ The end value to reachThe duration of the tween
+
+
+
+ Completes all tweens that have this target as a reference
+ (meaning tweens that were started from this target, or that had this target added as an Id)
+ and returns the total number of tweens completed
+ (meaning the tweens that don't have infinite loops and were not already complete)
+
+ For Sequences only: if TRUE also internal Sequence callbacks will be fired,
+ otherwise they will be ignored
+
+
+
+ Kills all tweens that have this target as a reference
+ (meaning tweens that were started from this target, or that had this target added as an Id)
+ and returns the total number of tweens killed.
+
+ If TRUE completes the tween before killing it
+
+
+
+ Flips the direction (backwards if it was going forward or viceversa) of all tweens that have this target as a reference
+ (meaning tweens that were started from this target, or that had this target added as an Id)
+ and returns the total number of tweens flipped.
+
+
+
+
+ Sends to the given position all tweens that have this target as a reference
+ (meaning tweens that were started from this target, or that had this target added as an Id)
+ and returns the total number of tweens involved.
+
+ Time position to reach
+ (if higher than the whole tween duration the tween will simply reach its end)
+ If TRUE will play the tween after reaching the given position, otherwise it will pause it
+
+
+
+ Pauses all tweens that have this target as a reference
+ (meaning tweens that were started from this target, or that had this target added as an Id)
+ and returns the total number of tweens paused.
+
+
+
+
+ Plays all tweens that have this target as a reference
+ (meaning tweens that were started from this target, or that had this target added as an Id)
+ and returns the total number of tweens played.
+
+
+
+
+ Plays backwards all tweens that have this target as a reference
+ (meaning tweens that were started from this target, or that had this target added as an Id)
+ and returns the total number of tweens played.
+
+
+
+
+ Plays forward all tweens that have this target as a reference
+ (meaning tweens that were started from this target, or that had this target added as an Id)
+ and returns the total number of tweens played.
+
+
+
+
+ Restarts all tweens that have this target as a reference
+ (meaning tweens that were started from this target, or that had this target added as an Id)
+ and returns the total number of tweens restarted.
+
+
+
+
+ Rewinds all tweens that have this target as a reference
+ (meaning tweens that were started from this target, or that had this target added as an Id)
+ and returns the total number of tweens rewinded.
+
+
+
+
+ Smoothly rewinds all tweens that have this target as a reference
+ (meaning tweens that were started from this target, or that had this target added as an Id)
+ and returns the total number of tweens rewinded.
+
+
+
+
+ Toggles the paused state (plays if it was paused, pauses if it was playing) of all tweens that have this target as a reference
+ (meaning tweens that were started from this target, or that had this target added as an Id)
+ and returns the total number of tweens involved.
+
+
+
+
diff --git a/Assets/StrangeIoc/scripts/DOTween/DOTween50.xml.addon.meta b/Assets/StrangeIoc/scripts/DOTween/DOTween50.xml.addon.meta
new file mode 100644
index 0000000..0aa68a2
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/DOTween/DOTween50.xml.addon.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: d5b47ffe906c2f64b9624c8e4e0d9129
+timeCreated: 1469660857
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/StrangeIoc/scripts/DOTween/Editor.meta b/Assets/StrangeIoc/scripts/DOTween/Editor.meta
new file mode 100644
index 0000000..da4ed56
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/DOTween/Editor.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 0624f859896845e4799afec5b332b299
+folderAsset: yes
+timeCreated: 1469660856
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/StrangeIoc/scripts/DOTween/Editor/DOTweenEditor.XML b/Assets/StrangeIoc/scripts/DOTween/Editor/DOTweenEditor.XML
new file mode 100644
index 0000000..6afe743
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/DOTween/Editor/DOTweenEditor.XML
@@ -0,0 +1,65 @@
+
+
+
+ DOTweenEditor
+
+
+
+
+ Checks that the given editor texture use the correct import settings,
+ and applies them if they're incorrect.
+
+
+
+
+ Returns TRUE if addons setup is required.
+
+
+
+
+ Returns TRUE if the file/directory at the given path exists.
+
+ Path, relative to Unity's project folder
+
+
+
+
+ Converts the given project-relative path to a full path,
+ with backward (\) slashes).
+
+
+
+
+ Converts the given full path to a path usable with AssetDatabase methods
+ (relative to Unity's project folder, and with the correct Unity forward (/) slashes).
+
+
+
+
+ Connects to a asset.
+ If the asset already exists at the given path, loads it and returns it.
+ Otherwise, either returns NULL or automatically creates it before loading and returning it
+ (depending on the given parameters).
+
+ Asset type
+ File path (relative to Unity's project folder)
+ If TRUE and the requested asset doesn't exist, forces its creation
+
+
+
+ Full path for the given loaded assembly, assembly file included
+
+
+
+
+ Not used as menu item anymore, but as a utiity function
+
+
+
+
+ Setups DOTween
+
+ If TRUE, no warning window appears in case there is no need for setup
+
+
+
diff --git a/Assets/StrangeIoc/scripts/DOTween/Editor/DOTweenEditor.XML.meta b/Assets/StrangeIoc/scripts/DOTween/Editor/DOTweenEditor.XML.meta
new file mode 100644
index 0000000..6373e7e
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/DOTween/Editor/DOTweenEditor.XML.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: f10cb66cd24116b4dbdfde1ff20f91ae
+timeCreated: 1469660863
+licenseType: Pro
+TextScriptImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/StrangeIoc/scripts/DOTween/Editor/DOTweenEditor.dll.mdb b/Assets/StrangeIoc/scripts/DOTween/Editor/DOTweenEditor.dll.mdb
new file mode 100644
index 0000000..33a66b1
Binary files /dev/null and b/Assets/StrangeIoc/scripts/DOTween/Editor/DOTweenEditor.dll.mdb differ
diff --git a/Assets/StrangeIoc/scripts/DOTween/Editor/DOTweenEditor.dll.mdb.meta b/Assets/StrangeIoc/scripts/DOTween/Editor/DOTweenEditor.dll.mdb.meta
new file mode 100644
index 0000000..a2aca64
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/DOTween/Editor/DOTweenEditor.dll.mdb.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 68ad846a9f81e2e4dace3352416384aa
+timeCreated: 1469660857
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/StrangeIoc/scripts/DOTween/Editor/DOTweenEditor.dll.meta b/Assets/StrangeIoc/scripts/DOTween/Editor/DOTweenEditor.dll.meta
new file mode 100644
index 0000000..8461aa4
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/DOTween/Editor/DOTweenEditor.dll.meta
@@ -0,0 +1,24 @@
+fileFormatVersion: 2
+guid: 414832293f33d1d43afd9e62a7255f66
+timeCreated: 1469660859
+licenseType: Pro
+PluginImporter:
+ serializedVersion: 1
+ iconMap: {}
+ executionOrder: {}
+ isPreloaded: 0
+ platformData:
+ Any:
+ enabled: 0
+ settings: {}
+ Editor:
+ enabled: 1
+ settings:
+ DefaultValueInitialized: true
+ WindowsStoreApps:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/StrangeIoc/scripts/DOTween/Editor/Imgs.meta b/Assets/StrangeIoc/scripts/DOTween/Editor/Imgs.meta
new file mode 100644
index 0000000..cb3c922
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/DOTween/Editor/Imgs.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 187fca1db125dd4488d492fbe2d67d48
+folderAsset: yes
+timeCreated: 1469660857
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/StrangeIoc/scripts/DOTween/Editor/Imgs/DOTweenIcon.png b/Assets/StrangeIoc/scripts/DOTween/Editor/Imgs/DOTweenIcon.png
new file mode 100644
index 0000000..d06fc7c
Binary files /dev/null and b/Assets/StrangeIoc/scripts/DOTween/Editor/Imgs/DOTweenIcon.png differ
diff --git a/Assets/StrangeIoc/scripts/DOTween/Editor/Imgs/DOTweenIcon.png.meta b/Assets/StrangeIoc/scripts/DOTween/Editor/Imgs/DOTweenIcon.png.meta
new file mode 100644
index 0000000..c85de57
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/DOTween/Editor/Imgs/DOTweenIcon.png.meta
@@ -0,0 +1,57 @@
+fileFormatVersion: 2
+guid: 0becf0df9ceb26344a9b821ca6d61039
+timeCreated: 1469660863
+licenseType: Pro
+TextureImporter:
+ fileIDToRecycleName: {}
+ serializedVersion: 2
+ mipmaps:
+ mipMapMode: 0
+ enableMipMap: 1
+ linearTexture: 0
+ correctGamma: 0
+ fadeOut: 0
+ borderMipMap: 0
+ mipMapFadeDistanceStart: 1
+ mipMapFadeDistanceEnd: 3
+ bumpmap:
+ convertToNormalMap: 0
+ externalNormalMap: 0
+ heightScale: 0.25
+ normalMapFilter: 0
+ isReadable: 0
+ grayScaleToAlpha: 0
+ generateCubemap: 0
+ cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
+ seamlessCubemap: 0
+ textureFormat: -1
+ maxTextureSize: 2048
+ textureSettings:
+ filterMode: -1
+ aniso: -1
+ mipBias: -1
+ wrapMode: 1
+ nPOTScale: 0
+ lightmap: 0
+ rGBM: 0
+ compressionQuality: 50
+ allowsAlphaSplitting: 0
+ spriteMode: 1
+ spriteExtrude: 1
+ spriteMeshType: 1
+ alignment: 0
+ spritePivot: {x: 0.5, y: 0.5}
+ spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+ spritePixelsToUnits: 100
+ alphaIsTransparency: 1
+ textureType: 8
+ buildTargetSettings: []
+ spriteSheet:
+ sprites: []
+ outline: []
+ spritePackingTag:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/StrangeIoc/scripts/DOTween/Editor/Imgs/Footer.png b/Assets/StrangeIoc/scripts/DOTween/Editor/Imgs/Footer.png
new file mode 100644
index 0000000..e29d02f
Binary files /dev/null and b/Assets/StrangeIoc/scripts/DOTween/Editor/Imgs/Footer.png differ
diff --git a/Assets/StrangeIoc/scripts/DOTween/Editor/Imgs/Footer.png.meta b/Assets/StrangeIoc/scripts/DOTween/Editor/Imgs/Footer.png.meta
new file mode 100644
index 0000000..127621b
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/DOTween/Editor/Imgs/Footer.png.meta
@@ -0,0 +1,57 @@
+fileFormatVersion: 2
+guid: 5aedbf790b0b998498d7b85a875f512b
+timeCreated: 1469660863
+licenseType: Pro
+TextureImporter:
+ fileIDToRecycleName: {}
+ serializedVersion: 2
+ mipmaps:
+ mipMapMode: 0
+ enableMipMap: 1
+ linearTexture: 0
+ correctGamma: 0
+ fadeOut: 0
+ borderMipMap: 0
+ mipMapFadeDistanceStart: 1
+ mipMapFadeDistanceEnd: 3
+ bumpmap:
+ convertToNormalMap: 0
+ externalNormalMap: 0
+ heightScale: 0.25
+ normalMapFilter: 0
+ isReadable: 0
+ grayScaleToAlpha: 0
+ generateCubemap: 0
+ cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
+ seamlessCubemap: 0
+ textureFormat: -1
+ maxTextureSize: 2048
+ textureSettings:
+ filterMode: -1
+ aniso: -1
+ mipBias: -1
+ wrapMode: 1
+ nPOTScale: 0
+ lightmap: 0
+ rGBM: 0
+ compressionQuality: 50
+ allowsAlphaSplitting: 0
+ spriteMode: 1
+ spriteExtrude: 1
+ spriteMeshType: 1
+ alignment: 0
+ spritePivot: {x: 0.5, y: 0.5}
+ spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+ spritePixelsToUnits: 100
+ alphaIsTransparency: 1
+ textureType: 8
+ buildTargetSettings: []
+ spriteSheet:
+ sprites: []
+ outline: []
+ spritePackingTag:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/StrangeIoc/scripts/DOTween/Editor/Imgs/Footer_dark.png b/Assets/StrangeIoc/scripts/DOTween/Editor/Imgs/Footer_dark.png
new file mode 100644
index 0000000..e48db5e
Binary files /dev/null and b/Assets/StrangeIoc/scripts/DOTween/Editor/Imgs/Footer_dark.png differ
diff --git a/Assets/StrangeIoc/scripts/DOTween/Editor/Imgs/Footer_dark.png.meta b/Assets/StrangeIoc/scripts/DOTween/Editor/Imgs/Footer_dark.png.meta
new file mode 100644
index 0000000..c4cf667
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/DOTween/Editor/Imgs/Footer_dark.png.meta
@@ -0,0 +1,57 @@
+fileFormatVersion: 2
+guid: 182bad4fcc5a46b4fa545b5087da8a33
+timeCreated: 1469660863
+licenseType: Pro
+TextureImporter:
+ fileIDToRecycleName: {}
+ serializedVersion: 2
+ mipmaps:
+ mipMapMode: 0
+ enableMipMap: 1
+ linearTexture: 0
+ correctGamma: 0
+ fadeOut: 0
+ borderMipMap: 0
+ mipMapFadeDistanceStart: 1
+ mipMapFadeDistanceEnd: 3
+ bumpmap:
+ convertToNormalMap: 0
+ externalNormalMap: 0
+ heightScale: 0.25
+ normalMapFilter: 0
+ isReadable: 0
+ grayScaleToAlpha: 0
+ generateCubemap: 0
+ cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
+ seamlessCubemap: 0
+ textureFormat: -1
+ maxTextureSize: 2048
+ textureSettings:
+ filterMode: -1
+ aniso: -1
+ mipBias: -1
+ wrapMode: 1
+ nPOTScale: 0
+ lightmap: 0
+ rGBM: 0
+ compressionQuality: 50
+ allowsAlphaSplitting: 0
+ spriteMode: 1
+ spriteExtrude: 1
+ spriteMeshType: 1
+ alignment: 0
+ spritePivot: {x: 0.5, y: 0.5}
+ spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+ spritePixelsToUnits: 100
+ alphaIsTransparency: 1
+ textureType: 8
+ buildTargetSettings: []
+ spriteSheet:
+ sprites: []
+ outline: []
+ spritePackingTag:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/StrangeIoc/scripts/DOTween/Editor/Imgs/Header.jpg b/Assets/StrangeIoc/scripts/DOTween/Editor/Imgs/Header.jpg
new file mode 100644
index 0000000..4d710d7
Binary files /dev/null and b/Assets/StrangeIoc/scripts/DOTween/Editor/Imgs/Header.jpg differ
diff --git a/Assets/StrangeIoc/scripts/DOTween/Editor/Imgs/Header.jpg.meta b/Assets/StrangeIoc/scripts/DOTween/Editor/Imgs/Header.jpg.meta
new file mode 100644
index 0000000..bbadf56
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/DOTween/Editor/Imgs/Header.jpg.meta
@@ -0,0 +1,57 @@
+fileFormatVersion: 2
+guid: 3de592e28ac9acf4ea61a49e0e3f8b48
+timeCreated: 1469660863
+licenseType: Pro
+TextureImporter:
+ fileIDToRecycleName: {}
+ serializedVersion: 2
+ mipmaps:
+ mipMapMode: 0
+ enableMipMap: 1
+ linearTexture: 0
+ correctGamma: 0
+ fadeOut: 0
+ borderMipMap: 0
+ mipMapFadeDistanceStart: 1
+ mipMapFadeDistanceEnd: 3
+ bumpmap:
+ convertToNormalMap: 0
+ externalNormalMap: 0
+ heightScale: 0.25
+ normalMapFilter: 0
+ isReadable: 0
+ grayScaleToAlpha: 0
+ generateCubemap: 0
+ cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
+ seamlessCubemap: 0
+ textureFormat: -1
+ maxTextureSize: 2048
+ textureSettings:
+ filterMode: -1
+ aniso: -1
+ mipBias: -1
+ wrapMode: 1
+ nPOTScale: 0
+ lightmap: 0
+ rGBM: 0
+ compressionQuality: 50
+ allowsAlphaSplitting: 0
+ spriteMode: 1
+ spriteExtrude: 1
+ spriteMeshType: 1
+ alignment: 0
+ spritePivot: {x: 0.5, y: 0.5}
+ spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+ spritePixelsToUnits: 100
+ alphaIsTransparency: 1
+ textureType: 8
+ buildTargetSettings: []
+ spriteSheet:
+ sprites: []
+ outline: []
+ spritePackingTag:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/StrangeIoc/scripts/DOTween/readme.txt b/Assets/StrangeIoc/scripts/DOTween/readme.txt
new file mode 100644
index 0000000..3439db1
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/DOTween/readme.txt
@@ -0,0 +1,18 @@
+DOTween and DOTween Pro are copyright (c) 2014 Daniele Giardini - Demigiant
+
+// GET STARTED //////////////////////////////////////////////
+
+- After importing a new DOTween update, select DOTween's Utility Panel from the Tools menu (if it doesn't open automatically) and press the "Setup DOTween..." button to set up additional features based on your Unity version.
+- In your code, add "using DG.Tweening" to each class where you want to use DOTween.
+- You're ready to tween. Check out the links below for full documentation and license info.
+
+
+// LINKS ///////////////////////////////////////////////////////
+
+DOTween website (documentation, examples, etc): http://dotween.demigiant.com
+DOTween license: http://dotween.demigiant.com/license.php
+DOTween repository (Google Code): https://code.google.com/p/dotween/
+
+// NOTES //////////////////////////////////////////////////////
+
+- DOTween's Utility Panel can be found under "Tools > DOTween Utility Panel" and also contains other useful options, plus a tab to set DOTween's preferences
\ No newline at end of file
diff --git a/Assets/StrangeIoc/scripts/DOTween/readme.txt.meta b/Assets/StrangeIoc/scripts/DOTween/readme.txt.meta
new file mode 100644
index 0000000..fda53b4
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/DOTween/readme.txt.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 335059fc6bd5cc44b8076f4d50e6db0d
+timeCreated: 1469660863
+licenseType: Pro
+TextScriptImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/StrangeIoc/scripts/strange.meta b/Assets/StrangeIoc/scripts/strange.meta
new file mode 100644
index 0000000..0ea258c
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/strange.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 2003eb008ce77064c88a902f666fceb6
+folderAsset: yes
+timeCreated: 1468815447
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/StrangeIoc/scripts/strange/.gitignore b/Assets/StrangeIoc/scripts/strange/.gitignore
new file mode 100644
index 0000000..2249472
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/strange/.gitignore
@@ -0,0 +1,8 @@
+*~
+.DS_Store
+desktop.ini
+*.cache
+*.svn
+
+tests/*
+Library/*
diff --git a/Assets/StrangeIoc/scripts/strange/.tests/extensions/command/TestCommand.cs b/Assets/StrangeIoc/scripts/strange/.tests/extensions/command/TestCommand.cs
new file mode 100644
index 0000000..ed40e2b
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/strange/.tests/extensions/command/TestCommand.cs
@@ -0,0 +1,35 @@
+
+using System;
+using NUnit.Framework;
+using strange.extensions.command.api;
+using strange.extensions.command.impl;
+
+namespace strange.unittests
+{
+ [TestFixture()]
+ public class TestCommand
+ {
+
+ [Test]
+ public void TestSuccessfulExecute ()
+ {
+ ICommand command = new CommandWithExecute ();
+ TestDelegate testDelegate = delegate()
+ {
+ command.Execute();
+ };
+ Assert.DoesNotThrow (testDelegate);
+ }
+
+ [Test]
+ public void TestRetainRelease ()
+ {
+ ICommand command = new CommandWithExecute ();
+ Assert.IsFalse (command.retain);
+ command.Retain ();
+ Assert.IsTrue (command.retain);
+ command.Release ();
+ Assert.IsFalse (command.retain);
+ }
+ }
+}
diff --git a/Assets/StrangeIoc/scripts/strange/.tests/extensions/command/TestCommandBinder.cs b/Assets/StrangeIoc/scripts/strange/.tests/extensions/command/TestCommandBinder.cs
new file mode 100644
index 0000000..71f3a57
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/strange/.tests/extensions/command/TestCommandBinder.cs
@@ -0,0 +1,261 @@
+using System;
+using System.Timers;
+using NUnit.Framework;
+using strange.extensions.command.api;
+using strange.extensions.command.impl;
+using strange.extensions.injector.api;
+using strange.extensions.injector.impl;
+using strange.framework.api;
+using strange.framework.impl;
+
+namespace strange.unittests
+{
+ [TestFixture()]
+ public class TestCommandBinder
+ {
+ IInjectionBinder injectionBinder;
+ ICommandBinder commandBinder;
+
+ [SetUp]
+ public void SetUp()
+ {
+ injectionBinder = new InjectionBinder();
+ injectionBinder.Bind ().Bind ().ToValue (injectionBinder);
+ injectionBinder.Bind ().To ().ToSingleton ();
+ commandBinder = injectionBinder.GetInstance ();
+ }
+
+ [Test]
+ public void TestExecuteInjectionCommand ()
+ {
+ //CommandWithInjection requires an ISimpleInterface
+ injectionBinder.Bind().To ().ToSingleton();
+
+ //Bind the trigger to the command
+ commandBinder.Bind(SomeEnum.ONE).To();
+ commandBinder.ReactTo (SomeEnum.ONE);
+
+ //The command should set the value to 100
+ ISimpleInterface instance = injectionBinder.GetInstance();
+ Assert.AreEqual (100, instance.intValue);
+ }
+
+ [Test]
+ public void TestMultipleCommands ()
+ {
+ //CommandWithInjection requires an ISimpleInterface
+ injectionBinder.Bind().To ().ToSingleton();
+
+ //Bind the trigger to the command
+ commandBinder.Bind(SomeEnum.ONE).To().To().To();
+
+ TestDelegate testDelegate = delegate
+ {
+ commandBinder.ReactTo (SomeEnum.ONE);
+ };
+
+ //That the exception is thrown demonstrates that the last command ran
+ NotImplementedException ex = Assert.Throws (testDelegate);
+ Assert.NotNull(ex);
+
+ //That the value is 100 demonstrates that the first command ran
+ ISimpleInterface instance = injectionBinder.GetInstance() as ISimpleInterface;
+ Assert.AreEqual (100, instance.intValue);
+ }
+
+ [Test]
+ public void TestMultipleOfSame ()
+ {
+ injectionBinder.Bind().ToSingleton();
+ commandBinder.Bind(SomeEnum.ONE).To().To();
+ TestModel testModel = injectionBinder.GetInstance() as TestModel;
+ Assert.AreEqual(0, testModel.Value);
+ commandBinder.ReactTo (SomeEnum.ONE);
+ Assert.AreEqual(2, testModel.Value); //first command gives 1, second gives 2
+ }
+
+ [Test]
+ public void TestNotOnce()
+ {
+ //CommandWithInjection requires an ISimpleInterface
+ injectionBinder.Bind().To ().ToSingleton();
+
+ //Bind the trigger to the command
+ commandBinder.Bind(SomeEnum.ONE).To();
+
+ ICommandBinding binding = commandBinder.GetBinding (SomeEnum.ONE) as ICommandBinding;
+ Assert.IsNotNull (binding);
+
+ commandBinder.ReactTo (SomeEnum.ONE);
+
+ ICommandBinding binding2 = commandBinder.GetBinding (SomeEnum.ONE) as ICommandBinding;
+ Assert.IsNotNull (binding2);
+ }
+
+ [Test]
+ public void TestOnce ()
+ {
+ //CommandWithInjection requires an ISimpleInterface
+ injectionBinder.Bind().To ().ToSingleton();
+
+ //Bind the trigger to the command
+ commandBinder.Bind(SomeEnum.ONE).To().Once();
+
+ ICommandBinding binding = commandBinder.GetBinding (SomeEnum.ONE) as ICommandBinding;
+ Assert.IsNotNull (binding);
+
+ commandBinder.ReactTo (SomeEnum.ONE);
+
+ ICommandBinding binding2 = commandBinder.GetBinding (SomeEnum.ONE) as ICommandBinding;
+ Assert.IsNull (binding2);
+ }
+
+ [Test]
+ public void TestSequence ()
+ {
+ //CommandWithInjection requires an ISimpleInterface
+ injectionBinder.Bind().To ().ToSingleton();
+
+ //Bind the trigger to the command
+ commandBinder.Bind(SomeEnum.ONE).To().To().To().InSequence();
+
+ TestDelegate testDelegate = delegate
+ {
+ commandBinder.ReactTo (SomeEnum.ONE);
+ };
+
+ //That the exception is thrown demonstrates that the last command ran
+ NotImplementedException ex = Assert.Throws (testDelegate);
+ Assert.NotNull(ex);
+
+ //That the value is 100 demonstrates that the first command ran
+ ISimpleInterface instance = injectionBinder.GetInstance() as ISimpleInterface;
+ Assert.AreEqual (100, instance.intValue);
+ }
+
+ [Test]
+ public void TestInterruptedSequence ()
+ {
+ //CommandWithInjection requires an ISimpleInterface
+ injectionBinder.Bind().To ().ToSingleton();
+
+ //Bind the trigger to the command
+ commandBinder.Bind(SomeEnum.ONE).To().To().To().InSequence();
+
+ TestDelegate testDelegate = delegate
+ {
+ commandBinder.ReactTo (SomeEnum.ONE);
+ };
+
+ //That the exception is not thrown demonstrates that the last command was interrupted
+ Assert.DoesNotThrow (testDelegate);
+
+ //That the value is 100 demonstrates that the first command ran
+ ISimpleInterface instance = injectionBinder.GetInstance() as ISimpleInterface;
+ Assert.AreEqual (100, instance.intValue);
+ }
+
+ [Test]
+ public void TestSimpleRuntimeCommandBinding()
+ {
+ string jsonInjectorString = "[{\"Bind\":\"strange.unittests.ISimpleInterface\",\"To\":\"strange.unittests.SimpleInterfaceImplementer\", \"Options\":\"ToSingleton\"}]";
+ injectionBinder.ConsumeBindings (jsonInjectorString);
+
+ string jsonCommandString = "[{\"Bind\":\"strange.unittests.SomeEnum.ONE\",\"To\":\"strange.unittests.CommandWithInjection\"}]";
+ commandBinder.ConsumeBindings(jsonCommandString);
+ commandBinder.ReactTo (SomeEnum.ONE);
+
+ ISimpleInterface instance = injectionBinder.GetInstance() as ISimpleInterface;
+ Assert.AreEqual (100, instance.intValue);
+ }
+
+ [Test]
+ public void TestRuntimeSequenceCommandBinding()
+ {
+ string jsonInjectorString = "[{\"Bind\":\"strange.unittests.ISimpleInterface\",\"To\":\"strange.unittests.SimpleInterfaceImplementer\", \"Options\":\"ToSingleton\"}]";
+ injectionBinder.ConsumeBindings (jsonInjectorString);
+
+ string jsonCommandString = "[{\"Bind\":\"TestEvent\",\"To\":[\"strange.unittests.CommandWithInjection\",\"strange.unittests.CommandWithExecute\",\"strange.unittests.CommandThatThrows\"],\"Options\":\"InSequence\"}]";
+ commandBinder.ConsumeBindings(jsonCommandString);
+
+ ICommandBinding binding = commandBinder.GetBinding ("TestEvent") as ICommandBinding;
+ Assert.IsTrue (binding.isSequence);
+
+ TestDelegate testDelegate = delegate
+ {
+ commandBinder.ReactTo ("TestEvent");
+ };
+
+ //That the exception is thrown demonstrates that the last command ran
+ NotImplementedException ex = Assert.Throws (testDelegate);
+ Assert.NotNull(ex);
+
+ ISimpleInterface instance = injectionBinder.GetInstance() as ISimpleInterface;
+ Assert.AreEqual (100, instance.intValue);
+ }
+
+ [Test]
+ public void TestRuntimeCommandBindingOnce()
+ {
+ string jsonInjectorString = "[{\"Bind\":\"strange.unittests.ISimpleInterface\",\"To\":\"strange.unittests.SimpleInterfaceImplementer\", \"Options\":\"ToSingleton\"}]";
+ injectionBinder.ConsumeBindings (jsonInjectorString);
+
+ string jsonCommandString = "[{\"Bind\":\"TestEvent\",\"To\":[\"strange.unittests.CommandWithInjection\"],\"Options\":\"Once\"}]";
+ commandBinder.ConsumeBindings(jsonCommandString);
+
+ ICommandBinding binding = commandBinder.GetBinding ("TestEvent") as ICommandBinding;
+ Assert.IsTrue (binding.isOneOff);
+ commandBinder.ReactTo ("TestEvent");
+
+ ISimpleInterface instance = injectionBinder.GetInstance() as ISimpleInterface;
+ Assert.AreEqual (100, instance.intValue);
+
+ ICommandBinding binding2 = commandBinder.GetBinding ("TestEvent") as ICommandBinding;
+ Assert.IsNull (binding2);
+ }
+
+ [Test]
+ public void TestRuntimeUnqualifiedCommandException()
+ {
+ string jsonInjectorString = "[{\"Bind\":\"strange.unittests.ISimpleInterface\",\"To\":\"strange.unittests.SimpleInterfaceImplementer\", \"Options\":\"ToSingleton\"}]";
+ injectionBinder.ConsumeBindings (jsonInjectorString);
+
+ string jsonCommandString = "[{\"Bind\":\"TestEvent\",\"To\":\"CommandWithInjection\"}]";
+ TestDelegate testDelegate = delegate
+ {
+ commandBinder.ConsumeBindings(jsonCommandString);
+ };
+
+ BinderException ex = Assert.Throws (testDelegate);
+ Assert.AreEqual (ex.type, BinderExceptionType.RUNTIME_NULL_VALUE);
+ }
+
+
+
+ //TODO: figure out how to do async tests
+ /*
+ [Test]
+ public async void TestAsyncCommand()
+ {
+ injectionBinder.Bind().To ();
+ commandBinder.Bind (SomeEnum.ONE).To ();
+ Task answer = commandBinder.ReactTo (SomeEnum.ONE);
+
+ //Assert.Throws ( await );
+ }
+ */
+ }
+
+
+ class NoArgCommand: Command
+ {
+ [Inject]
+ public TestModel TestModel { get; set; }
+
+ public override void Execute()
+ {
+ TestModel.Value++;
+ }
+ }
+}
+
diff --git a/Assets/StrangeIoc/scripts/strange/.tests/extensions/command/TestCommandBinderWithoutPools.cs b/Assets/StrangeIoc/scripts/strange/.tests/extensions/command/TestCommandBinderWithoutPools.cs
new file mode 100644
index 0000000..97634ad
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/strange/.tests/extensions/command/TestCommandBinderWithoutPools.cs
@@ -0,0 +1,121 @@
+using System;
+using NUnit.Framework;
+using strange.extensions.command.api;
+using strange.extensions.injector.api;
+using strange.extensions.injector.impl;
+using strange.framework.api;
+using strange.extensions.command.impl;
+using System.Collections.Generic;
+using strange.extensions.pool.api;
+
+namespace strange.unittests
+{
+ [TestFixture]
+ public class TestCommandBinderWithoutPools
+ {
+ private ICommandBinder commandBinder;
+ private IInjectionBinder injectionBinder;
+
+
+ [SetUp]
+ public void SetUp()
+ {
+ injectionBinder = new InjectionBinder ();
+ injectionBinder.Bind().Bind().ToValue(injectionBinder);
+ injectionBinder.Bind ().To ().ToSingleton();
+
+ commandBinder = injectionBinder.GetInstance ();
+ (commandBinder as IPooledCommandBinder).usePooling = false;
+ }
+
+ [Test]
+ public void TestCommandsNotReused()
+ {
+ commandBinder.Bind (SomeEnum.ONE).To ();
+ IPool pool = (commandBinder as IPooledCommandBinder).GetPool ();
+ Assert.IsNull (pool);
+ }
+
+ [Test]
+ public void TestNotOnce()
+ {
+ //CommandWithInjection requires an ISimpleInterface
+ injectionBinder.Bind().To ().ToSingleton();
+
+ //Bind the trigger to the command
+ commandBinder.Bind(SomeEnum.ONE).To();
+
+ ICommandBinding binding = commandBinder.GetBinding (SomeEnum.ONE) as ICommandBinding;
+ Assert.IsNotNull (binding);
+
+ commandBinder.ReactTo (SomeEnum.ONE);
+
+ ICommandBinding binding2 = commandBinder.GetBinding (SomeEnum.ONE) as ICommandBinding;
+ Assert.IsNotNull (binding2);
+ }
+
+ [Test]
+ public void TestOnce ()
+ {
+ //CommandWithInjection requires an ISimpleInterface
+ injectionBinder.Bind().To ().ToSingleton();
+
+ //Bind the trigger to the command
+ commandBinder.Bind(SomeEnum.ONE).To().Once();
+
+ ICommandBinding binding = commandBinder.GetBinding (SomeEnum.ONE) as ICommandBinding;
+ Assert.IsNotNull (binding);
+
+ commandBinder.ReactTo (SomeEnum.ONE);
+
+ ICommandBinding binding2 = commandBinder.GetBinding (SomeEnum.ONE) as ICommandBinding;
+ Assert.IsNull (binding2);
+ }
+
+ [Test]
+ public void TestSequence ()
+ {
+ //CommandWithInjection requires an ISimpleInterface
+ injectionBinder.Bind().To ().ToSingleton();
+
+ //Bind the trigger to the command
+ commandBinder.Bind(SomeEnum.ONE).To().To().To().InSequence();
+
+ TestDelegate testDelegate = delegate
+ {
+ commandBinder.ReactTo (SomeEnum.ONE);
+ };
+
+ //That the exception is thrown demonstrates that the last command ran
+ NotImplementedException ex = Assert.Throws (testDelegate);
+ Assert.NotNull(ex);
+
+ //That the value is 100 demonstrates that the first command ran
+ ISimpleInterface instance = injectionBinder.GetInstance() as ISimpleInterface;
+ Assert.AreEqual (100, instance.intValue);
+ }
+
+ [Test]
+ public void TestInterruptedSequence ()
+ {
+ //CommandWithInjection requires an ISimpleInterface
+ injectionBinder.Bind().To ().ToSingleton();
+
+ //Bind the trigger to the command
+ commandBinder.Bind(SomeEnum.ONE).To().To().To().InSequence();
+
+ TestDelegate testDelegate = delegate
+ {
+ commandBinder.ReactTo (SomeEnum.ONE);
+ };
+
+ //That the exception is not thrown demonstrates that the last command was interrupted
+ Assert.DoesNotThrow (testDelegate);
+
+ //That the value is 100 demonstrates that the first command ran
+ ISimpleInterface instance = injectionBinder.GetInstance() as ISimpleInterface;
+ Assert.AreEqual (100, instance.intValue);
+ }
+ }
+}
+
diff --git a/Assets/StrangeIoc/scripts/strange/.tests/extensions/command/TestCommandPooling.cs b/Assets/StrangeIoc/scripts/strange/.tests/extensions/command/TestCommandPooling.cs
new file mode 100644
index 0000000..0fd1b38
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/strange/.tests/extensions/command/TestCommandPooling.cs
@@ -0,0 +1,169 @@
+
+using System;
+using System.Collections.Generic;
+using NUnit.Framework;
+using strange.extensions.command.api;
+using strange.extensions.command.impl;
+using strange.extensions.injector.impl;
+using strange.extensions.injector.api;
+using strange.extensions.pool.impl;
+using strange.extensions.pool.api;
+using strange.framework.api;
+using strange.extensions.signal.impl;
+
+namespace strange.unittests
+{
+ [TestFixture()]
+ public class TestCommandPooling
+ {
+ private ICommandBinder commandBinder;
+ private IPooledCommandBinder pooledCommandBinder;
+ private IInjectionBinder injectionBinder;
+
+
+ [SetUp]
+ public void SetUp()
+ {
+ injectionBinder = new InjectionBinder ();
+ injectionBinder.Bind().Bind().ToValue(injectionBinder);
+ injectionBinder.Bind ().To ().ToSingleton();
+
+ commandBinder = injectionBinder.GetInstance ();
+ pooledCommandBinder = commandBinder as IPooledCommandBinder;
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ MarkablePoolCommand.incrementValue = 0;
+ }
+
+ [Test]
+ public void TestCommandIsInjected()
+ {
+ injectionBinder.Bind ().To ();
+ commandBinder.Bind (SomeEnum.ONE).To ().Pooled();
+ TestDelegate testDelegate = delegate
+ {
+ commandBinder.ReactTo (SomeEnum.ONE);
+ };
+ //If the injected value were not set, this command would throw a Null Pointer Exception
+ Assert.DoesNotThrow (testDelegate);
+ }
+
+ [Test]
+ public void TestCommandGetsReused()
+ {
+ commandBinder.Bind (SomeEnum.ONE).To ().Pooled();
+ IPool pool = pooledCommandBinder.GetPool ();
+
+ for (int a = 0; a < 10; a++)
+ {
+ commandBinder.ReactTo (SomeEnum.ONE);
+ Assert.AreEqual (a+1, MarkablePoolCommand.incrementValue);
+ Assert.AreEqual (1, pool.instanceCount);
+ }
+ }
+
+ [Test]
+ public void TestCommandBinderHasManyPools()
+ {
+ commandBinder.Bind (SomeEnum.ONE).To ().Pooled();
+ commandBinder.Bind (SomeEnum.TWO).To ().Pooled();
+ commandBinder.Bind (SomeEnum.THREE).To ().Pooled();
+
+ IPool firstPool = pooledCommandBinder.GetPool ();
+ IPool secondPool = pooledCommandBinder.GetPool ();
+ IPool thirdPool = pooledCommandBinder.GetPool ();
+
+ Assert.IsNotNull (firstPool);
+ Assert.IsNotNull (secondPool);
+ Assert.IsNotNull (thirdPool);
+
+ Assert.AreNotSame (firstPool, secondPool);
+ Assert.AreNotSame (secondPool, thirdPool);
+ Assert.AreNotSame (thirdPool, firstPool);
+ }
+
+ [Test]
+ public void TestCleanupInjections()
+ {
+ injectionBinder.Bind ().To ();
+ commandBinder.Bind (SomeEnum.ONE).To ().Pooled();
+
+ commandBinder.ReactTo (SomeEnum.ONE);
+ IPool pool = pooledCommandBinder.GetPool ();
+
+ CommandWithInjection cmd = pool.GetInstance () as CommandWithInjection;
+
+ Assert.AreEqual (1, pool.instanceCount); //These just assert our expectation that there's one instance
+ Assert.AreEqual (0, pool.available); //and we're looking at it.
+
+ Assert.IsNull (cmd.injected);
+ }
+
+ [Test]
+ public void TestCommandWorksSecondTime()
+ {
+ injectionBinder.Bind ().To ();
+ commandBinder.Bind (SomeEnum.ONE).To ().Pooled();
+
+ commandBinder.ReactTo (SomeEnum.ONE);
+ IPool pool = pooledCommandBinder.GetPool ();
+
+ CommandWithInjection cmd = pool.GetInstance () as CommandWithInjection;
+
+ Assert.AreEqual (1, pool.instanceCount); //These just assert our expectation that there's one instance
+ Assert.AreEqual (0, pool.available); //and we're looking at it.
+
+ Assert.IsNull (cmd.injected);
+
+ TestDelegate testDelegate = delegate
+ {
+ commandBinder.ReactTo (SomeEnum.ONE);
+ };
+ Assert.DoesNotThrow (testDelegate);
+ }
+
+ [Test]
+ public void TestFactoryInjectionGivesUniqueInstances()
+ {
+ injectionBinder.Bind ().To ();
+ injectionBinder.Bind> ().To> ().ToSingleton ();
+ commandBinder.Bind (SomeEnum.ONE).To ().Pooled();
+
+ Signal signal = injectionBinder.GetInstance>();
+ signal.AddListener (cb);
+
+ commandBinder.ReactTo (SomeEnum.ONE);
+ commandBinder.ReactTo (SomeEnum.ONE);
+
+ Assert.AreEqual (2, instanceList.Count);
+ Assert.AreNotSame (instanceList [0], instanceList [1]);
+
+ }
+
+ [Test]
+ public void TestRuntimeCommandWithPooling()
+ {
+ string jsonInjectorString = "[{\"Bind\":\"strange.unittests.ISimpleInterface\",\"To\":\"strange.unittests.SimpleInterfaceImplementer\", \"Options\":\"ToSingleton\"}]";
+ injectionBinder.ConsumeBindings (jsonInjectorString);
+
+ string jsonCommandString = "[{\"Bind\":\"TestEvent\",\"To\":\"strange.unittests.CommandWithInjection\", \"Options\":\"Pooled\"}]";
+ commandBinder.ConsumeBindings(jsonCommandString);
+ ICommandBinding binding = commandBinder.GetBinding ("TestEvent") as ICommandBinding;
+ Assert.IsTrue (binding.isPooled);
+ commandBinder.ReactTo ("TestEvent");
+
+ ISimpleInterface instance = injectionBinder.GetInstance() as ISimpleInterface;
+ Assert.AreEqual (100, instance.intValue);
+ }
+
+ private List instanceList = new List();
+ private void cb(SimpleInterfaceImplementer instance)
+ {
+ instanceList.Add (instance);
+ }
+ }
+}
+
diff --git a/Assets/StrangeIoc/scripts/strange/.tests/extensions/command/TestEventCommandBinder.cs b/Assets/StrangeIoc/scripts/strange/.tests/extensions/command/TestEventCommandBinder.cs
new file mode 100644
index 0000000..6d1eaef
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/strange/.tests/extensions/command/TestEventCommandBinder.cs
@@ -0,0 +1,86 @@
+using System;
+using NUnit.Framework;
+using strange.extensions.command.api;
+using strange.extensions.command.impl;
+using strange.extensions.context.api;
+using strange.extensions.dispatcher.api;
+using strange.extensions.dispatcher.eventdispatcher.api;
+using strange.extensions.dispatcher.eventdispatcher.impl;
+using strange.extensions.injector.api;
+using strange.extensions.injector.impl;
+using strange.framework.api;
+
+namespace strange.unittests
+{
+ [TestFixture]
+ public class TestEventCommandBinder
+ {
+ private IInjectionBinder injectionBinder;
+ private ICommandBinder commandBinder;
+ private IEventDispatcher eventDispatcher;
+
+ [SetUp]
+ public void SetUp()
+ {
+
+ injectionBinder = new InjectionBinder();
+ injectionBinder.Bind().Bind().ToValue(injectionBinder);
+ injectionBinder.Bind().To().ToSingleton().ToName(ContextKeys.CONTEXT_DISPATCHER);
+ injectionBinder.Bind().To().ToSingleton();
+ commandBinder = injectionBinder.GetInstance();
+ eventDispatcher = injectionBinder.GetInstance(ContextKeys.CONTEXT_DISPATCHER);
+ (eventDispatcher as ITriggerProvider).AddTriggerable(commandBinder as ITriggerable);
+ BadCommand.TestValue = 0;
+
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ EventDispatcher.eventPool.Clean();
+ }
+
+ [Test] public void TestBadConstructorCleanup()
+ {
+ commandBinder.Bind(TestEvent.TEST).To();
+
+ Assert.Throws(delegate
+ {
+ eventDispatcher.Dispatch(TestEvent.TEST);
+ Assert.AreEqual(0,BadCommand.TestValue); //execute did not run
+ });
+
+ //Run it back, and assert that it throws a CommandException
+ //It should *NOT* throw a binder exception
+ //Recent fix to wrap createCommand with a try catch finally block fixes this previous bug.
+ Assert.Throws(delegate
+ {
+ eventDispatcher.Dispatch(TestEvent.TEST);
+ });
+
+ }
+
+ class TestEvent : IEvent
+ {
+
+ public const string TEST = "TEST";
+ public object type { get; set; }
+ public IEventDispatcher target { get; set; }
+ public object data { get; set; }
+
+ }
+ class BadCommand : EventCommand
+ {
+ public static int TestValue;
+ public BadCommand()
+ {
+ //This is nonsense, but should break horribly on GetInstance
+ injectionBinder.Bind().To(new TestEvent());
+ }
+ public override void Execute()
+ {
+ TestValue++;
+ }
+ }
+ }
+}
diff --git a/Assets/StrangeIoc/scripts/strange/.tests/extensions/context/TestContext.cs b/Assets/StrangeIoc/scripts/strange/.tests/extensions/context/TestContext.cs
new file mode 100644
index 0000000..24e03bc
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/strange/.tests/extensions/context/TestContext.cs
@@ -0,0 +1,125 @@
+using NUnit.Framework;
+using strange.extensions.context.impl;
+using strange.extensions.injector.impl;
+using strange.extensions.injector.api;
+using strange.extensions.context.api;
+
+namespace strange.unittests
+{
+
+ /**
+ * Test the startup routine for a basic Context.
+ **/
+ [TestFixture]
+ public class TestContext
+ {
+ object view;
+
+ [SetUp]
+ public void SetUp()
+ {
+ Context.firstContext = null;
+ view = new object();
+ }
+
+ [Test]
+ public void TestContextIsFirstContext()
+ {
+ Context context = new Context (view);
+ Assert.AreEqual (context, Context.firstContext);
+ }
+
+ [Test]
+ public void TestContextView()
+ {
+ Context context = new Context (view);
+ Assert.AreEqual (view, context.contextView);
+ }
+
+ [Test]
+ public void TestAutoStartup()
+ {
+ TestContextSubclass context = new TestContextSubclass (view);
+ Assert.AreEqual (TestContextSubclass.LAUNCH_VALUE, context.testValue);
+ }
+
+ [Test]
+ public void TestInterruptMapping()
+ {
+ TestContextSubclass context = new TestContextSubclass (view, ContextStartupFlags.MANUAL_MAPPING);
+ Assert.AreEqual (TestContextSubclass.INIT_VALUE, context.testValue);
+ context.Start ();
+ Assert.AreEqual (TestContextSubclass.LAUNCH_VALUE, context.testValue);
+ }
+
+ [Test]
+ public void TestInterruptLaunch()
+ {
+ TestContextSubclass context = new TestContextSubclass (view, ContextStartupFlags.MANUAL_LAUNCH);
+ Assert.AreEqual (TestContextSubclass.MAPPING_VALUE, context.testValue);
+ context.Launch ();
+ Assert.AreEqual (TestContextSubclass.LAUNCH_VALUE, context.testValue);
+ }
+
+ [Test]
+ public void TestInterruptAll()
+ {
+ TestContextSubclass context = new TestContextSubclass (view, ContextStartupFlags.MANUAL_MAPPING | ContextStartupFlags.MANUAL_LAUNCH);
+ Assert.AreEqual (TestContextSubclass.INIT_VALUE, context.testValue);
+ context.Start ();
+ Assert.AreEqual (TestContextSubclass.MAPPING_VALUE, context.testValue);
+ context.Launch ();
+ Assert.AreEqual (TestContextSubclass.LAUNCH_VALUE, context.testValue);
+ }
+
+ [Test]
+ public void TestOldStyleInterruptLaunch()
+ {
+ TestContextSubclass context = new TestContextSubclass (view, false);
+ Assert.AreEqual (TestContextSubclass.INIT_VALUE, context.testValue);
+ context.Start ();
+ Assert.AreEqual (TestContextSubclass.MAPPING_VALUE, context.testValue);
+ context.Launch ();
+ Assert.AreEqual (TestContextSubclass.LAUNCH_VALUE, context.testValue);
+ }
+
+ [Test]
+ public void TestOldStyleAutoStartup()
+ {
+ TestContextSubclass context = new TestContextSubclass (view, true);
+ Assert.AreEqual (TestContextSubclass.INIT_VALUE, context.testValue);
+ context.Start ();
+ Assert.AreEqual (TestContextSubclass.LAUNCH_VALUE, context.testValue);
+ }
+ }
+
+ class TestContextSubclass : Context
+ {
+ public static string INIT_VALUE = "Zaphod";
+ public static string MAPPING_VALUE = "Ford Prefect";
+ public static string LAUNCH_VALUE = "Arthur Dent";
+
+ private string _testValue = INIT_VALUE;
+ public string testValue
+ {
+ get { return _testValue; }
+ }
+
+ public TestContextSubclass (object view) : base(view){}
+ public TestContextSubclass (object view, bool autoMapping) : base(view, autoMapping){}
+ public TestContextSubclass (object view, ContextStartupFlags flags) : base(view, flags){}
+
+
+ protected override void mapBindings ()
+ {
+ base.mapBindings ();
+ _testValue = MAPPING_VALUE;
+ }
+
+ public override void Launch ()
+ {
+ base.Launch ();
+ _testValue = LAUNCH_VALUE;
+ }
+ }
+}
diff --git a/Assets/StrangeIoc/scripts/strange/.tests/extensions/context/TestContextRemoval.cs b/Assets/StrangeIoc/scripts/strange/.tests/extensions/context/TestContextRemoval.cs
new file mode 100644
index 0000000..3f57d53
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/strange/.tests/extensions/context/TestContextRemoval.cs
@@ -0,0 +1,59 @@
+
+using NUnit.Framework;
+using strange.extensions.context.impl;
+using System;
+
+namespace strange.unittests
+{
+ [TestFixture]
+ public class TestContextRemoval
+ {
+ object view;
+ CrossContext Parent;
+ TestCrossContextSubclass Child;
+
+ [SetUp]
+ public void SetUp()
+ {
+ Context.firstContext = null;
+ view = new object();
+ Parent = new CrossContext(view, true);
+ Child = new TestCrossContextSubclass(view, true);
+ }
+
+ [Test]
+ public void TestRemoval()
+ {
+ Parent.AddContext(Child);
+
+ TestDelegate testDelegate = delegate
+ {
+ Parent.RemoveContext(Child);
+ };
+
+ Assert.Throws(testDelegate);
+ }
+ }
+
+
+ public class TestCrossContextSubclass : CrossContext
+ {
+ public TestCrossContextSubclass() : base()
+ {}
+
+ public TestCrossContextSubclass(object view, bool autoStartup) : base(view, autoStartup)
+ {}
+
+ public override void OnRemove()
+ {
+ base.OnRemove();
+
+ throw new TestPassedException("Test Passed");
+ }
+ }
+
+ class TestPassedException : Exception
+ {
+ public TestPassedException(string str) : base(str) { }
+ }
+}
diff --git a/Assets/StrangeIoc/scripts/strange/.tests/extensions/context/TestCrossContext.cs b/Assets/StrangeIoc/scripts/strange/.tests/extensions/context/TestCrossContext.cs
new file mode 100644
index 0000000..549850b
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/strange/.tests/extensions/context/TestCrossContext.cs
@@ -0,0 +1,288 @@
+using System;
+using NUnit.Framework;
+using strange.extensions.context.impl;
+using strange.extensions.injector.api;
+
+namespace strange.unittests
+{
+
+ /**
+ * Some functionality for Cross Context will be impossible to test
+ * The goal here is to test whatever we can, but the actual implementation will
+ * vary per users and rely heavily on Unity in most cases, which we can't test here.
+ **/
+ [TestFixture]
+ public class TestCrossContext
+ {
+ object view;
+ CrossContext Parent;
+ CrossContext ChildOne;
+ CrossContext ChildTwo;
+
+ [SetUp]
+ public void SetUp()
+ {
+ Context.firstContext = null;
+ view = new object();
+ Parent = new CrossContext(view, true);
+ ChildOne = new CrossContext(view, true); //Ctr will automatically add to Context.firstcontext. No need to call it manually (and you should not).
+ ChildTwo = new CrossContext(view, true);
+ }
+
+ [Test]
+ public void TestCorrectInjector() //Issue #189
+ {
+ Parent.injectionBinder.Bind().To().CrossContext();
+
+ ChildOne.injectionBinder.Bind().To();
+ ChildTwo.injectionBinder.Bind().To();
+
+ var carOne = ChildOne.injectionBinder.GetInstance();
+ var carTwo = ChildTwo.injectionBinder.GetInstance();
+
+ Assert.NotNull(carOne);
+ Assert.NotNull(carTwo);
+
+ Assert.IsTrue(carOne.Engine is GasEngine);
+ Assert.IsTrue(carTwo.Engine is ElectricEngine);
+ }
+
+
+ [Test]
+ public void TestValue()
+ {
+ TestModel parentModel = new TestModel();
+ Parent.injectionBinder.Bind().ToValue(parentModel).CrossContext(); //bind it once here and it should be accessible everywhere
+
+ TestModel parentModelTwo = Parent.injectionBinder.GetInstance() as TestModel;
+
+ Assert.AreSame(parentModel, parentModelTwo); //Assure that this value is correct
+
+ TestModel childOneModel = ChildOne.injectionBinder.GetInstance() as TestModel;
+ Assert.IsNotNull(childOneModel);
+ TestModel childTwoModel = ChildTwo.injectionBinder.GetInstance() as TestModel;
+ Assert.IsNotNull(childTwoModel);
+ Assert.AreSame(childOneModel, childTwoModel); //These two should be the same object
+
+ Assert.AreEqual(0, parentModel.Value);
+
+ parentModel.Value++;
+ Assert.AreEqual(1, childOneModel.Value);
+
+ parentModel.Value++;
+ Assert.AreEqual(2, childTwoModel.Value);
+
+ }
+
+ [Test]
+ public void TestFactory()
+ {
+ TestModel parentModel = new TestModel();
+ Parent.injectionBinder.Bind().To().CrossContext();
+
+ TestModel parentModelTwo = Parent.injectionBinder.GetInstance() as TestModel;
+
+ Assert.AreNotSame(parentModel, parentModelTwo); //As it's a factory, we should not have the same objects
+
+ TestModel childOneModel = ChildOne.injectionBinder.GetInstance() as TestModel;
+ Assert.IsNotNull(childOneModel);
+ TestModel childTwoModel = ChildTwo.injectionBinder.GetInstance() as TestModel;
+ Assert.IsNotNull(childTwoModel);
+ Assert.AreNotSame(childOneModel, childTwoModel); //These two should be DIFFERENT
+
+ Assert.AreEqual(0, parentModel.Value);
+
+ parentModel.Value++;
+ Assert.AreEqual(0, childOneModel.Value); //doesn't change
+
+ parentModel.Value++;
+ Assert.AreEqual(0, childTwoModel.Value); //doesn't change
+
+ }
+
+ [Test]
+ public void TestNamed()
+ {
+ string name = "Name";
+ TestModel parentModel = new TestModel();
+ Parent.injectionBinder.Bind().ToValue(parentModel).ToName(name).CrossContext(); //bind it once here and it should be accessible everywhere
+
+ TestModel parentModelTwo = Parent.injectionBinder.GetInstance(name) as TestModel;
+
+ Assert.AreSame(parentModel, parentModelTwo); //Assure that this value is correct
+
+ TestModel childOneModel = ChildOne.injectionBinder.GetInstance(name) as TestModel;
+ Assert.IsNotNull(childOneModel);
+ TestModel childTwoModel = ChildTwo.injectionBinder.GetInstance(name) as TestModel;
+ Assert.IsNotNull(childTwoModel);
+ Assert.AreSame(childOneModel, childTwoModel); //These two should be the same object
+
+ Assert.AreEqual(0, parentModel.Value);
+
+ parentModel.Value++;
+ Assert.AreEqual(1, childOneModel.Value);
+
+ parentModel.Value++;
+ Assert.AreEqual(2, childTwoModel.Value);
+ }
+
+ //test that local bindings will override cross bindings
+ [Test]
+ public void TestLocalOverridesCrossContext()
+ {
+ Parent.injectionBinder.Bind().ToSingleton().CrossContext(); //bind the cross context binding.
+ TestModel initialChildOneModel = new TestModel();
+ initialChildOneModel.Value = 1000;
+
+
+ ChildOne.injectionBinder.Bind().ToValue(initialChildOneModel); //Bind a local override in this child
+
+ TestModel parentModel = Parent.injectionBinder.GetInstance() as TestModel; //Get the instance from the parent injector (The cross context binding)
+
+
+ TestModel childOneModel = ChildOne.injectionBinder.GetInstance() as TestModel;
+ Assert.AreSame(initialChildOneModel, childOneModel); // The value from getInstance is the same as the value we just mapped as a value locally
+ Assert.AreNotSame(childOneModel, parentModel); //The value from getinstance is NOT the same as the cross context value. We have overidden the cross context value locally
+
+
+ TestModel childTwoModel = ChildTwo.injectionBinder.GetInstance() as TestModel;
+ Assert.IsNotNull(childTwoModel);
+ Assert.AreNotSame(childOneModel, childTwoModel); //These two are different objects, the childTwoModel being cross context, and childone being the override
+ Assert.AreSame(parentModel, childTwoModel); //Both cross context models are the same
+
+
+ parentModel.Value++;
+ Assert.AreEqual(1, childTwoModel.Value); //cross context model should be changed
+
+ parentModel.Value++;
+ Assert.AreEqual(1000, childOneModel.Value); //local model is not changed
+
+
+ Assert.AreEqual(2, parentModel.Value); //cross context model is changed
+
+ }
+
+ [Test]
+ public void TestSingleton()
+ {
+ Parent.injectionBinder.Bind().ToSingleton().CrossContext(); //bind it once here and it should be accessible everywhere
+
+ TestModel parentModel = Parent.injectionBinder.GetInstance() as TestModel;
+ Assert.IsNotNull(parentModel);
+
+ TestModel childOneModel = ChildOne.injectionBinder.GetInstance() as TestModel;
+ Assert.IsNotNull(childOneModel);
+ TestModel childTwoModel = ChildTwo.injectionBinder.GetInstance() as TestModel;
+ Assert.IsNotNull(childTwoModel);
+
+ Assert.AreSame(parentModel, childOneModel);
+ Assert.AreSame(parentModel, childTwoModel);
+ Assert.AreSame(childOneModel, childTwoModel);
+
+ IInjectionBinding binding = Parent.injectionBinder.GetBinding();
+ Assert.IsNotNull(binding);
+ Assert.IsTrue(binding.isCrossContext);
+
+ IInjectionBinding childBinding = ChildOne.injectionBinder.GetBinding();
+ Assert.IsNotNull(childBinding);
+ Assert.IsTrue(childBinding.isCrossContext);
+
+
+ Assert.AreEqual(0, parentModel.Value);
+
+ parentModel.Value++;
+ Assert.AreEqual(1, childOneModel.Value);
+
+ parentModel.Value++;
+ Assert.AreEqual(2, childTwoModel.Value);
+
+ }
+
+ [Test]
+ public void TestSingletonUnbind()
+ {
+ Parent.injectionBinder.Bind().ToSingleton().CrossContext(); //bind it once here and it should be accessible everywhere
+
+ TestModel parentModel = Parent.injectionBinder.GetInstance() as TestModel;
+ Assert.IsNotNull(parentModel);
+
+ TestModel childOneModel = ChildOne.injectionBinder.GetInstance() as TestModel;
+ Assert.IsNotNull(childOneModel);
+ TestModel childTwoModel = ChildTwo.injectionBinder.GetInstance() as TestModel;
+ Assert.IsNotNull(childTwoModel);
+
+ //Lots of lines that tell us they're all the same binding
+
+ Assert.AreSame(parentModel, childOneModel);
+ Assert.AreSame(parentModel, childTwoModel);
+ Assert.AreSame(childOneModel, childTwoModel);
+
+ IInjectionBinding binding = Parent.injectionBinder.GetBinding();
+ Assert.IsNotNull(binding);
+ Assert.IsTrue(binding.isCrossContext);
+
+ IInjectionBinding childBinding = ChildOne.injectionBinder.GetBinding();
+ Assert.IsNotNull(childBinding);
+ Assert.IsTrue(childBinding.isCrossContext);
+
+
+ Assert.AreEqual(0, parentModel.Value);
+
+ parentModel.Value++;
+ Assert.AreEqual(1, childOneModel.Value);
+
+ parentModel.Value++;
+ Assert.AreEqual(2, childTwoModel.Value);
+
+
+
+ //unbinding the parent should unbind the children who do not have a specific local binding
+
+ Parent.injectionBinder.Unbind();
+
+ binding = Parent.injectionBinder.GetBinding();
+ Assert.IsNull(binding);
+ childBinding = ChildOne.injectionBinder.GetBinding();
+ Assert.IsNull(childBinding);
+ childBinding = ChildTwo.injectionBinder.GetBinding();
+ Assert.IsNull(childBinding);
+ }
+
+ }
+
+
+ public class TestModel
+ {
+ public int Value = 0;
+ }
+
+ #region - Bug specific test classes ISSUE 189
+
+ interface IVehicle
+ {
+ IEngine Engine { get; }
+ }
+
+ interface IEngine
+ {
+ string Name { get; }
+ }
+
+ class Car : IVehicle
+ {
+ [Inject]
+ public IEngine Engine { get; set; }
+ }
+
+ class GasEngine : IEngine
+ {
+ public string Name { get { return "GAS"; } }
+ }
+ class ElectricEngine : IEngine
+ {
+ public string Name { get { return "ELECTRIC"; } }
+ }
+
+ #endregion
+
+}
diff --git a/Assets/StrangeIoc/scripts/strange/.tests/extensions/context/TestCrossContextBridge.cs b/Assets/StrangeIoc/scripts/strange/.tests/extensions/context/TestCrossContextBridge.cs
new file mode 100644
index 0000000..baa253e
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/strange/.tests/extensions/context/TestCrossContextBridge.cs
@@ -0,0 +1,148 @@
+using NUnit.Framework;
+using strange.extensions.context.impl;
+using strange.extensions.injector.impl;
+using strange.extensions.injector.api;
+using strange.extensions.dispatcher.eventdispatcher.api;
+using strange.extensions.dispatcher.eventdispatcher.impl;
+using strange.extensions.context.api;
+using System;
+
+namespace strange.unittests
+{
+ public class TestCrossContextBridge
+ {
+ object view;
+ CrossContext Parent;
+ CrossContext ChildOne;
+ CrossContext ChildTwo;
+
+ private int testValue;
+
+ [SetUp]
+ public void SetUp()
+ {
+ testValue = 0;
+
+ Context.firstContext = null;
+ view = new object();
+ Parent = new CrossContextTestClass(view, true);
+ Parent.Start ();
+
+ ChildOne = new CrossContextTestClass(view, true);
+ ChildOne.Start ();
+
+ ChildTwo = new CrossContextTestClass(view, true);
+ ChildTwo.Start ();
+ }
+
+ [Test]
+ public void TestBridgeMapping()
+ {
+ Assert.IsNotNull (Parent.crossContextBridge);
+ Assert.IsNotNull (ChildOne.crossContextBridge);
+ Assert.IsNotNull (ChildTwo.crossContextBridge);
+
+ Assert.AreSame (Parent.crossContextBridge, ChildOne.crossContextBridge);
+ Assert.AreSame (ChildOne.crossContextBridge, ChildTwo.crossContextBridge);
+ Assert.AreSame (ChildTwo.crossContextBridge, Parent.crossContextBridge);
+ }
+
+ [Test]
+ public void TestBridgeParentToChild()
+ {
+ Parent.crossContextBridge.Bind (SomeEnum.ONE);
+ IEventDispatcher parentDispatcher = Parent.injectionBinder.GetInstance (ContextKeys.CONTEXT_DISPATCHER) as IEventDispatcher;
+
+ IEventDispatcher childDispatcher = ChildOne.injectionBinder.GetInstance (ContextKeys.CONTEXT_DISPATCHER) as IEventDispatcher;
+ childDispatcher.AddListener (SomeEnum.ONE, testCallback);
+
+ int sentValue1 = 42;
+ int sentValue2 = 43;
+
+ parentDispatcher.Dispatch (SomeEnum.ONE, sentValue1);
+ Assert.AreEqual (sentValue1, testValue);
+
+ Parent.crossContextBridge.Unbind (SomeEnum.ONE);
+
+ parentDispatcher.Dispatch (SomeEnum.ONE, sentValue2);
+ Assert.AreEqual (sentValue1, testValue); //didn't change
+
+ //Unit-test wise, this is a bit of a cheat, but it assures me that
+ //all Events are returned to the EventDispatcher pool
+ Assert.AreEqual (0, EventDispatcher.eventPool.instanceCount - EventDispatcher.eventPool.available);
+ }
+
+ [Test]
+ public void TestBridgeChildToParent()
+ {
+ ChildOne.crossContextBridge.Bind (SomeEnum.ONE);
+ IEventDispatcher childDispatcher = ChildOne.injectionBinder.GetInstance (ContextKeys.CONTEXT_DISPATCHER) as IEventDispatcher;
+
+ IEventDispatcher parentDispatcher = Parent.injectionBinder.GetInstance (ContextKeys.CONTEXT_DISPATCHER) as IEventDispatcher;
+ parentDispatcher.AddListener (SomeEnum.ONE, testCallback);
+
+ int sentValue1 = 42;
+ int sentValue2 = 43;
+
+ childDispatcher.Dispatch (SomeEnum.ONE, sentValue1);
+ Assert.AreEqual (sentValue1, testValue);
+
+ ChildOne.crossContextBridge.Unbind (SomeEnum.ONE);
+
+ childDispatcher.Dispatch (SomeEnum.ONE, sentValue2);
+ Assert.AreEqual (sentValue1, testValue);
+
+ //Unit-test wise, this is a bit of a cheat, but it assures me that
+ //all Events are returned to the EventDispatcher pool
+ Assert.AreEqual (0, EventDispatcher.eventPool.instanceCount - EventDispatcher.eventPool.available);
+ }
+
+ [Test]
+ public void TestBridgeChildToChild()
+ {
+ ChildTwo.crossContextBridge.Bind (SomeEnum.ONE); //Note: binding in one Context...
+ IEventDispatcher childOneDispatcher = ChildOne.injectionBinder.GetInstance (ContextKeys.CONTEXT_DISPATCHER) as IEventDispatcher;
+
+ IEventDispatcher childTwoDispatcher = ChildTwo.injectionBinder.GetInstance (ContextKeys.CONTEXT_DISPATCHER) as IEventDispatcher;
+ childTwoDispatcher.AddListener (SomeEnum.ONE, testCallback);
+
+ int sentValue1 = 42;
+ int sentValue2 = 43;
+
+ childOneDispatcher.Dispatch (SomeEnum.ONE, sentValue1);
+ Assert.AreEqual (sentValue1, testValue);
+
+ ChildOne.crossContextBridge.Unbind (SomeEnum.ONE); //...unbinding in another
+
+ childOneDispatcher.Dispatch (SomeEnum.ONE, sentValue2);
+ Assert.AreEqual (sentValue1, testValue);
+
+ //Unit-test wise, this is a bit of a cheat, but it assures me that
+ //all Events are returned to the EventDispatcher pool
+ Assert.AreEqual (0, EventDispatcher.eventPool.instanceCount - EventDispatcher.eventPool.available);
+ }
+
+ private void testCallback(IEvent evt)
+ {
+ testValue = (int) evt.data;
+ }
+ }
+
+ class CrossContextTestClass : CrossContext
+ {
+ public CrossContextTestClass() : base()
+ {}
+
+ public CrossContextTestClass(object view, bool autoStartup) : base(view, autoStartup)
+ {
+ }
+
+ protected override void addCoreComponents()
+ {
+ base.addCoreComponents();
+ injectionBinder.Bind().To().ToSingleton().ToName(ContextKeys.CONTEXT_DISPATCHER);
+ }
+ }
+
+}
+
diff --git a/Assets/StrangeIoc/scripts/strange/.tests/extensions/eventdispatcher/TestEventBinding.cs b/Assets/StrangeIoc/scripts/strange/.tests/extensions/eventdispatcher/TestEventBinding.cs
new file mode 100644
index 0000000..466e931
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/strange/.tests/extensions/eventdispatcher/TestEventBinding.cs
@@ -0,0 +1,82 @@
+using System;
+using NUnit.Framework;
+using strange.extensions.dispatcher.eventdispatcher.api;
+using strange.extensions.dispatcher.eventdispatcher.impl;
+
+namespace strange.unittests
+{
+ [TestFixture()]
+ public class TestEventBinding
+ {
+ private const int INIT_VALUE = 42;
+ private int confirmationValue = 42;
+
+
+ [Test]
+ public void TestMapNoArgumentCallback ()
+ {
+ confirmationValue = INIT_VALUE;
+ IEventBinding binding = new EventBinding ();
+ binding.Bind (SomeEnum.ONE).To (noArgumentCallback);
+ EventCallbackType type = binding.TypeForCallback (noArgumentCallback);
+ object[] value = binding.value as object[];
+ Delegate extracted = value[0] as Delegate;
+
+ Assert.AreEqual (EventCallbackType.NO_ARGUMENTS, type);
+
+ extracted.DynamicInvoke(new object[0]);
+ //Calling the method should change the confirmationValue
+ Assert.AreNotEqual (confirmationValue, INIT_VALUE);
+ }
+
+ private void noArgumentCallback()
+ {
+ confirmationValue *= 2;
+ }
+
+ [Test]
+ public void TestMapOneArgumentCallback ()
+ {
+ confirmationValue = INIT_VALUE;
+ IEventBinding binding = new EventBinding ();
+ binding.Bind (SomeEnum.ONE).To (oneArgumentCallback);
+ EventCallbackType type = binding.TypeForCallback (oneArgumentCallback);
+ object[] value = binding.value as object[];
+ Delegate extracted = value[0] as Delegate;
+
+ Assert.AreEqual (EventCallbackType.ONE_ARGUMENT, type);
+
+ object[] parameters = new object[1];
+ parameters [0] = new TestEvent("TEST", null, INIT_VALUE);
+ extracted.DynamicInvoke(parameters);
+ //Calling the method should change the confirmationValue
+ Assert.AreEqual (confirmationValue, INIT_VALUE * INIT_VALUE);
+ }
+
+ private void oneArgumentCallback(IEvent o)
+ {
+ confirmationValue *= (int)o.data;
+ }
+
+
+ class TestEvent : IEvent
+ {
+ public object Type{ get; set;}
+ public IEventDispatcher Target{ get; set;}
+ public object Data{ get; set;}
+
+
+ public TestEvent(object type, IEventDispatcher target, object data)
+ {
+ this.Type = type;
+ this.Target = target;
+ this.Data = data;
+ }
+
+ public object type{ get{ return Type;} set{ Type = value; }}
+ public IEventDispatcher target{ get { return Target;} set{ Target = value; }}
+ public object data{ get { return Data;} set{ Data = value; }}
+ }
+ }
+}
+
diff --git a/Assets/StrangeIoc/scripts/strange/.tests/extensions/eventdispatcher/TestEventCommand.cs b/Assets/StrangeIoc/scripts/strange/.tests/extensions/eventdispatcher/TestEventCommand.cs
new file mode 100644
index 0000000..e1d44e4
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/strange/.tests/extensions/eventdispatcher/TestEventCommand.cs
@@ -0,0 +1,15 @@
+using System;
+using NUnit.Framework;
+
+namespace strange.unittests
+{
+ [TestFixture()]
+ public class TestEventCommand
+ {
+ [Test()]
+ public void TestCase ()
+ {
+ }
+ }
+}
+
diff --git a/Assets/StrangeIoc/scripts/strange/.tests/extensions/eventdispatcher/TestEventCommandPooling.cs b/Assets/StrangeIoc/scripts/strange/.tests/extensions/eventdispatcher/TestEventCommandPooling.cs
new file mode 100644
index 0000000..5e4556a
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/strange/.tests/extensions/eventdispatcher/TestEventCommandPooling.cs
@@ -0,0 +1,56 @@
+using System;
+using NUnit.Framework;
+using strange.extensions.injector.api;
+using strange.extensions.command.api;
+using strange.framework.api;
+using strange.extensions.command.impl;
+using strange.extensions.injector.impl;
+using strange.extensions.dispatcher.eventdispatcher.impl;
+using strange.extensions.dispatcher.eventdispatcher.api;
+using strange.extensions.dispatcher.api;
+using strange.extensions.context.api;
+
+namespace strange.unittests
+{
+ [TestFixture()]
+ public class TestEventCommandPooling
+ {
+ IInjectionBinder injectionBinder;
+ ICommandBinder commandBinder;
+ IEventDispatcher dispatcher;
+
+ [SetUp]
+ public void SetUp()
+ {
+ CommandThrowsErrorIfEventIsNull.result = 0;
+ CommandThrowsErrorIfEventIsNull.timesExecuted = 0;
+
+ injectionBinder = new InjectionBinder();
+ injectionBinder.Bind ().Bind ().ToValue (injectionBinder);
+ injectionBinder.Bind ().To ().ToSingleton ();
+ injectionBinder.Bind ().To ().ToSingleton ().ToName(ContextKeys.CONTEXT_DISPATCHER);
+
+ commandBinder = injectionBinder.GetInstance ();
+ dispatcher = injectionBinder.GetInstance (ContextKeys.CONTEXT_DISPATCHER);
+ (dispatcher as ITriggerProvider).AddTriggerable (commandBinder as ITriggerable);
+ }
+
+
+
+ [Test]
+ public void TestEventPoolingInCommandSequence()
+ {
+ commandBinder.Bind(SomeEnum.ONE).To().To().To().InSequence();
+ dispatcher.Dispatch (SomeEnum.ONE, 100);
+
+ Assert.AreEqual (3, CommandThrowsErrorIfEventIsNull.timesExecuted);
+ Assert.AreEqual (100 * 2, CommandThrowsErrorIfEventIsNull.result);
+
+ //Events should have been returned to pool
+ int itemsDedicated = EventDispatcher.eventPool.instanceCount - EventDispatcher.eventPool.available;
+
+ Assert.AreEqual (0, itemsDedicated);
+ }
+ }
+}
+
diff --git a/Assets/StrangeIoc/scripts/strange/.tests/extensions/eventdispatcher/TestEventDispatcher.cs b/Assets/StrangeIoc/scripts/strange/.tests/extensions/eventdispatcher/TestEventDispatcher.cs
new file mode 100644
index 0000000..07d142d
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/strange/.tests/extensions/eventdispatcher/TestEventDispatcher.cs
@@ -0,0 +1,185 @@
+using System;
+using NUnit.Framework;
+using strange.extensions.dispatcher.api;
+using strange.extensions.dispatcher.eventdispatcher.api;
+using strange.extensions.dispatcher.eventdispatcher.impl;
+
+
+namespace strange.unittests
+{
+ [TestFixture()]
+ public class TestEventDispatcher
+ {
+ IEventDispatcher dispatcher;
+ private const int INIT_VALUE = 42;
+ private const int INCREMENT = 4;
+ private const int PAYLOAD = 8;
+ private int confirmationValue = 42;
+
+ [SetUp]
+ public void SetUp()
+ {
+ dispatcher = new EventDispatcher ();
+ }
+
+ [Test]
+ public void TestAddListenerNoArgs ()
+ {
+ dispatcher.AddListener (SomeEnum.ONE, noArgumentsMethod);
+ Assert.IsTrue (dispatcher.HasListener(SomeEnum.ONE, noArgumentsMethod));
+ }
+
+ [Test]
+ public void TestAddListenerOneArg ()
+ {
+ dispatcher.AddListener (SomeEnum.ONE, oneArgumentMethod);
+ Assert.IsTrue (dispatcher.HasListener(SomeEnum.ONE, oneArgumentMethod));
+ }
+
+ [Test]
+ public void TestRemoveListenerNoArgs()
+ {
+ dispatcher.AddListener (SomeEnum.ONE, noArgumentsMethod);
+ dispatcher.RemoveListener (SomeEnum.ONE, noArgumentsMethod);
+ Assert.IsFalse (dispatcher.HasListener(SomeEnum.ONE, noArgumentsMethod));
+ }
+
+ [Test]
+ public void TestRemoveListenerOneArg()
+ {
+ dispatcher.AddListener (SomeEnum.ONE, oneArgumentMethod);
+ dispatcher.RemoveListener (SomeEnum.ONE, oneArgumentMethod);
+ Assert.IsFalse (dispatcher.HasListener(SomeEnum.ONE, oneArgumentMethod));
+ }
+
+ [Test]
+ public void TestUpdateListenerNoArgs()
+ {
+ dispatcher.UpdateListener (true, SomeEnum.ONE, noArgumentsMethod);
+ Assert.IsTrue (dispatcher.HasListener(SomeEnum.ONE, noArgumentsMethod));
+ dispatcher.UpdateListener (false, SomeEnum.ONE, noArgumentsMethod);
+ Assert.IsFalse (dispatcher.HasListener(SomeEnum.ONE, noArgumentsMethod));
+ }
+
+ [Test]
+ public void TestUpdateListenerOneArg()
+ {
+ dispatcher.UpdateListener (true, SomeEnum.ONE, oneArgumentMethod);
+ Assert.IsTrue (dispatcher.HasListener(SomeEnum.ONE, oneArgumentMethod));
+ dispatcher.UpdateListener (false, SomeEnum.ONE, oneArgumentMethod);
+ Assert.IsFalse (dispatcher.HasListener(SomeEnum.ONE, oneArgumentMethod));
+ }
+
+ [Test]
+ public void TestDispatchNoArgs()
+ {
+ confirmationValue = INIT_VALUE;
+ dispatcher.UpdateListener (true, SomeEnum.ONE, noArgumentsMethod);
+ dispatcher.Dispatch (SomeEnum.ONE);
+ Assert.AreEqual (INIT_VALUE + INCREMENT, confirmationValue);
+ }
+
+ [Test]
+ public void TestDispatchOneArg()
+ {
+ confirmationValue = INIT_VALUE;
+ dispatcher.UpdateListener (true, SomeEnum.ONE, oneArgumentMethod);
+ dispatcher.Dispatch (SomeEnum.ONE, PAYLOAD);
+ Assert.AreEqual (INIT_VALUE + PAYLOAD, confirmationValue);
+ }
+
+ [Test]
+ public void TestMultipleListeners()
+ {
+ confirmationValue = INIT_VALUE;
+ dispatcher.AddListener (SomeEnum.ONE, noArgumentsMethod);
+ dispatcher.AddListener (SomeEnum.ONE, oneArgumentMethod);
+ dispatcher.Dispatch (SomeEnum.ONE, PAYLOAD);
+
+ Assert.AreEqual(INIT_VALUE + PAYLOAD + INCREMENT, confirmationValue);
+ }
+
+ [Test]
+ public void TestTriggerClientRemoval()
+ {
+ Assert.AreEqual (0, (dispatcher as ITriggerProvider).Triggerables);
+
+ EventDispatcher anotherDispatcher1 = new EventDispatcher ();
+ (dispatcher as ITriggerProvider).AddTriggerable (anotherDispatcher1);
+
+ Assert.AreEqual (1, (dispatcher as ITriggerProvider).Triggerables);
+
+ EventDispatcher anotherDispatcher2 = new EventDispatcher ();
+ (dispatcher as ITriggerProvider).AddTriggerable (anotherDispatcher2);
+
+ Assert.AreEqual (2, (dispatcher as ITriggerProvider).Triggerables);
+
+ dispatcher.AddListener (SomeEnum.ONE, removeTriggerClientMethod);
+ dispatcher.Dispatch (SomeEnum.ONE, anotherDispatcher1);
+
+ Assert.AreEqual (1, (dispatcher as ITriggerProvider).Triggerables);
+
+ dispatcher.AddListener (SomeEnum.ONE, removeTriggerClientMethod);
+ dispatcher.Dispatch (SomeEnum.ONE, anotherDispatcher2);
+
+ Assert.AreEqual (0, (dispatcher as ITriggerProvider).Triggerables);
+ }
+
+ private void removeTriggerClientMethod(IEvent evt)
+ {
+ EventDispatcher target = evt.data as EventDispatcher;
+ (dispatcher as ITriggerProvider).RemoveTriggerable (target);
+ }
+
+ [Test]
+ public void TestBadlyFormedCallback()
+ {
+ confirmationValue = INIT_VALUE;
+ dispatcher.AddListener (SomeEnum.ONE, badArgumentMethod);
+
+ TestDelegate testDelegate = delegate() {
+ dispatcher.Dispatch (SomeEnum.ONE, PAYLOAD);
+ };
+
+ EventDispatcherException ex = Assert.Throws (testDelegate);
+ Assert.That (ex.type == EventDispatcherExceptionType.TARGET_INVOCATION);
+ }
+
+ [Test]
+ public void TestMidpointRemoval()
+ {
+ confirmationValue = INIT_VALUE;
+ dispatcher.AddListener (SomeEnum.ONE, interruptMethod);
+ dispatcher.AddListener (SomeEnum.ONE, noArgumentsMethod);
+
+ dispatcher.Dispatch (SomeEnum.ONE);
+
+ Assert.AreEqual (INIT_VALUE, confirmationValue);
+ }
+
+ private void noArgumentsMethod()
+ {
+ confirmationValue += INCREMENT;
+ }
+
+ private void oneArgumentMethod(IEvent evt)
+ {
+ int data = (int)evt.data;
+
+ confirmationValue += data;
+ }
+
+ private void badArgumentMethod(object payload)
+ {
+ int data = (int)payload;
+
+ confirmationValue += data;
+ }
+
+ private void interruptMethod()
+ {
+ dispatcher.RemoveListener (SomeEnum.ONE, noArgumentsMethod);
+ }
+ }
+}
+
diff --git a/Assets/StrangeIoc/scripts/strange/.tests/extensions/injector/InjectionSpeedTest.cs b/Assets/StrangeIoc/scripts/strange/.tests/extensions/injector/InjectionSpeedTest.cs
new file mode 100644
index 0000000..2d6acdc
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/strange/.tests/extensions/injector/InjectionSpeedTest.cs
@@ -0,0 +1,43 @@
+/**
+ * Technically this is not a unit test. Rather, it's a
+ * development tool to rate the value of the Reflector extension.
+ *
+ * This scenario measured 64ms with the ReflectionBinder, 302ms without.
+ */
+
+using System;
+using NUnit.Framework;
+using strange.extensions.injector.api;
+using strange.extensions.injector.impl;
+using System.Diagnostics;
+
+namespace strange.unittests
+{
+ [TestFixture()]
+ public class InjectionSpeedTest
+ {
+ [Test]
+ public void TestALotOfInstances ()
+ {
+ IInjectionBinder injectionBinder = new InjectionBinder ();
+ injectionBinder.Bind ().To ();
+ injectionBinder.Bind ().To (42);
+ injectionBinder.Bind ().To();
+
+ Stopwatch stopwatch = new Stopwatch ();
+ stopwatch.Start ();
+
+ int aa = 1000;
+ for (int a = 0; a < aa; a++)
+ {
+ injectionBinder.GetInstance ();
+ }
+
+ stopwatch.Stop ();
+
+ //Uncomment this if you want to run the speed test.
+ //throw new InjectionException ("The test took " + stopwatch.ElapsedMilliseconds + " ms.", InjectionExceptionType.NO_REFLECTOR);
+ }
+ }
+}
+
diff --git a/Assets/StrangeIoc/scripts/strange/.tests/extensions/injector/TestImplicitBinding.cs b/Assets/StrangeIoc/scripts/strange/.tests/extensions/injector/TestImplicitBinding.cs
new file mode 100644
index 0000000..efe21fb
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/strange/.tests/extensions/injector/TestImplicitBinding.cs
@@ -0,0 +1,613 @@
+using System;
+using NUnit.Framework;
+using strange.extensions.context.impl;
+using strange.extensions.injector.impl;
+using strange.extensions.injector.api;
+using strange.unittests.annotated.multipleInterfaces;
+using strange.unittests.annotated.namespaceTest.one;
+using strange.unittests.annotated.namespaceTest.three.even.farther;
+using strange.unittests.annotated.namespaceTest.two.far;
+using strange.unittests.annotated.testConcreteNamed;
+using strange.unittests.annotated.testImplBy;
+using strange.unittests.annotated.testImplements;
+using strange.unittests.annotated.testConcrete;
+using strange.unittests.annotated.testCrossContextInterface;
+using strange.unittests.annotated.testImplTwo;
+using strange.unittests.testimplicitbindingnamespace;
+using System.Collections.Generic;
+
+namespace strange.unittests
+{
+ [TestFixture]
+ public class TestImplicitBinding
+ {
+
+ private MockContext context;
+ private object contextView;
+
+ [SetUp]
+ public void setup()
+ {
+ Context.firstContext = null;
+ contextView = new object();
+ context = new MockContext(contextView, true);
+ }
+
+ ///
+ /// Tests our Implements default case, which is a concrete singleton binding
+ ///
+ [Test]
+ public void TestImplementsConcrete()
+ {
+
+ context.ScannedPackages = new string[]{
+ "strange.unittests.annotated.testConcrete"
+ };
+ context.Start();
+
+ TestConcreteClass testConcreteClass = context.injectionBinder.GetInstance() as TestConcreteClass;
+ Assert.IsNotNull(testConcreteClass);
+
+ }
+
+ [Test]
+ public void TestImplementsNamedConcrete()
+ {
+ context.ScannedPackages = new string[]{
+ "strange.unittests.annotated.testConcreteNamed"
+ };
+ context.Start();
+
+ TestConcreteNamedClass testConcreteClass = context.injectionBinder.GetInstance("NAME") as TestConcreteNamedClass;
+ Assert.IsNotNull(testConcreteClass);
+ }
+
+ ///
+ /// Test binding a concrete class to an interface using the Implements tag
+ ///
+ [Test]
+ public void TestImplementsToInterface()
+ {
+ context.ScannedPackages = new string[]{
+ "strange.unittests.annotated.testImplements"
+ };
+ context.Start();
+
+ TestInterface testImpl = context.injectionBinder.GetInstance() as TestInterface;
+ Assert.IsNotNull(testImpl);
+ Assert.IsTrue(typeof(TestInterface).IsAssignableFrom(testImpl.GetType())); //Check that this objects type implements test interface.
+ Assert.AreEqual(testImpl.GetType(),typeof(TestImpl)); //Check that its the type we added below
+ }
+
+
+ ///
+ /// Test binding a default concrete class to an interface using the ImplementedBy tag (on the interface)
+ ///
+ [Test]
+ public void TestImplementedBy()
+ {
+ context.ScannedPackages = new string[]{
+ "strange.unittests.annotated.testImplBy" //Namespace is the only true difference. Same tests as above for the same action done by a different method
+ };
+ context.Start();
+
+ TestInterface testImpl = context.injectionBinder.GetInstance() as TestInterface;
+ Assert.IsNotNull(testImpl);
+ Assert.IsTrue(typeof(TestInterface).IsAssignableFrom(testImpl.GetType())); //Check that this objects type implements test interface.
+ Assert.AreEqual(testImpl.GetType(), typeof(TestImpl)); //Check that its the type we added below
+ }
+
+ ///
+ /// Bind via an ImplementedBy tag, followed by an Implements from a different class.
+ /// Implements should override the ImplementedBy tag
+ ///
+ [Test]
+ public void TestImplementsOverridesImplementedBy()
+ {
+ context.ScannedPackages = new string[]{
+ "strange.unittests.annotated.testImplTwo",
+ "strange.unittests.annotated.testImplBy",
+ };
+
+ context.Start();
+
+
+ TestInterface testInterface = context.injectionBinder.GetInstance() as TestInterface;
+ Assert.True(testInterface is TestImplTwo);
+ }
+
+ ///
+ /// Bind implicitly and then overwrite with an explicit binding
+ ///
+ [Test]
+ public void TestExplicitBindingOverrides()
+ {
+ context.ScannedPackages = new string[]{
+ "strange.unittests.annotated.testImplements",
+ };
+
+ context.Start();
+
+
+ TestInterface testInterfacePre = context.injectionBinder.GetInstance() as TestInterface;
+ Assert.True(testInterfacePre is TestImpl);
+ //Confirm the previous binding is the implicit binding as expected
+
+ context.injectionBinder.Bind().To();
+ TestInterface testInterfacePost = context.injectionBinder.GetInstance() as TestInterface;
+ Assert.True(testInterfacePost is TestImplTwo);
+ //Confirm the new binding is the one we just wrote
+ }
+
+ ///
+ /// Attempt to bind an ImplementedBy annotation pointing to a Type which does not implement the interface
+ ///
+ [Test]
+ public void TestDoesNotImplement()
+ {
+ context.ScannedPackages = new string[]{
+ "strange.unittests.annotated.testDoesntImplement",
+ };
+
+ TestDelegate testDelegate = delegate
+ {
+ context.Start();
+ };
+
+ //We should be getting an exception here because the interface is not implemented
+ InjectionException ex = Assert.Throws(testDelegate);
+
+ //make sure it's the right exception
+ Assert.AreEqual(ex.type, InjectionExceptionType.IMPLICIT_BINDING_IMPLEMENTOR_DOES_NOT_IMPLEMENT_INTERFACE);
+ }
+
+
+ ///
+ /// Attempt to bind an Implements annotation pointing to an interface it does not implement
+ ///
+ [Test]
+ public void TestDoesNotImplementTwo()
+ {
+ context.ScannedPackages = new string[]{
+ "strange.unittests.annotated.testDoesntImplementTwo",
+ };
+
+ TestDelegate testDelegate = delegate
+ {
+ context.Start();
+ };
+
+ //We should be getting an exception here because the interface is not implemented
+ InjectionException ex = Assert.Throws(testDelegate);
+
+ //make sure it's the right exception
+ Assert.AreEqual(ex.type, InjectionExceptionType.IMPLICIT_BINDING_TYPE_DOES_NOT_IMPLEMENT_DESIGNATED_INTERFACE);
+ }
+
+ ///
+ /// Test [CrossContextComponent] tag.
+ /// This is not meant to be a test of all crosscontext functionality, just the tag
+ /// The CrossContextComponent tag really just tells a binding to call .CrossContext()
+ /// See TestCrossContext for tests of CrossContext
+ ///
+ [Test]
+ public void TestCrossContextImplicit()
+ {
+ object viewParent = new object();
+ object viewChildOne = new object();
+ object viewChildTwo = new object();
+ MockContext Parent = new MockContext(viewParent, true);
+ MockContext ChildOne = new MockContext(viewChildOne, true); //Ctr will automatically add to Context.firstcontext. No need to call it manually (and you should not).
+ MockContext ChildTwo = new MockContext(viewChildTwo, true);
+
+
+ Parent.ScannedPackages = new string[]{
+ "strange.unittests.annotated.testCrossContext"
+ };
+
+ Parent.Start();
+ ChildOne.Start();
+ ChildTwo.Start();
+
+ TestCrossContextInterface parentModel = Parent.injectionBinder.GetInstance() as TestCrossContextInterface;
+
+ TestCrossContextInterface childOneModel = ChildOne.injectionBinder.GetInstance() as TestCrossContextInterface;
+ Assert.IsNotNull(childOneModel);
+ TestCrossContextInterface childTwoModel = ChildTwo.injectionBinder.GetInstance() as TestCrossContextInterface;
+ Assert.IsNotNull(childTwoModel);
+ Assert.AreSame(childOneModel, childTwoModel); //These two should be the same object
+
+ Assert.AreEqual(0, parentModel.Value); //start at 0, might as well verify.
+
+ parentModel.Value++;
+ Assert.AreEqual(1, childOneModel.Value); //child one is updated
+
+ parentModel.Value++;
+ Assert.AreEqual(2, childTwoModel.Value); //child two is updated
+ }
+
+
+ ///
+ /// Test [CrossContextComponent] tag.
+ /// Child contexts should be able to 'override' Cross-Context bindings with local bindings
+ ///
+ [Test]
+ public void TestCrossContextAllowsOverrides()
+ {
+ object viewParent = new object();
+ object viewChildOne = new object();
+ object viewChildTwo = new object();
+ MockContext Parent = new MockContext(viewParent, true);
+ MockContext ChildOne = new MockContext(viewChildOne, true); //Ctr will automatically add to Context.firstcontext. No need to call it manually (and you should not).
+ MockContext ChildTwo = new MockContext(viewChildTwo, true);
+
+
+ Parent.ScannedPackages = new string[]{
+ "strange.unittests.annotated.testCrossContext"
+ };
+
+ ChildOne.ScannedPackages = new string[]{
+ "strange.unittests.annotated.testCrossOverride"
+ };
+ Parent.Start();
+ ChildOne.Start();
+ ChildTwo.Start();
+
+ TestCrossContextInterface parentModel = Parent.injectionBinder.GetInstance() as TestCrossContextInterface;
+ //Get the instance from the parent injector (The cross context binding)
+
+ TestCrossContextInterface childOneModel = ChildOne.injectionBinder.GetInstance() as TestCrossContextInterface;
+ Assert.AreNotSame(childOneModel, parentModel); //The value from getinstance is NOT the same as the cross context value. We have overidden the cross context value locally
+
+ TestCrossContextInterface childTwoModel = ChildTwo.injectionBinder.GetInstance() as TestCrossContextInterface;
+ Assert.IsNotNull(childTwoModel);
+ Assert.AreNotSame(childOneModel, childTwoModel); //These two are different objects, the childTwoModel being cross context, and childone being the override
+ Assert.AreSame(parentModel, childTwoModel); //Both cross context models are the same
+
+
+ parentModel.Value++;
+ Assert.AreEqual(1, childTwoModel.Value); //cross context model should be changed
+
+ parentModel.Value++;
+ Assert.AreEqual(1000, childOneModel.Value); //local model is not changed
+
+
+ Assert.AreEqual(2, parentModel.Value); //cross context model is changed
+ }
+
+ ///
+ /// Test that rescanning the same binding does not override a value
+ /// Smaller piece of below test.
+ ///
+ [Test]
+ public void TestRescanDoesNotOverrideCrossContextValue()
+ {
+ object mockGameObject = new object();
+ TestImplicitBindingContext context = new TestImplicitBindingContext(mockGameObject);
+
+ //Get our binding. It should have value of Runtime Type. It hasn't been instantiated yet.
+ IInjectionBinding binding = context.injectionBinder.GetBinding();
+ Assert.IsTrue(binding.value is Type);
+
+ //GetInstance. This should set the value to the instantiated class
+ TestImplicitBindingClass instanceValue = context.injectionBinder.GetInstance();
+ Assert.IsNotNull(instanceValue);
+ IInjectionBinding bindingAfterGetInstance = context.injectionBinder.GetBinding();
+ Assert.IsTrue(bindingAfterGetInstance.value is TestImplicitBindingClass);
+ Assert.AreSame(bindingAfterGetInstance, binding);
+
+ //Rescan our implicit bindings
+ //Our binding value should remain
+ context.Scan();
+ IInjectionBinding bindingAfterRescan = context.injectionBinder.GetBinding();
+ Assert.AreSame(bindingAfterRescan, binding); //Should be the same binding, and not override it
+
+ Assert.IsTrue(bindingAfterRescan.value is TestImplicitBindingClass);
+ Assert.AreSame(bindingAfterRescan.value, instanceValue);
+
+
+ }
+
+ //This monster "unit" test confirms that implicit bindings
+ //correctly maintain integrity across Context boundaries.
+ [Test]
+ public void TestMultipleCrossContextImplicitBindings()
+ {
+ TestImplicitBindingClass.instantiationCount = 0;
+
+ int contextsBeforeInstancing = 3;
+ int contextsAfterInstancing = 4;
+ int contextsToCreate = contextsBeforeInstancing + contextsAfterInstancing;
+ int getInstanceCallsPerContext = 3;
+ int injectsPerContext = 3;
+ List contexts = new List();
+ IInjectionBinding bindingBeforeContextCreation = null;
+ object bindingValueBeforeContextCreation = null;
+
+ //We create several Contexts.
+ //note contextNumber is 1-based
+ for (int contextNumber = 1; contextNumber <= contextsToCreate; contextNumber++)
+ {
+ //The first batch of Contexts don't actually create instances, just the implicit bindings
+ bool toInstance = (contextNumber > contextsBeforeInstancing);
+ //Specifically call out the Context that is first to create actual instances
+ bool isFirstContextToCallGetInstance = (contextNumber == (contextsBeforeInstancing + 1));
+
+ //Create each "ContextView" and its Context
+ object mockGameObject = new object ();
+
+ TestImplicitBindingContext context = new TestImplicitBindingContext (mockGameObject);
+ contexts.Add (context);
+
+ //For each Context, check that the TestImplicitBindingClass BINDING exists (no instance created yet)
+ IInjectionBinding bindingAfterContextCreation = context.injectionBinder.GetBinding ();
+ object bindingValueAfterContextCreation = bindingAfterContextCreation.value;
+
+ bool bindingChangedDueToContextCreation = !bindingAfterContextCreation.Equals(bindingBeforeContextCreation);
+ bool bindingValueChangedDueToContextCreation = bindingValueAfterContextCreation != bindingValueBeforeContextCreation;
+
+
+ //due to the weak binding replacement rules, the binding should change every time we scan until we instance
+ Assert.IsFalse (bindingChangedDueToContextCreation && toInstance && !isFirstContextToCallGetInstance);
+
+ //after creating a new context, the value of the binding should only change on the first context
+ //(it was null before that)
+ Assert.IsFalse (bindingValueChangedDueToContextCreation && contextNumber != 1);
+
+
+ if (toInstance)
+ {
+ //For the Contexts that actually create instances...
+ for (int a = 0; a < getInstanceCallsPerContext; a++)
+ {
+ //...create some instances (well, duh) of the TestImplicitBindingClass...
+ TestImplicitBindingClass instance = context.injectionBinder.GetInstance ();
+ Assert.IsNotNull (instance);
+ }
+
+ for (int b = 0; b < injectsPerContext; b++)
+ {
+ //...and some instances of the class that gets injected with TestImplicitBindingClass.
+ TestImplicitBindingInjectionReceiver instance = context.injectionBinder.GetInstance ();
+ Assert.IsNotNull (instance);
+ Assert.IsNotNull (instance.testImplicitBindingClass);
+ }
+
+ }
+
+ //We inspect the binding and its value after all this mapping/instantiation
+ IInjectionBinding bindingAfterGetInstanceCalls = context.injectionBinder.GetBinding ();
+ object bindingValueAfterGetInstanceCalls = bindingAfterGetInstanceCalls.value;
+
+ bool bindingChangedDueToGetInstanceCalls = bindingAfterGetInstanceCalls != bindingAfterContextCreation;
+ bool bindingValueChangedDueToGetInstanceCalls = bindingValueAfterGetInstanceCalls != bindingValueAfterContextCreation;
+
+ //the binding itself should only change during the scan
+ Assert.IsFalse (bindingChangedDueToGetInstanceCalls);
+
+ //if the weak binding replacement rules are working, the only time the value should
+ //change is the first time we call GetInstance
+ Assert.IsFalse (bindingValueChangedDueToGetInstanceCalls && !isFirstContextToCallGetInstance);
+
+ //reset values for the next pass
+ bindingBeforeContextCreation = bindingAfterGetInstanceCalls;
+ bindingValueBeforeContextCreation = bindingValueAfterGetInstanceCalls;
+ }
+
+ //This is a Cross-Context Singleton.
+ //The primary purpose of this test is to ensure (that under the circumstances of this test),
+ //TestImplicitBindingClass should only get instantiated once
+ Assert.AreEqual (1, TestImplicitBindingClass.instantiationCount);
+ }
+
+ ///
+ /// Test that our assumptions regarding namespace scoping are correct
+ /// (e.g. company.project.feature will include company.project.feature.signal)
+ ///
+ [Test]
+ public void TestNamespaces()
+ {
+ context.ScannedPackages = new string[]{
+ "strange.unittests.annotated.namespaceTest"
+ };
+ context.Start();
+
+ //Should bind 3 classes concretely in the
+ TestNamespaceOne one = context.injectionBinder.GetInstance() as TestNamespaceOne;
+ Assert.NotNull(one);
+
+ TestNamespaceTwo two = context.injectionBinder.GetInstance() as TestNamespaceTwo;
+ Assert.NotNull(two);
+
+ TestNamespaceThree three = context.injectionBinder.GetInstance() as TestNamespaceThree;
+ Assert.NotNull(three);
+ }
+
+ [Test]
+ public void TestMultipleImplements()
+ {
+ context.ScannedPackages = new string[]{
+ "strange.unittests.annotated.multipleInterfaces"
+ };
+ context.Start();
+
+ TestInterfaceOne one = context.injectionBinder.GetInstance() as TestInterfaceOne;
+ Assert.NotNull(one);
+
+ TestInterfaceTwo two = context.injectionBinder.GetInstance() as TestInterfaceTwo;
+ Assert.NotNull(two);
+
+ TestInterfaceThree three = context.injectionBinder.GetInstance() as TestInterfaceThree;
+ Assert.NotNull(three);
+
+ Assert.AreEqual(one, two);
+ Assert.AreEqual(one, three);
+ }
+
+ [Test]
+ public void TestParamsScannedPackages()
+ {
+ context.Start();
+ context.ScanForAnnotatedClasses("strange.unittests.annotated.testConcrete", "strange.unittests.annotated.testImplTwo", "strange.unittests.annotated.testImplBy");
+
+ var testConcrete = context.injectionBinder.GetInstance();
+ Assert.IsNotNull(testConcrete);
+
+ TestInterface testInterface = context.injectionBinder.GetInstance();
+ Assert.True(testInterface is TestImplTwo);
+ }
+ }
+
+
+}
+
+namespace strange.unittests.annotated.testConcrete
+{
+ [Implements]
+ public class TestConcreteClass { }
+}
+
+namespace strange.unittests.annotated.testConcreteNamed
+{
+ [Implements(InjectionBindingScope.SINGLE_CONTEXT, "NAME")]
+ public class TestConcreteNamedClass { }
+}
+
+namespace strange.unittests.annotated.testImplBy
+{
+ [ImplementedBy(typeof(TestImpl))]
+ public interface TestInterface { }
+}
+
+namespace strange.unittests.annotated.testImplements
+{
+ [Implements(typeof(TestInterface))]
+ public class TestImpl : TestInterface { }
+}
+
+namespace strange.unittests.annotated.testImplTwo
+{
+ [Implements(typeof(TestInterface))]
+ public class TestImplTwo : TestInterface { }
+}
+
+namespace strange.unittests.annotated.testDoesntImplement
+{
+ [ImplementedBy(typeof(TestClassDoesntImplement))]
+ public interface TestInterfaceDoesntImplement { }
+
+ public class TestClassDoesntImplement { }
+}
+
+namespace strange.unittests.annotated.testDoesntImplementTwo
+{
+ public interface TestInterfaceDoesntImplement { }
+
+ [Implements(typeof(TestInterfaceDoesntImplement))]
+ public class TestClassDoesntImplement { }
+}
+
+namespace strange.unittests.annotated.testCrossContextInterface
+{
+ public interface TestCrossContextInterface
+ {
+ int Value { get; set; }
+ }
+}
+namespace strange.unittests.annotated.testCrossContext
+{
+ [Implements(typeof(TestCrossContextInterface), InjectionBindingScope.CROSS_CONTEXT)]
+ public class TestConcreteCrossContextClass : TestCrossContextInterface
+ {
+ public TestConcreteCrossContextClass()
+ {
+ Value = 0;
+ }
+ public int Value { get; set; }
+ }
+}
+
+namespace strange.unittests.annotated.testCrossOverride
+{
+ [Implements(typeof(TestCrossContextInterface))]
+ public class TestConcreteCrossContextClassOverride : TestCrossContextInterface
+ {
+ public TestConcreteCrossContextClassOverride()
+ {
+ Value = 1000;
+ }
+ public int Value { get; set; }
+ }
+}
+
+namespace strange.unittests.annotated.namespaceTest.one
+{
+ [Implements]
+ public class TestNamespaceOne {}
+}
+
+namespace strange.unittests.annotated.namespaceTest.two.far
+{
+ [Implements]
+ public class TestNamespaceTwo {}
+}
+
+namespace strange.unittests.annotated.namespaceTest.three.even.farther
+{
+ [Implements]
+ public class TestNamespaceThree {}
+}
+
+namespace strange.unittests.annotated.multipleInterfaces
+{
+
+ public interface TestInterfaceOne {}
+ public interface TestInterfaceTwo { }
+ public interface TestInterfaceThree { }
+
+ [Implements(typeof(TestInterfaceOne))]
+ [Implements(typeof(TestInterfaceTwo))]
+ [Implements(typeof(TestInterfaceThree))]
+ public class TestMultipleImplementer : TestInterfaceOne, TestInterfaceTwo, TestInterfaceThree
+ {
+
+ }
+
+}
+
+namespace strange.unittests.testimplicitbindingnamespace
+{
+ public class TestImplicitBindingContext : MockContext
+ {
+ public TestImplicitBindingContext(object contextView) : base(contextView){}
+ protected override void mapBindings()
+ {
+ base.mapBindings();
+
+ Scan();
+ injectionBinder.Bind().ToSingleton();
+ }
+
+ public void Scan()
+ {
+ implicitBinder.ScanForAnnotatedClasses(new string[] { "strange.unittests.testimplicitbindingnamespace" });
+ }
+ }
+
+
+ public class TestImplicitBindingInjectionReceiver
+ {
+ [Inject]
+ public TestImplicitBindingClass testImplicitBindingClass{get;set;}
+ }
+
+ [Implements(InjectionBindingScope.CROSS_CONTEXT)]
+ public class TestImplicitBindingClass
+ {
+ public static int instantiationCount = 0;
+ public TestImplicitBindingClass()
+ {
+ ++instantiationCount;
+ }
+ }
+}
diff --git a/Assets/StrangeIoc/scripts/strange/.tests/extensions/injector/TestInjectionBinder.cs b/Assets/StrangeIoc/scripts/strange/.tests/extensions/injector/TestInjectionBinder.cs
new file mode 100644
index 0000000..343c6c4
--- /dev/null
+++ b/Assets/StrangeIoc/scripts/strange/.tests/extensions/injector/TestInjectionBinder.cs
@@ -0,0 +1,913 @@
+using System;
+using NUnit.Framework;
+using strange.extensions.injector.api;
+using strange.extensions.injector.impl;
+using strange.extensions.reflector.api;
+using strange.extensions.pool.api;
+using strange.extensions.pool.impl;
+using strange.framework.api;
+using System.Collections.Generic;
+using strange.framework.impl;
+
+namespace strange.unittests
+{
+ [TestFixture()]
+ public class TestinjectionBinder
+ {
+ IInjectionBinder binder;
+
+ [SetUp]
+ public void SetUp()
+ {
+ binder = new InjectionBinder ();
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ PostConstructSimple.PostConstructCount = 0;
+ }
+
+ [Test]
+ public void TestInjectorExists()
+ {
+ Assert.That (binder.injector != null);
+ }
+
+ [Test]
+ public void TestGetBindingFlat ()
+ {
+ binder.Bind ().To ();
+ IInjectionBinding binding = binder.GetBinding ();
+ Assert.IsNotNull (binding);
+ }
+
+ [Test]
+ public void TestGetBindingAbstract ()
+ {
+ binder.Bind ().To ();
+ IInjectionBinding binding = binder.GetBinding ();
+ Assert.IsNotNull (binding);
+ }
+
+ [Test]
+ public void TestGetNamedBinding ()
+ {
+ binder.Bind ().To ().ToName();
+ IInjectionBinding binding = binder.GetBinding (typeof(MarkerClass));
+ Assert.IsNotNull (binding);
+ }
+
+ [Test]
+ public void TestGetInstance1()
+ {
+ binder.Bind ().To ();
+
+ ClassToBeInjected instance = binder.GetInstance (typeof(ClassToBeInjected)) as ClassToBeInjected;
+
+ Assert.IsNotNull (instance);
+ Assert.That (instance is ClassToBeInjected);
+ }
+
+ [Test]
+ public void TestGetInstance2()
+ {
+ binder.Bind ().To ();
+
+ ClassToBeInjected instance = binder.GetInstance ();
+
+ Assert.IsNotNull (instance);
+ Assert.That (instance is ClassToBeInjected);
+ }
+
+ [Test]
+ public void TestGetNamedInstance1()
+ {
+ binder.Bind ().To ().ToName();
+
+ ClassToBeInjected instance = binder.GetInstance (typeof(ClassToBeInjected), typeof(MarkerClass)) as ClassToBeInjected;
+
+ Assert.IsNotNull (instance);
+ Assert.That (instance is ClassToBeInjected);
+ }
+
+ [Test]
+ public void TestGetNamedInstance2()
+ {
+ binder.Bind ().To ().ToName();
+
+ ClassToBeInjected instance = binder.GetInstance (typeof(MarkerClass));
+
+ Assert.IsNotNull (instance);
+ Assert.That (instance is ClassToBeInjected);
+ }
+
+ [Test]
+ public void TestGetNamedInstance3()
+ {
+ binder.Bind ().To