Class EnvironmentScript

java.lang.Object
de.gurkenlabs.litiengine.scripting.AbstractScript<Environment>
de.gurkenlabs.litiengine.scripting.EnvironmentScript
All Implemented Interfaces:
ScriptInstance

public abstract class EnvironmentScript extends AbstractScript<Environment>
Base class for scripts attached to one loaded environment.
  • Constructor Details

    • EnvironmentScript

      public EnvironmentScript()
  • Method Details

    • attached

      protected final void attached() throws Exception
      Description copied from class: AbstractScript
      Called after the context is installed and the script becomes active.
      Overrides:
      attached in class AbstractScript<Environment>
      Throws:
      Exception - if initialization fails.
    • detached

      protected final void detached() throws Exception
      Description copied from class: AbstractScript
      Called before context-owned resources are released.
      Overrides:
      detached in class AbstractScript<Environment>
      Throws:
      Exception - if cleanup fails.
    • onLoaded

      protected void onLoaded() throws Exception
      Called after the environment has loaded and is the current world environment.
      Throws:
      Exception
    • onUnloaded

      protected void onUnloaded() throws Exception
      Called when the environment binding is detached during unload.
      Throws:
      Exception
    • onCleared

      protected void onCleared() throws Exception
      Called when the attached environment is cleared while it remains active.
      Throws:
      Exception
    • onEntityAdded

      protected void onEntityAdded(IEntity entity) throws Exception
      Called when an entity is added to the attached environment.
      Throws:
      Exception
    • onEntityRemoved

      protected void onEntityRemoved(IEntity entity) throws Exception
      Called when an entity is removed from the attached environment.
      Throws:
      Exception