Skip to Content

Evolution Voxel Ordinator 

Product Documentation

General Overview

To get started using Evolution Voxel Ordinator, you must include the following line in the top of each script you plan to reference it in.

​using EvolutionVO;

Once you have this in your using statements at the top of your c# file you may begin to reference the SectorManager class. There are other classes in the EvolutionVO namespace but they are used and referenced internally.

Events

onClusterChange

Provides a single parameter of type ClusterChangeDigest with properties:

  • Vector3 LastCluster, the cluster the player just left.
  • Vector3 NewCluster, the cluster the player just entered.

using EvolutionVO;

public class MyClass : MonoBehaviour
{
​void OnEnable()
​{
​​SectorManager.onClusterChange += onClusterChange;
​}

​void OnDisable()

​​{

​​​SectorManager.onClusterChange -= onClusterChange;

​ ​ ​}

​private void onClusterChange(ClusterChangeDigest data)
​{
​Debug.Log($"Last Cluster: {data.LastCluster.ToString()}, New Cluster: {data.NewCluster.ToString()}");
​}
}

onDistanceEvent

Provides two parameters:

  • Vector3 with the sectors position.
  • float with the distance from the sector the player is currently in.

using EvolutionVO;

public class MyClass : MonoBehaviour
{
​void OnEnable()
​{
​​SectorManager.onDistanceEvent += onDistanceEvent;
​}

​void OnDisable()

​​{

​​​SectorManager.onDistanceEvent -= onDistanceEvent;

​ ​ ​}

​private void onDistanceEvent(sector, distance)
​{
​Debug.Log($"Sector {sector} is {distance} meters from your current sector.");
​}
}

onDrawDistanceChange

Provides two parameters:

  • int, old draw distance.
  • int, new draw distance.

using EvolutionVO;

public class MyClass : MonoBehaviour
{
​void OnEnable()
​{
​​SectorManager.onDrawDistanceChange += onDrawDistanceChange;
​}

​void OnDisable()

​​{

​​​SectorManager.onDrawDistanceChange -= onDrawDistanceChange;

​ ​ ​}

​private void onDrawDistanceChange(int a, int b)
​{
​Debug.Log($"Draw distance changed from {a} to {b}.");
​}
}

onPositionDataEvent

Provides a single parameter of type PositionData with properties:

  • float X The x position of the player.
  • float Y The y position of the player.
  • float Z The z position of the player.

using EvolutionVO;

public class MyClass : MonoBehaviour
{
​void OnEnable()
​{
​​SectorManager.onPositionDataEvent+= onPositionDataEvent;
​}

​void OnDisable()

​​{

​​​SectorManager.onPositionDataEvent-= onPositionDataEvent;

​ ​ ​}

​private void onPositionDataEvent(Vector3 position)
​{
​Debug.Log($"Player is at X: {position.X.ToString()}, Y: {position.Y.ToString()}, Z: {position.Z.ToString()}");
​}
}

onRegionAdd

Provides a single parameter:

  • Vector3, position of the newly created region.

using EvolutionVO;

public class MyClass : MonoBehaviour
{
​void OnEnable()
​{
​​SectorManager.onRegionAdd += onRegionAdd;
​}

​void OnDisable()

​​{

​​​SectorManager.onRegionAdd -= onRegionAdd;

​ ​ ​}

​private void onRegionAdd(Vector3 position)
​{
​Debug.Log($"New region added at: {position.ToString()}");
​}
}

onRegionChange

Provides a single parameter of type RegionChangeDigest with properties:

  • Vector3 LastRegion, The region the player just left.
  • Vector3 NewRegion, The region the player just entered.

using EvolutionVO;

public class MyClass : MonoBehaviour
{
​void OnEnable()
​{
​​SectorManager.onRegionChange += onRegionChange;
​}

​void OnDisable()

​​{

​​​SectorManager.onRegionChange -= onRegionChange;

​ ​ ​}

​private void onRegionChange(RegionChangeDigest data)
​{
​Debug.Log($"Player left region: {data.LastRegion.ToString()}, and entered: {data.NewRegion.ToString()}");
​}
}

onRegionRemove

Provides a single parameter:

  • Vector3, position of the region that was removed.

using EvolutionVO;

public class MyClass : MonoBehaviour
{
​void OnEnable()
​{
​​SectorManager.onRegionRemove += onRegionRemove;
​}

​void OnDisable()

​​{

​​​SectorManager.onRegionRemove -= onRegionRemove;

​ ​ ​}

​private void onRegionRemove(Vector3 position)
​{
​Debug.Log($"Region at {position.ToString()} has been removed.");
​}
}

onResizeChange

Provides two parameters:

  • int, The old sector size.​
  • int, The new sector size.​

using EvolutionVO;

public class MyClass : MonoBehaviour
{
​void OnEnable()
​{
​​SectorManager.onResizeChange += onResizeChange;
​}

​void OnDisable()

​​{

​​​SectorManager.onResizeChange -= onResizeChange;

​ ​ ​}

​private void onResizeChange(int LastSize, int NewSize)
​{
​Debug.Log($"Sector sizing has changed from {LastSize} to {NewSize].");
​}
}

onSectorAdd

Provides a single parameter:

  • Vector3, New sector position.​

using EvolutionVO;

public class MyClass : MonoBehaviour
{
​void OnEnable()
​{
​​SectorManager.onSectorAdd += onSectorAdd;
​}

​void OnDisable()

​​{

​​​SectorManager.onSectorAdd -= onSectorAdd;

​ ​ ​}

​private void onSectorAdd(Vector3 position)
​{
​Debug.Log($"New sector added at {position.ToString()}");
​}
}

onSectorChange

Provides a single parameter of type SectorChangeDigest with properties:

  • Vector3 LastSector, the sector the player just left.
  • Vector3 NewSector, the sector the player just entered.

using EvolutionVO;

public class MyClass : MonoBehaviour
{
​void OnEnable()
​{
​​SectorManager.onSectorChange += onSectorChange;
​}

​void OnDisable()

​​{

​​​SectorManager.onSectorChange -= onSectorChange;

​ ​ ​}

​private void onSectorChange(SectorChangeDigest data)
​{
​Debug.Log($"Player has left sector: {data.LastSector.ToString()}, and entered sector: {data.NewSector.ToString()}");
​}
}

onSectorRemove

Provides a single parameter:

  • Vector3, the removed sector position.

using EvolutionVO;

public class MyClass : MonoBehaviour
{
​void OnEnable()
​{
​​SectorManager.onSectorRemove += onSectorRemove;
​}

​void OnDisable()

​​{

​​​SectorManager.onSectorRemove -= onSectorRemove;

​ ​ ​}

​private void onSectorRemove(Vector3 position)
​{
​Debug.Log($"Sector {position.ToString()} has been removed.");
​}
}

Methods

GetCluster(Vector3 position)

Find out which cluster the provided Vector3 position is in.
Returns Vector3.

using EvolutionVO;

public class MyClass : MonoBehaviour
{
​private void MyMethod()
​{

​Vector3 position = new Vector3(127.32, -12.37, 47.3);

​Vector3 cluster = SectorManager.GetCluster(position);
​Debug.Log($"Position {position.ToString()} is in cluster {cluster.ToString()}");
​}
}

GetRegion(Vector3 position)

Find out which region the provided Vector3 position is in.
Returns Vector3.

using EvolutionVO;

public class MyClass : MonoBehaviour
{
​private void MyMethod()
​{

​Vector3 position = new Vector3(127.32, -12.37, 47.3);

​Vector3 region = SectorManager.GetRegion(position);
​Debug.Log($"Position {position.ToString()} is in region {region.ToString()}");
​}
}

GetSector(Vector3 position)

Find out which sector the provided Vector3 position is in.
Returns Vector3.

using EvolutionVO;

public class MyClass : MonoBehaviour
{
​private void MyMethod()
​{

​Vector3 position = new Vector3(127.32, -12.37, 47.3);

​Vector3 sector = SectorManager.GetSector(position);
​Debug.Log($"Position {position.ToString()} is in sector{sector.ToString()}");
​}
}

PlayerInSector(Vector3 sector)

Provides a quick true or false on whether the player is in a given sector.
Returns bool.

using EvolutionVO;

public class MyClass : MonoBehaviour
{
​private void MyMethod()
​{

​Vector3 sector = new Vector3(512.0, -256.0, 64.3);

​bool inSector = SectorManager.PlayerInSector(sector);
​Debug.Log($"Player in {sector}? {inSector}");
​}
}

Properties

Vector3 CurrentCluster
The cluster the player is currently in.

Vector3 CurrentPOS
The players current actual position.

Vector3 CurrentRegion
The region the player is currently in.

Vector3 CurrentSector
The sector the player is currently in.

int ClusterSize
Current cluster sizing in meters. Cluster size is equal to RegionSize times 4.

bool GridActive
Whether or not the grid is visible in the editor or runtime.

Vector3 LastCluster
The last cluster the player was in prior to entering the current cluster.

Vector3 LastRegion
The last region the player was in prior to entering the current region.

Vector3 LastSector
The last sector the player was in prior to entering the current sector.

int RegionSize
The current region sizing in meters.  Region size is equal to SectorSize times 4.

List<Vector3> Sectors
Holds a list of the currently loaded sectors. This is provided for get access, modifying it directly will just get overridden thus having no effect.

string Version
The current version of Evolution Voxel Ordinator.

bool _DebugOutput
Whether or not information should be written to the console.

int _DrawDistance
The current sector draw distance in sectors from the current sector. If this is set to 3 it would be the current sector plus 2 sectors out in all directions. The minimum is 2 and the maximum is 5. Overridding this to a value above 5 will cause weird things to happen where sectors begin being placed too far from each other. There is really no reason to go beyond 5 sectors.

bool _HighlightActive
Whether or not the current sector wall highlighting is active.

int _SectorSize
The current sector sizing in meters.

Vector3 _OriginOffset
Coming soon!

Color _OutlineColor
The color of the sector outline.

Color _HighlightColor
The color of the sector wall highlight.