Class SceneDownloader
LOAD-BEARING SCRIPT. Ran on start.
Inheritance
System.Object
SceneDownloader
Assembly: cs.temp.dll.dll
Syntax
public class SceneDownloader : MonoBehaviour
Fields
_heightOffset
Declaration
public float _heightOffset
Field Value
Type |
Description |
System.Single |
|
_heightRange
Declaration
public float _heightRange
Field Value
Type |
Description |
System.Single |
|
_texture
Declaration
public Texture2D _texture
Field Value
Type |
Description |
Texture2D |
|
currentState
Declaration
public static SceneDownloader.SceneSession currentState
Field Value
dataLayers
Declaration
public List<string> dataLayers
Field Value
Type |
Description |
List<System.String> |
|
datalayertextures
Declaration
public List<Texture2D> datalayertextures
Field Value
Type |
Description |
List<Texture2D> |
|
guid
Declaration
Field Value
Type |
Description |
System.String |
|
heightData
Declaration
public float[] heightData
Field Value
Type |
Description |
System.Single[] |
|
imageHeight
Declaration
Field Value
Type |
Description |
System.Int32 |
|
imageWidth
Declaration
Field Value
Type |
Description |
System.Int32 |
|
nomenclature
Declaration
public JMARSScene.Layer.LayerData nomenclature
Field Value
scene
Declaration
Field Value
Type |
Description |
JMARSScene |
This field contains the object of the scene downloaded from the viewScene endpoint. This scene is downloaded
based on which scene button was selected from the main menu in game.
|
singleton
Declaration
public static SceneDownloader singleton
Field Value
stateChanged
Declaration
public UnityEvent stateChanged
Field Value
Type |
Description |
UnityEvent |
|
terrainURL
Declaration
Field Value
Type |
Description |
System.String |
|
userScenes
Declaration
public List<JMARSScene.Metadata> userScenes
Field Value
Type |
Description |
List<JMARSScene.Metadata> |
UserScene is a class defined for the viewList endpoint which contains data of all of a user's scenes.
This list of userScene represents all of the data found on that endpoint.
|
Methods
ChangeState(SceneDownloader.SceneSession)
Called every time a state change needs to be made. stateChanged
event invoked once state has changed.
Declaration
public IEnumerator ChangeState(SceneDownloader.SceneSession state)
Parameters
Returns
Type |
Description |
IEnumerator |
|
Declaration
public void ConvertNumericData(JMARSScene.Layer.LayerData data, byte[] byte_array)
Parameters
DataToHeightMapFloat(Byte[], Int32, Int32)
Convert byte data for height map into a 2D texture
Declaration
public Texture2D DataToHeightMapFloat(byte[] bytes, int width, int height)
Parameters
Type |
Name |
Description |
System.Byte[] |
bytes |
|
System.Int32 |
width |
|
System.Int32 |
height |
|
Returns
Type |
Description |
Texture2D |
|
DataToHeightMapShort(Byte[], Int32, Int32)
Convert byte data for height map into a 2D texture
Declaration
public Texture2D DataToHeightMapShort(byte[] bytes, int width, int height)
Parameters
Type |
Name |
Description |
System.Byte[] |
bytes |
|
System.Int32 |
width |
|
System.Int32 |
height |
|
Returns
Type |
Description |
Texture2D |
|
DownloadJMARSSceneData
is a coroutine used for downloading the data from the viewScene
api endpoint.
Declaration
public IEnumerator DownloadJMARSSceneData(string jsonURL)
Parameters
Type |
Name |
Description |
System.String |
jsonURL |
|
Returns
Type |
Description |
IEnumerator |
|
Declaration
public IEnumerator DownloadNumericData(JMARSScene.Layer layer, byte[] byte_array = null)
Parameters
Returns
Type |
Description |
IEnumerator |
|
DownloadRawData(String, Int32, Int32, String)
Formats terrain height data based on scene datatype.
Declaration
public IEnumerator DownloadRawData(string url, int width, int height, string dataType)
Parameters
Type |
Name |
Description |
System.String |
url |
|
System.Int32 |
width |
Height Texture Width
|
System.Int32 |
height |
Height Texture Height
|
System.String |
dataType |
|
Returns
Type |
Description |
IEnumerator |
|
DownloadTexture(String)
Sets _texture
after downloading png texture from the api endpoint
Declaration
public IEnumerator DownloadTexture(string url)
Parameters
Type |
Name |
Description |
System.String |
url |
Depth Image url
|
Returns
Type |
Description |
IEnumerator |
|
DownloadViewList(String, String)
Tests to make sure that username and password exists in JMARS. Logs in user and downloads all custom terrains if successful,
throws false username/password error otherwise.
Declaration
public IEnumerator DownloadViewList(string username, string password)
Parameters
Type |
Name |
Description |
System.String |
username |
|
System.String |
password |
|
Returns
Type |
Description |
IEnumerator |
|
GetHeightMapRange()
Declaration
public float GetHeightMapRange()
Returns
Type |
Description |
System.Single |
|
GetOffset()
Declaration
Returns
Type |
Description |
System.Single |
|
GetTexture()
Declaration
public Texture2D GetTexture()
Returns
Type |
Description |
Texture2D |
|
Declaration
public IEnumerator GetThumbnailData(JMARSScene.Metadata scene)
Parameters
Returns
Type |
Description |
IEnumerator |
|