Search Results for

    Show / Hide Table of Contents

    Class SceneDownloader

    LOAD-BEARING SCRIPT. Ran on start.

    Inheritance
    System.Object
    SceneDownloader
    Namespace: TerrainEngine
    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
    Type Description
    SceneDownloader.SceneSession

    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
    public string guid
    Field Value
    Type Description
    System.String

    heightData

    Declaration
    public float[] heightData
    Field Value
    Type Description
    System.Single[]

    imageHeight

    Declaration
    public int imageHeight
    Field Value
    Type Description
    System.Int32

    imageWidth

    Declaration
    public int imageWidth
    Field Value
    Type Description
    System.Int32

    nomenclature

    Declaration
    public JMARSScene.Layer.LayerData nomenclature
    Field Value
    Type Description
    JMARSScene.Layer.LayerData

    scene

    Declaration
    public JMARSScene scene
    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
    Type Description
    SceneDownloader

    stateChanged

    Declaration
    public UnityEvent stateChanged
    Field Value
    Type Description
    UnityEvent

    terrainURL

    Declaration
    public string terrainURL
    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
    Type Name Description
    SceneDownloader.SceneSession state
    Returns
    Type Description
    IEnumerator

    ConvertNumericData(JMARSScene.Layer.LayerData, Byte[])

    Declaration
    public void ConvertNumericData(JMARSScene.Layer.LayerData data, byte[] byte_array)
    Parameters
    Type Name Description
    JMARSScene.Layer.LayerData data
    System.Byte[] byte_array

    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(String)

    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

    DownloadNumericData(JMARSScene.Layer, Byte[])

    Declaration
    public IEnumerator DownloadNumericData(JMARSScene.Layer layer, byte[] byte_array = null)
    Parameters
    Type Name Description
    JMARSScene.Layer layer
    System.Byte[] byte_array
    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
    public float GetOffset()
    Returns
    Type Description
    System.Single

    GetTexture()

    Declaration
    public Texture2D GetTexture()
    Returns
    Type Description
    Texture2D

    GetThumbnailData(JMARSScene.Metadata)

    Declaration
    public IEnumerator GetThumbnailData(JMARSScene.Metadata scene)
    Parameters
    Type Name Description
    JMARSScene.Metadata scene
    Returns
    Type Description
    IEnumerator
    In This Article
    Back to top Meteor Studio