Skip to content

Instantly share code, notes, and snippets.

@sogaiu
Created September 12, 2018 03:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sogaiu/2b107564ad532d1a5023a02d14650f3a to your computer and use it in GitHub Desktop.
Save sogaiu/2b107564ad532d1a5023a02d14650f3a to your computer and use it in GitHub Desktop.
attempt at support for loading multiple scenes in tween/timeline
;; just use DontDestroyOnLoad?
(defn mono-obj []
(if (. Application isPlaying)
(or (if (not (UnityEngine.Object/op_Equality @-mono-obj nil))
@-mono-obj)
(vreset! -mono-obj
(let [o (or (GameObject/Find "tween.core/-mono-obj")
(let [obj (GameObject. "tween.core/-mono-obj")]
(UnityEngine.Object/DontDestroyOnLoad obj)))]
(or (.GetComponent o MonoObj)
(.AddComponent o MonoObj)))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment