Created
May 14, 2014 14:33
-
-
Save nasser/91aa3c392666d32fc1bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns PlainClojureShit | |
(:import | |
(UnityEngine Debug) | |
(UnityEditor EditorGUILayout))) | |
(def happy (atom true)) ;; Multiple instances of this component will SHARE this atom! They should each have their OWN atom! | |
(defn start [this] | |
(Debug/Log "PlainClojureShit is starting")) | |
(defn update [this] | |
(Debug/Log (str "happy is " @happy))) | |
(defn on-mouse-down [this] | |
(reset! happy (not @happy))) | |
(defn on-inspector-gui [this] | |
(Debug/Log (str "on-inspector-gui " @happy)) | |
(let [gui-happy (EditorGUILayout/Toggle "Happy?" @happy nil)] | |
(if (not= gui-happy happy) | |
(do | |
(reset! happy gui-happy) | |
true) | |
false))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment