Documentation for Unity Asset Store version v1.20, v1.22 and v1.30
Summary
The event interface ('
LE_EventInterface' class) of the Multiplatform Runtime Level Editor allows you to implement the required behaviour for your game. Here you define how your data is stored and loaded, which meta data your levels need. The event based interface minimizes the amount of classes that you need to access this way the editor's code is hidden from the code of your game. This approach allows changes in the editor code, without the need for change in your code. In other words the changes that you will need to make in your code after importing an updated version of the level editor are minimal as long as you use the event interface. I will give my best to keep the '
LE_EventInterface' class as static as possible. Below you will find all public members and methods of the '
LE_EventInterface' class explained briefly. For each member or method I will point you to "how to"-articles showing exemplary use cases.
If you want to make UI related changes, for example changing the
left menu or the
level tab buttons, then you should take a look at
this article.
LE_EventInterface.OnSave
This event will be raised in the level editor when the user clicks on the save button. Using this event will allow you to get a serialized version of your level saved in two byte arrays. See
this article for more details.
LE_EventInterface.OnLoad
The Multiplatform Runtime Level Editor provides different mechanics for you to load a level from one or two byte arrays. See
this article for more details. This event will be raised in the level editor when the user clicks on the load button.
LE_EventInterface.OnLoadedLevelInEditor
This event will be raised when all loading is done for a level that is loaded for editing via the LE_LoadEvent callbacks.
LE_EventInterface.OnCollectMetaDataBeforeSave
This event allows you to add additional meta data to your levels. For example the gold medal score could be stored in each level. See
this article for more details.
LE_EventInterface.OnChangeLevelData
This event will be raised after (or during) any change to the currently edited level. For example it will be raised when the terrain or an object is modified. It will also be raised when the level icon is rendered.
LE_EventInterface.OnObjectSelectedInScene
This event will be raised when an object is selected in the scene by being clicked/touched or through duplicating an object.
Added in v1.22.
LE_EventInterface.OnObjectPlaced
This event will be raised when an object is placed through drag and drop or after duplicating an object. See
this article for more details.
LE_EventInterface.OnObjectDragged
This event will be raised when an object is about to be placed through drag and drop. This event is called in every frame in which an object is dragged over something by the player. You can use this event to allow or disallow object placement of a specific level object on a certain location. See
this article for more details.
LE_EventInterface.OnTerrainCreated
This event is fired when the terrain was created with the "Create Terrain" button in the level editor. You can get the terrain GameObject from the event arguments.
LE_EventInterface.LevelDataChanged removed in v1.30
This method is called by the internal components of the level editor that make changes to the level. If you add additional GUI that will allow players to make changes to the level then you should call this function after every change.
In version v1.30 I have added the LE_LevelDataChangedEvent class, which is now used for the LE_EventInterface.OnChangeLevelData event. If you have used this method, then refactor your code and invoke LE_EventInterface.OnChangeLevelData directly. Also, you need to pass the type of your change inside the LE_LevelDataChangedEvent argument object.
LE_EventInterface.UnregisterAll
Call this method to remove all references to event handlers that have been set. You should unregister your event handlers one by one or call this function otherwise memory leaks are possible.
Documentation for Unity Asset Store version v1.10
Summary
The event interface ('
LE_EventInterface' class) of the Multiplatform Runtime Level Editor allows you to implement the required behaviour for your game. Here you define how your data is stored and loaded, which meta data your levels need and what happens when certain buttons in the left menu or in the level tab are clicked. The event based interface minimizes the amount of classes that you need to access this way the editor's code is hidden from the code of your game. This approach allows changes in the editor code, without the need for change in your code. In other words the changes that you will need to make in your code after importing an updated version of the level editor are minimal as long as you use the event interface. I will give my best to keep the '
LE_EventInterface' class as static as possible. Below you will find all public members and methods of the '
LE_EventInterface' class explained briefly. For each member or method I will point you to "how to"-articles showing exemplary use cases.
LE_EventInterface.OnSave
This event will be raised in the level editor when the user clicks on the save button. Using this event will allow you to get a serialized version of your level saved in two byte arrays. See
this article for more details.
LE_EventInterface.OnLoad
The Multiplatform Runtime Level Editor provides different mechanics for you to load a level from one or two byte arrays. See
this article for more details.
LE_EventInterface.OnCollectMetaDataBeforeSave
This event allows you to add additional meta data to your levels. For example the gold medal score could be stored in each level. See
this article for more details.
LE_EventInterface.OnChangeLevelData
This event will be raised after (or during) any change to the currently edited level. For example it will be raised when the terrain or an object is modified. It will also be raised when the level icon is rendered. The event args are always empty.
LE_EventInterface.OnObjectPlaced
This event will be raised when an object is placed through drag and drop or after duplicating an object. See
this article for more details.
LE_EventInterface.OnObjectDragged
This event will be raised when an object is about to be placed through drag and drop. This event is called in every frame in which an object is dragged over something by the player. You can use this event to allow or disallow object placement of a specific level object on a certain location. See
this article for more details.
LE_EventInterface.OnTerrainCreated
This event is fired when the terrain was created with the "Create Terrain" button in the level editor. You can get the terrain GameObject from the event arguments.
LE_EventInterface.UnregisterAll
Call this method to remove all references to event handlers that have been set. You should unregister your event handlers one by one or call this function otherwise memory leaks are possible.
LE_EventInterface.LevelDataChanged
This method is called by the internal components of the level editor that make changes to the level. If you add additional GUI that will allow players to make changes to the level then you should call this function after every change.
LE_EventInterface.AddAdditionalLevelTabButtonHandler
LE_EventInterface.RemoveAdditionalLevelTabButtonHandler
These methods allow you to register and unregister event handlers for your specified additional level tab buttons in the right editor window. See
this article for more details.
LE_EventInterface.AddAdditionalLeftMenuButtonHandler
LE_EventInterface.RemoveAdditionalLeftMenuButtonHandler
These methods allow you to register and unregister event handlers for your specified left menu buttons. See
this article for more details.
LE_EventInterface.OnAdditionalLevelTabButtonClick
LE_EventInterface.OnAdditionalLeftMenuButtonClick
These methods allow you to simulate button clicks of your custom buttons in the level tab or in the menu. For example if you have an exit button in your menu, you might want to execute the exactly same behaviour when the player clicks on the hardware back button of his mobile device.
Documentation for Unity Asset Store version v1.01
Summary
The event interface ('
LE_EventInterface' class) of the Multiplatform Runtime Level Editor allows you to implement the required behaviour for your game. Here you define how your data is stored and loaded, which meta data your levels need and what happens when certain buttons in the left menu or in the level tab are clicked. The event based interface minimizes the amount of classes that you need to access this way the editor's code is hidden from the code of your game. This approach allows changes in the editor code, without the need for change in your code. In other words the changes that you will need to make in your code after importing an updated version of the level editor are minimal as long as you use the event interface. I will give my best to keep the '
LE_EventInterface' class as static as possible. Below you will find all public members and methods of the '
LE_EventInterface' class explained briefly. For each member or method I will point you to "how to"-articles showing exemplary use cases.
LE_EventInterface.OnSave
This event will be raised in the level editor when the user clicks on the save button. Using this event will allow you to get a serialized version of your level saved in two byte arrays. See
this article for more details.
LE_EventInterface.OnLoad
The Multiplatform Runtime Level Editor provides different mechanics for you to load a level from one or two byte arrays. See
this article for more details.
LE_EventInterface.OnCollectMetaDataBeforeSave
This event allows you to add additional meta data to your levels. For example the gold medal score could be stored in each level. See
this article for more details.
LE_EventInterface.OnChangeLevelData
This event will be raised after (or during) any change to the currently edited level. For example it will be raised when the terrain or an object is modified. It will also be raised when the level icon is rendered. The event args are always empty.
LE_EventInterface.OnObjectPlaced
This event will be raised when an object is placed through drag and drop or after duplicating an object. See
this article for more details.
LE_EventInterface.OnObjectDragged
This event will be raised when an object is about to be placed through drag and drop. This event is called in every frame in which an object is dragged over something by the player. You can use this event to allow or disallow object placement of a specific level object on a certain location. See
this article for more details.
LE_EventInterface.UnregisterAll
Call this method to remove all references to event handlers that have been set. You should unregister your event handlers one by one or call this function otherwise memory leaks are possible.
BUG! In Verison v1.00 OnObjectPlaced and OnObjectDragged are not unregistered. If you use OnObjectPlaced or OnObjectDragged then please don't use UnregisterAll or fix the method yourself! I have discovered this bug a few hours after submission...
LE_EventInterface.LevelDataChanged
This method is called by the internal components of the level editor that make changes to the level. If you add additional GUI that will allow players to make changes to the level then you should call this function after every change.
LE_EventInterface.AddAdditionalLevelTabButtonHandler
LE_EventInterface.RemoveAdditionalLevelTabButtonHandler
These methods allow you to register and unregister event handlers for your specified additional level tab buttons in the right editor window. See
this article for more details.
LE_EventInterface.AddAdditionalLeftMenuButtonHandler
LE_EventInterface.RemoveAdditionalLeftMenuButtonHandler
These methods allow you to register and unregister event handlers for your specified left menu buttons. See
this article for more details.
LE_EventInterface.OnAdditionalLevelTabButtonClick
LE_EventInterface.OnAdditionalLeftMenuButtonClick
These methods allow you to simulate button clicks of your custom buttons in the level tab or in the menu. For example if you have an exit button in your menu, you might want to execute the exactly same behaviour when the player clicks on the hardware back button of his mobile device.