Purpose

Load OWT Terrain from disk, create agents from prefabs or from the scene.

How to Use

Use the GOList Prefab or Add a new GameObject and attach the ResourceLoaderSystem script component to it.

Inside the component, its parameters are sorted into different sections.

Scene Game Objects

  1. *SCENE* NAME
    1. The *SCENE* tells the code to use this list, and the NAME is the name of Game Object to instantiate
    2. Note that this will be renamed to the AgentName from the AgentPrefab name
  2. These are already in the scene and are copied and set active when instantiated
  3. This is useful for when you want references to other things in the scene
  4. Important to note that the position will come from the scene, not the position passed into AddAgent

The GameObject must be in the GO List Scene GameObjects array.

AgentAddedEvent

Rideid agent = Globals.api.agentSystem.AddAgent(new Unit()
                {
                    team = Team.Blue,
                    prefab = "*SCENE*ChrUsaArmyInfantryAcu01Prefab",
                    pos = new RideVector3(0,0,0)
                }); 

Unit Prefabs

These are the list of prefabs you can instantiate into the scene. These prefabs should be linked in from the Unity Project window.

Rideid agent = Globals.api.agentSystem.AddAgent(new Unit()
                {
                    team = Team.Blue,
                    prefab = "*PREFAB*ChrUsaArmyInfantryAcu01Prefab",
                    pos = new RideVector3(0,0,0)
                }); 

Terrain Paths

A list of paths to Terrains which can be loaded and are accessible via the index into the array.

Globals.api.terrainSystem.LoadTerrain(index); 
Scroll Up