Skip to content
Joseph Parker edited this page Apr 13, 2018 · 14 revisions

Answers to basic questions from https://gitter.im/arcadia-unity/Arcadia

Q: Is it okay to use regular old atoms to store state on the top level of a namespace? When Should I use ArcadiaState?

A: (from selfsame) I guess [ArcadiaState's] main feature is the association to a single game object. I'll use normal atoms for any global stuff, and ArcadiaState for :hp etc.

Q: Can I draw Gizmos from the REPL? I'm getting an error about not being in OnSceneDraw...

A: No, you need to draw them from within a :on-draw-gizmos hook

Another option is to use UnityEngine.Debug/Drawline.

Q: Why is my build not working?

This is usually a case of errors showing up during compilation or the built runtime that you didn't encounter during development. You'll want to turn on the development build option so you can see them. You should also double check that all your .dll files made it to the built project (look in Managed_Data)

A common gotcha: you'll need to require clojure.core.server somewhere, as clojureCLR's RT class uses it.

Check for errors during Arcadia>Build>Prepare Export, there's subtle differences between running clj in the editor and compiling for export:

  • play mode is loading files from source, clojure and arcadia and anything you require via hooks or the repl.
  • errors during loading source files will result in partially evaluated namespaces (up to the error)
  • preparing export will attempt to compile every user namespace
  • errors during compilation will prevent a dll from being created (it might even stop the whole compilation process for consecutive sources?)
  • compilation is happening in "edit mode", some Unity API is "play mode" only, so you can get errors from calling it at the top level (like destroying objects), which you wouldn't run into during development.
Clone this wiki locally