Class StreamingWorld
Manages terrains for streaming world at runtime.
At runtime only coordinates from LocalPlayerGPS will be used. Be sure to apply desired preview to PlayerGPS.
Terrain tiles are spread outwards from a centre tile up to TerrainDistance around player.
Terrains will be marked inactive once they pass beyond TerrainDistance.
Inactive terrains greater than TerrainDistance+1 from player will be recycled.
Locations and other loose objects greater than TerrainDistance+1 from player will be destroyed.
Inheritance
StreamingWorld
Assembly: Assembly-CSharp.dll
Syntax
public class StreamingWorld : MonoBehaviour
Fields
|
Improve this Doc
View Source
EditorFindLocationString
Declaration
[HideInInspector]
public string EditorFindLocationString
Field Value
|
Improve this Doc
View Source
LocalPlayerGPS
Declaration
public PlayerGPS LocalPlayerGPS
Field Value
|
Improve this Doc
View Source
MapPixelX
Declaration
[Range(3F, 998F)]
public int MapPixelX
Field Value
|
Improve this Doc
View Source
MapPixelY
Declaration
[Range(3F, 498F)]
public int MapPixelY
Field Value
|
Improve this Doc
View Source
ShowDebugString
Declaration
public bool ShowDebugString
Field Value
|
Improve this Doc
View Source
streamingTarget
Declaration
public GameObject streamingTarget
Field Value
|
Improve this Doc
View Source
suppressWorld
Declaration
public bool suppressWorld
Field Value
|
Improve this Doc
View Source
TerrainDistance
Declaration
[Range(1F, 4F)]
public int TerrainDistance
Field Value
|
Improve this Doc
View Source
TerrainScale
Declaration
[Range(1F, 10F)]
public float TerrainScale
Field Value
Properties
|
Improve this Doc
View Source
CurrentPlayerLocationObject
Gets current DaggerfallLocation (if any) for player's current map pixel.
Will return null for any map pixel in wilderness or if world still being built on init.
Declaration
public DaggerfallLocation CurrentPlayerLocationObject { get; }
Property Value
|
Improve this Doc
View Source
IsInit
True if world is currently initialising.
Declaration
public bool IsInit { get; }
Property Value
|
Improve this Doc
View Source
IsReady
True if component is ready.
Declaration
public bool IsReady { get; }
Property Value
|
Improve this Doc
View Source
IsRepositioningPlayer
Declaration
public bool IsRepositioningPlayer { get; }
Property Value
|
Improve this Doc
View Source
Gets Transform of central terrain player is standing on.
Declaration
public Transform PlayerTerrainTransform { get; }
Property Value
|
Improve this Doc
View Source
PlayerTileMapIndex
Gets index of tile under player at their current world position.
There are many different tiles a player can stand on, including corner tiles for roads, etc.
The main tile types in nature are:
-1 = Nothing/Error
0 = Water
1 = Dirt (snow in winter set)
2 = Grass (snow in winter set)
3 = Stone (snow in winter set)
Declaration
public int PlayerTileMapIndex { get; }
Property Value
|
Improve this Doc
View Source
SceneMapRatio
This value is the amount of scene player movement equivalent to 1 native world map unit.
Declaration
public static float SceneMapRatio { get; }
Property Value
|
Improve this Doc
View Source
SceneName
Gets the scene name for the current map pixel.
Declaration
public string SceneName { get; }
Property Value
|
Improve this Doc
View Source
StreamingTarget
Declaration
public Transform StreamingTarget { get; }
Property Value
|
Improve this Doc
View Source
WorldCompensation
Offset position of world for floating origin logic.
Declaration
public Vector3 WorldCompensation { get; }
Property Value
Methods
|
Improve this Doc
View Source
ClearStatefulLooseObjects()
Declaration
public void ClearStatefulLooseObjects()
|
Improve this Doc
View Source
CreateTerrainGameObjects(Int32, Int32, out GameObject, out GameObject)
Declaration
public void CreateTerrainGameObjects(int mapPixelX, int mapPixelY, out GameObject terrainObject, out GameObject billboardBatchObject)
Parameters
|
Improve this Doc
View Source
GetCurrentBuildingDirectory()
Gets the building directory for current player position.
Declaration
public BuildingDirectory GetCurrentBuildingDirectory()
Returns
Type |
Description |
BuildingDirectory |
BuildingDirectory or null if player not inside a location map pixel.
|
|
Improve this Doc
View Source
GetCurrentCityNavigation()
Gets the city navigation component for current player position.
Declaration
public CityNavigation GetCurrentCityNavigation()
Returns
Type |
Description |
CityNavigation |
CityNavigation or null if player not inside a location map pixel.
|
|
Improve this Doc
View Source
GetSceneName(Int32, Int32)
Gets the scene name for the given map pixel.
Declaration
public static string GetSceneName(int MapPixelX, int MapPixelY)
Parameters
Type |
Name |
Description |
Int32 |
MapPixelX |
|
Int32 |
MapPixelY |
|
Returns
|
Improve this Doc
View Source
GetTerrainFromPixel(DFPosition)
Returns terrain GameObject from mapPixel, or null if
no terrain objects are mapped to that pixel
Declaration
public GameObject GetTerrainFromPixel(DFPosition mapPixel)
Parameters
Returns
|
Improve this Doc
View Source
GetTerrainFromPixel(Int32, Int32)
Returns terrain GameObject from mapPixel, or null if
no terrain objects are mapped to that pixel
Declaration
public GameObject GetTerrainFromPixel(int mapPixelX, int mapPixelY)
Parameters
Type |
Name |
Description |
Int32 |
mapPixelX |
|
Int32 |
mapPixelY |
|
Returns
|
Improve this Doc
View Source
Gets terrain transform at mapPixelX, mapPixelY.
Declaration
public Transform GetTerrainTransform(int mapPixelX, int mapPixelY)
Parameters
Type |
Name |
Description |
Int32 |
mapPixelX |
|
Int32 |
mapPixelY |
|
Returns
Type |
Description |
Transform |
DaggerfallTerrain Transform if found, or null if not currently in world.
|
|
Improve this Doc
View Source
OffsetWorldCompensation(Vector3, Boolean)
Offset world compensation for floating origin.
Declaration
public void OffsetWorldCompensation(Vector3 offset, bool offsetLastPlayerPos = true)
Parameters
Type |
Name |
Description |
Vector3 |
offset |
|
Boolean |
offsetLastPlayerPos |
Optionally update last known player position so GPS does not change.
|
|
Improve this Doc
View Source
RaiseOnAvailableLocationGameObjectEvent()
Declaration
protected virtual void RaiseOnAvailableLocationGameObjectEvent()
|
Improve this Doc
View Source
RaiseOnClearStreamingWorldEvent()
Declaration
protected virtual void RaiseOnClearStreamingWorldEvent()
|
Improve this Doc
View Source
RaiseOnCreateLocationGameObjectEvent(DaggerfallLocation)
Declaration
protected virtual void RaiseOnCreateLocationGameObjectEvent(DaggerfallLocation dfLocation)
Parameters
|
Improve this Doc
View Source
RaiseOnFloatingOriginChangeEvent()
Declaration
protected virtual void RaiseOnFloatingOriginChangeEvent()
|
Improve this Doc
View Source
RaiseOnInitWorldEvent()
Declaration
protected virtual void RaiseOnInitWorldEvent()
|
Improve this Doc
View Source
RaiseOnPreInitWorldEvent()
Declaration
protected virtual void RaiseOnPreInitWorldEvent()
|
Improve this Doc
View Source
RaiseOnReadyEvent()
Declaration
protected virtual void RaiseOnReadyEvent()
|
Improve this Doc
View Source
RaiseOnTeleportToCoordinatesEvent(DFPosition)
Declaration
protected virtual void RaiseOnTeleportToCoordinatesEvent(DFPosition worldPos)
Parameters
|
Improve this Doc
View Source
RaiseOnUpdateLocationGameObjectEvent(GameObject, Boolean)
Declaration
protected virtual void RaiseOnUpdateLocationGameObjectEvent(GameObject locationObject, bool allowYeld)
Parameters
|
Improve this Doc
View Source
RaiseOnUpdateTerrainsEndEvent()
Declaration
protected virtual void RaiseOnUpdateTerrainsEndEvent()
|
Improve this Doc
View Source
RaiseOnUpdateTerrainsStartEvent()
Declaration
protected virtual void RaiseOnUpdateTerrainsStartEvent()
|
Improve this Doc
View Source
RestoreWorldCompensationHeight(Single)
Restores world compensation height without triggering a reposition.
Declaration
public void RestoreWorldCompensationHeight(float height)
Parameters
Type |
Name |
Description |
Single |
height |
Height compensation value to restore.
|
|
Improve this Doc
View Source
SetAutoReposition(StreamingWorld.RepositionMethods, Vector3)
Declaration
public void SetAutoReposition(StreamingWorld.RepositionMethods method, Vector3 offset)
Parameters
|
Improve this Doc
View Source
TeleportToCoordinates(Int32, Int32, StreamingWorld.RepositionMethods)
Teleport to specific map pixel with an optional automatic reposition.
Declaration
public void TeleportToCoordinates(int mapPixelX, int mapPixelY, StreamingWorld.RepositionMethods autoReposition = StreamingWorld.RepositionMethods.Origin)
Parameters
|
Improve this Doc
View Source
TeleportToCoordinates(Int32, Int32, Vector3)
Teleport to specific map pixel and apply a specific reposition.
Declaration
public void TeleportToCoordinates(int mapPixelX, int mapPixelY, Vector3 repositionOffset)
Parameters
|
Improve this Doc
View Source
TeleportToWorldCoordinates(Int32, Int32)
Teleport to specific world coordinates.
Declaration
public void TeleportToWorldCoordinates(int worldPosX, int worldPosZ)
Parameters
Type |
Name |
Description |
Int32 |
worldPosX |
|
Int32 |
worldPosZ |
|
|
Improve this Doc
View Source
TrackLooseObject(GameObject, Boolean, Int32, Int32, Boolean)
Track an exterior object in streaming world.
Tracked object will be automatically destroyed when outside of range.
Declaration
public void TrackLooseObject(GameObject gameObject, bool statefulObj = false, int mapPixelX = -1, int mapPixelY = -1, bool setParent = false)
Parameters
Type |
Name |
Description |
GameObject |
gameObject |
Game object to track.
|
Boolean |
statefulObj |
True to mark as a stateful game object which is managed by SerializedStateManager.
|
Int32 |
mapPixelX |
Map pixel X to store gameobject. -1 for player location.
|
Int32 |
mapPixelY |
Map pixel Y to store gameobject. -1 for player location.
|
Boolean |
setParent |
True to set parent as StreamingTarget.
|
|
Improve this Doc
View Source
UpdateTerrainData(StreamingWorld.TerrainDesc)
Declaration
public void UpdateTerrainData(StreamingWorld.TerrainDesc terrainDesc)
Parameters
|
Improve this Doc
View Source
UpdateTerrainNature(StreamingWorld.TerrainDesc)
Declaration
public void UpdateTerrainNature(StreamingWorld.TerrainDesc terrainDesc)
Parameters
Events
|
Improve this Doc
View Source
OnAvailableLocationGameObject
Declaration
public static event StreamingWorld.OnAvailableLocationGameObjectHandler OnAvailableLocationGameObject
Event Type
|
Improve this Doc
View Source
OnClearStreamingWorld
Declaration
public static event StreamingWorld.OnClearStreamingWorldEventHandler OnClearStreamingWorld
Event Type
|
Improve this Doc
View Source
OnCreateLocationGameObject
Declaration
public static event StreamingWorld.OnCreateLocationGameObjectEventHandler OnCreateLocationGameObject
Event Type
|
Improve this Doc
View Source
OnFloatingOriginChange
Declaration
public static event StreamingWorld.OnFloatingOriginChangeEventHandler OnFloatingOriginChange
Event Type
|
Improve this Doc
View Source
OnInitWorld
Declaration
public static event StreamingWorld.OnInitWorldEventHandler OnInitWorld
Event Type
|
Improve this Doc
View Source
OnPreInitWorld
Declaration
public static event StreamingWorld.OnPreInitWorldEventHandler OnPreInitWorld
Event Type
|
Improve this Doc
View Source
OnReady
Declaration
public static event StreamingWorld.OnReadyEventHandler OnReady
Event Type
|
Improve this Doc
View Source
OnTeleportToCoordinates
Declaration
public static event StreamingWorld.OnTeleportToCoordinatesEventHandler OnTeleportToCoordinates
Event Type
|
Improve this Doc
View Source
OnUpdateLocationGameObject
Declaration
public static event StreamingWorld.OnUpdateLocationGameObjectEventHandler OnUpdateLocationGameObject
Event Type
|
Improve this Doc
View Source
OnUpdateTerrainsEnd
Declaration
public static event StreamingWorld.OnUpdateTerrainsEndEventHandler OnUpdateTerrainsEnd
Event Type
|
Improve this Doc
View Source
OnUpdateTerrainsStart
Declaration
public static event StreamingWorld.OnUpdateTerrainsStartEventHandler OnUpdateTerrainsStart
Event Type
Extension Methods
MBExtensions.Invoke<T1, T2, T3, T4>(MonoBehaviour, Action<T1, T2, T3, T4>, T1, T2, T3, T4, Single)