Skip to content
This repository has been archived by the owner on Mar 25, 2020. It is now read-only.

Levels System

pointcache edited this page Jan 16, 2017 · 5 revisions

URSA has a system that allows you to store some data with your scene. Example would be your "entry points" to the level, which with this system will be accessible from outside the scene, project wide. This also allows you to add any additional info you need.

(this system is currently partially migrated)

This functionality is implemented through

SceneData scriptableObject and SceneDataCollector scriptable object.

SceneData is a POD that can be modified to hold whatever data you need. SceneDataCollector is a POD that holds all your scene data objects and allows you to retrieve linked scene data by scene name or other means.

##Usage

  1. Select your scene
  2. Use special menu

This will create default scene data object. You can customize it:

  • Add your own custom fields to SceneData
  • Create a static editor class that will hold your callback, in it's constructor register the callback in LevelsSystemEditor.OnSceneDataCreated
[InitializeOnLoad]
public static class MySceneDataCreator  {

    static MySceneDataCreator() {
        LevelsSystemEditor.OnSceneDataCreated += CustomSceneDataCreator;
    }

    static void CustomSceneDataCreator(SceneAsset scene, SceneData data) {
        data.creationDate = DateTime.Now;
    }
}
Clone this wiki locally