Created
October 24, 2014 16:37
-
-
Save nasser/3984fe7dd25983367bb0 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 hooks | |
(:use arcadia.core)) | |
(defmacro invoke-if-bound [sym] | |
`(if-let [~sym ((ns-map '~'user) '~sym)] | |
(~sym))) | |
; via jplur_ ;) | |
(defcomponent Hooks [] | |
(Start [this] | |
(ns user) | |
(require 'user) | |
(invoke-if-bound setup)) | |
(LateUpdate [this] | |
(invoke-if-bound late-update)) | |
(FixedUpdate [this] | |
(invoke-if-bound fixed-update)) | |
(Update [this] | |
(invoke-if-bound update)) | |
(OnGUI [this] | |
(invoke-if-bound gui)) | |
(OnDrawGizmos [this] | |
(invoke-if-bound gizmos)) | |
(OnDrawGizmosSelected [this] | |
(invoke-if-bound gizmos-selected))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment