Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TerrainAsset

地形资源

Hierarchy

Index

Constructors

constructor

Properties

__asyncLoadAssets__

__asyncLoadAssets__: boolean = false

__depends__

__depends__: any = null

__nativeDepend__

__nativeDepend__: any = null

__onLoadedInvoked__

__onLoadedInvoked__: boolean = false

Protected _blockCount

_blockCount: number[] = [1, 1]

Protected _data

_data: Uint8Array | null = null

Protected _heights

_heights: Uint16Array = new Uint16Array()

Protected _layerBuffer

_layerBuffer: number[] = [-1, -1, -1, -1]

Protected _layerInfos

_layerInfos: TerrainLayerInfo[] = []

Protected _lightMapSize

_lightMapSize: number = 128

_native

_native: string = ""

用于本机资产的可序列化URL。供内部使用。

default

""

_nativeUrl

_nativeUrl: string = ""

Protected _tileSize

_tileSize: number = 1

_uuid

_uuid: string

Protected _weightMapSize

_weightMapSize: number = 128

Protected _weights

_weights: Uint8Array = new Uint8Array()

loaded

loaded: boolean = true

该资源是否已经成功加载。

Static preventDeferredLoadDependents

preventDeferredLoadDependents: boolean = false

当场景或 Prefab 被标记为 asyncLoadAssets,禁止延迟加载该资源所依赖的其它原始资源。

default

false

Static preventPreloadNativeObject

preventPreloadNativeObject: boolean = false

禁止预加载原生对象。

default

false

Accessors

nativeAsset

  • get nativeAsset(): ArrayBuffer
  • set nativeAsset(value: ArrayBuffer): void

nativeDep

  • get nativeDep(): undefined | { __isNative__: boolean; ext: string; uuid: string }

blockCount

  • get blockCount(): number[]
  • set blockCount(value: number[]): void

heights

  • get heights(): Uint16Array
  • set heights(value: Uint16Array): void

layerBuffer

  • get layerBuffer(): number[]
  • set layerBuffer(value: number[]): void

layerInfos

lightMapSize

  • get lightMapSize(): number
  • set lightMapSize(value: number): void

nativeUrl

  • get nativeUrl(): string

refCount

  • get refCount(): number

tileSize

  • get tileSize(): number
  • set tileSize(value: number): void

weightMapSize

  • get weightMapSize(): number
  • set weightMapSize(value: number): void

weights

  • get weights(): Uint8Array
  • set weights(value: Uint8Array): void

Methods

exportDefaultNativeData

  • _exportDefaultNativeData(): Uint8Array

exportNativeData

  • _exportNativeData(): Uint8Array

loadNativeData

  • loadNativeData(_nativeData: Uint8Array): boolean

setNativeData

  • setNativeData(_nativeData: Uint8Array): void

Private setRawAsset

  • setRawAsset(filename: string, inLibrary?: boolean): void

addRef

Optional createNode

decRef

  • decRef(autoRelease?: boolean): Asset

getHeight

  • getHeight(i: number, j: number): number

getLayer

  • getLayer(xBlock: number, yBlock: number, layerId: number): number
  • 获得纹理索引

    Parameters

    • xBlock: number

      block index x

    • yBlock: number

      block index y

    • layerId: number

      layer id

    Returns number

getVertexCountI

  • getVertexCountI(): number

getVertexCountJ

  • getVertexCountJ(): number

onLoaded

  • onLoaded(): void

Private serialize

  • serialize(): void

toString

  • toString(): string
  • 返回对象的字符串表示形式。
    Asset 对象将会重写 Object 对象的 toString() 方法。
    当资源要表示为文本值时或在字符串连接时引用时,
    JavaScript 会自动调用 toString() 方法。

    对于原始类型的资源,它将返回this.nativeUrl
    否则,返回空字符串。
    子类可能会覆盖此方法。

    method

    toString

    Returns string

Static deserialize

  • deserialize(data: any): any

Generated using TypeDoc