|
@@ -0,0 +1,55 @@
|
|
|
+<#assign licenseFirst = "/*">
|
|
|
+<#assign licensePrefix = " * ">
|
|
|
+<#assign licenseLast = " */">
|
|
|
+<#include "../Licenses/license-${project.license}.txt">
|
|
|
+
|
|
|
+<#if package?? && package != "">
|
|
|
+package ${package};
|
|
|
+
|
|
|
+</#if>
|
|
|
+import com.jme3.app.Application;
|
|
|
+import com.jme3.app.state.BaseAppState;
|
|
|
+
|
|
|
+/**
|
|
|
+ *
|
|
|
+ * @author ${user}
|
|
|
+ */
|
|
|
+public class ${name} extends BaseAppState {
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void initialize(Application app) {
|
|
|
+ //It is technically safe to do all initialization and cleanup in the
|
|
|
+ //onEnable()/onDisable() methods. Choosing to use initialize() and
|
|
|
+ //cleanup() for this is a matter of performance specifics for the
|
|
|
+ //implementor.
|
|
|
+ //TODO: initialize your AppState, e.g. attach spatials to rootNode
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void cleanup(Application app) {
|
|
|
+ //TODO: clean up what you initialized in the initialize method,
|
|
|
+ //e.g. remove all spatials from rootNode
|
|
|
+ }
|
|
|
+
|
|
|
+ //onEnable()/onDisable() can be used for managing things that should
|
|
|
+ //only exist while the state is enabled. Prime examples would be scene
|
|
|
+ //graph attachment or input listener attachment.
|
|
|
+ @Override
|
|
|
+ protected void onEnable() {
|
|
|
+ //Called when the state is fully enabled, ie: is attached and
|
|
|
+ //isEnabled() is true or when the setEnabled() status changes after the
|
|
|
+ //state is attached.
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void onDisable() {
|
|
|
+ //Called when the state was previously enabled but is now disabled
|
|
|
+ //either because setEnabled(false) was called or the state is being
|
|
|
+ //cleaned up.
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void update(float tpf) {
|
|
|
+ //TODO: implement behavior during runtime
|
|
|
+ }
|
|
|
+}
|