 (def <over> (*TimeLineCursor 0 false))
 
 (defn timeline [fns]
-  (let [current (volatile! (first fns))
-        fns (volatile! (rest fns))
-        ^UnityEngine.MonoBehaviour coro-root -mono-obj
-        ^tween.core.TimeLineCursor cursor (*TimeLineCursor 0 false)]
-    (.StartCoroutine coro-root
-      (reify IEnumerator
-        (MoveNext [this]
-          (when-not panic
+  (when (. Application isPlaying)
+    (let [current (volatile! (first fns))
+          fns (volatile! (rest fns))
+          ^UnityEngine.MonoBehaviour coro-root (mono-obj)
+          ^tween.core.TimeLineCursor cursor (*TimeLineCursor 0 false)]
+      (.StartCoroutine coro-root
+        (reify IEnumerator
+          (MoveNext [this]
+            (when-not panic
+              (try 
+                (set! (.v cursor) (@current))
+                (if (.v cursor) true
+                  (if (do (vreset! current (first @fns) )
+                          (vswap! fns rest) @current)
+                    true
+                    (!TimeLineCursor cursor)
+                    ))
+                (catch Exception e false))))
+          (get_Current [this] (.v cursor))))
+      (fn [] (if @current true false)))))
+
+(defn timeline-1 [fns] (timeline (map #(%) fns)))
+
+(defn array-timeline [^clojure.lang.PersistentHashSet opts
+                      ^|System.Object[]|               fns]
+  (when (. Application isPlaying)
+    (let [cnt (int (dec (.Length fns)))
+          current (volatile! ((aget fns 0)))
+          ^UnityEngine.MonoBehaviour coro-root (mono-obj)
+          ^tween.core.TimeLineCursor cursor (*TimeLineCursor 0 false)]
+      (.StartCoroutine coro-root
+        (reify IEnumerator
+          (MoveNext [this]
             (try 
               (set! (.v cursor) (@current))
               (if (.v cursor) true
-                (if (do (vreset! current (first @fns) )
-                        (vswap! fns rest) @current)
-                  true
-                  (!TimeLineCursor cursor)
-                  ))
-              (catch Exception e false))))
-        (get_Current [this] (.v cursor))))
-    (fn [] (if @current true false))))
-
-(defn timeline-1 [fns] (timeline (map #(%) fns)))
-
-(defn array-timeline [^clojure.lang.PersistentHashSet opts
-                      ^|System.Object[]|               fns]
-  (let [cnt (int (dec (.Length fns)))
-        current (volatile! ((aget fns 0)))
-        ^UnityEngine.MonoBehaviour coro-root -mono-obj
-        ^tween.core.TimeLineCursor cursor (*TimeLineCursor 0 false)]
-    (.StartCoroutine coro-root
-      (reify IEnumerator
-        (MoveNext [this]
-          (try 
-            (set! (.v cursor) (@current))
-            (if (.v cursor) true
-              (if (>= (.i cursor) cnt) 
-                  (if (opts :loop) 
-                    (do (set! (.i cursor) 0)
-                        (vreset! current ((aget fns 0))) true)
-                    (!TimeLineCursor cursor))
-                  (do (set! (.i cursor) (inc (.i cursor)))
-                      (vreset! current ((aget fns (.i cursor))))
-                      @current)))
-            (catch Exception e false)))
-        (get_Current [this] (.v cursor))))
-    (fn [] (.v cursor))))
+                (if (>= (.i cursor) cnt) 
+                    (if (opts :loop) 
+                      (do (set! (.i cursor) 0)
+                          (vreset! current ((aget fns 0))) true)
+                      (!TimeLineCursor cursor))
+                    (do (set! (.i cursor) (inc (.i cursor)))
+                        (vreset! current ((aget fns (.i cursor))))
+                        @current)))
+              (catch Exception e false)))
+          (get_Current [this] (.v cursor))))
+      (fn [] (.v cursor)))))
 
 (defmacro timeline* [& fns]
   (let [[opts fns] ((juxt (comp set filter) remove) keyword? fns)

(ns tween.core
  (:import Vector3 
    [UnityEngine HideFlags GameObject Color Vector4 Vector3 Vector2 Quaternion MonoBehaviour WaitForSeconds Time Mathf]
    [System GC Object]
    [System.Collections IEnumerator])
  (:require 

        (~'if ~'(< (.now cursor) (.duration cursor))
          true
          (~'do 
            ;~@(map #(list (or (-> %1 :pair :vars :r) !Pair-Object) %2) tagmaps pairsyms)
            ;(!TweenCursor ~'cursor)
            nil))))))



