onejs-core 3.0.2 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitattributes +2 -2
- package/.prettierrc +5 -5
- package/.vscode/settings.json +5 -5
- package/LICENSE +20 -20
- package/README.md +102 -102
- package/definitions/Assemblies/OneJS.Runtime.Ext.d.ts +6 -6
- package/definitions/Assemblies/OneJS.Runtime.d.ts +826 -826
- package/definitions/Assemblies/OneJS.Samples.d.ts +20 -20
- package/definitions/Assemblies/Unity.Mathematics.d.ts +9221 -9221
- package/definitions/Assemblies/UnityEditor.CoreModule.d.ts +32614 -32614
- package/definitions/Assemblies/UnityEngine.AIModule.d.ts +998 -998
- package/definitions/Assemblies/UnityEngine.AnimationModule.d.ts +3308 -3308
- package/definitions/Assemblies/UnityEngine.AssetBundleModule.d.ts +337 -337
- package/definitions/Assemblies/UnityEngine.AudioModule.d.ts +1154 -1154
- package/definitions/Assemblies/UnityEngine.CoreModule.d.ts +29587 -29587
- package/definitions/Assemblies/UnityEngine.PhysicsModule.d.ts +3137 -3137
- package/definitions/Assemblies/UnityEngine.TerrainModule.d.ts +1270 -1270
- package/definitions/Assemblies/UnityEngine.UIElementsModule.d.ts +32718 -32718
- package/definitions/Assemblies/UnityEngine.UnityAnalyticsCommonModule.d.ts +274 -274
- package/definitions/Assemblies/index.d.ts +16 -16
- package/definitions/Assemblies/mscorlib.d.ts +19416 -19416
- package/definitions/augments.d.ts +66 -66
- package/definitions/globals.d.ts +53 -53
- package/definitions/index.d.ts +11 -11
- package/definitions/jsx.d.ts +570 -570
- package/definitions/modules.d.ts +32 -32
- package/definitions/onejs.d.ts +171 -171
- package/definitions/preact.jsx.d.ts +6 -6
- package/definitions/proto-overrides.d.ts +41 -41
- package/definitions/puerts.d.ts +30 -30
- package/definitions/unity-engine.d.ts +22 -22
- package/dom/document.ts +115 -115
- package/dom/dom-style.ts +36 -36
- package/dom/dom.ts +376 -376
- package/dom/index.ts +3 -3
- package/index.ts +59 -59
- package/jsr.json +9 -9
- package/math/README.md +212 -212
- package/math/index.ts +487 -487
- package/package.json +33 -33
- package/preloads/inject.ts +43 -43
- package/scripts/esbuild/copy-assets.mjs +94 -94
- package/scripts/esbuild/decorator-fix.mjs +17 -17
- package/scripts/esbuild/import-transform.mjs +100 -100
- package/scripts/esbuild/index.mjs +3 -3
- package/scripts/esbuild/watch-output.mjs +38 -38
- package/scripts/postcss/cleanup-plugin.cjs +89 -89
- package/scripts/postcss/onejs-tw-config.cjs +252 -252
- package/scripts/postcss/optional-import-plugin.cjs +26 -26
- package/scripts/postcss/tailwind-logging-plugin.cjs +11 -11
- package/scripts/postcss/unwrap-is-plugin.cjs +16 -16
- package/scripts/postcss/uss-transform-plugin.cjs +92 -92
- package/scripts/switch.cjs +290 -290
- package/styling/index.tsx +32 -32
- package/styling/utils/generateAlphabeticName.ts +20 -20
- package/styling/utils/generateComponentId.ts +5 -5
- package/styling/utils/hash.ts +46 -46
- package/tsconfig.json +24 -24
- package/typings.d.ts +5 -5
- package/utils/arrays.ts +10 -10
- package/utils/color-palettes.ts +2 -2
- package/utils/color-parser.ts +248 -248
- package/utils/float-parser.ts +30 -30
- package/utils/index.ts +15 -15
- package/utils/subscribe.ts +16 -16
- package/utils/system.ts +16 -16
- package/dist/csharp/index.d.ts +0 -3
- package/dist/csharp/index.js +0 -3
- package/dist/dom/document.d.ts +0 -30
- package/dist/dom/document.js +0 -89
- package/dist/dom/dom-style.d.ts +0 -9
- package/dist/dom/dom-style.js +0 -27
- package/dist/dom/dom.d.ts +0 -83
- package/dist/dom/dom.js +0 -313
- package/dist/dom/index.d.ts +0 -4
- package/dist/dom/index.js +0 -4
- package/dist/dom/selector.d.ts +0 -0
- package/dist/dom/selector.js +0 -0
- package/dist/index.d.ts +0 -25
- package/dist/index.js +0 -45
- package/dist/math/index.d.ts +0 -86
- package/dist/math/index.js +0 -361
- package/dist/preloads/inject.d.ts +0 -3
- package/dist/preloads/inject.js +0 -36
- package/dist/styling/index.d.ts +0 -10
- package/dist/styling/index.js +0 -28
- package/dist/styling/utils/generateAlphabeticName.d.ts +0 -1
- package/dist/styling/utils/generateAlphabeticName.js +0 -16
- package/dist/styling/utils/generateComponentId.d.ts +0 -1
- package/dist/styling/utils/generateComponentId.js +0 -5
- package/dist/styling/utils/hash.d.ts +0 -5
- package/dist/styling/utils/hash.js +0 -34
- package/dist/utils/arrays.d.ts +0 -1
- package/dist/utils/arrays.js +0 -10
- package/dist/utils/color-palettes.d.ts +0 -2
- package/dist/utils/color-palettes.js +0 -2
- package/dist/utils/color-parser.d.ts +0 -161
- package/dist/utils/color-parser.js +0 -241
- package/dist/utils/float-parser.d.ts +0 -7
- package/dist/utils/float-parser.js +0 -23
- package/dist/utils/index.d.ts +0 -12
- package/dist/utils/index.js +0 -15
- package/dist/utils/responsive.d.ts +0 -4
- package/dist/utils/responsive.js +0 -23
- package/dist/utils/subscribe.d.ts +0 -4
- package/dist/utils/subscribe.js +0 -10
- package/dist/utils/system.d.ts +0 -1
- package/dist/utils/system.js +0 -16
- package/dist/utils/toJsArray.d.ts +0 -1
- package/dist/utils/toJsArray.js +0 -10
|
@@ -1,1270 +1,1270 @@
|
|
|
1
|
-
|
|
2
|
-
declare namespace CS {
|
|
3
|
-
// const __keep_incompatibility: unique symbol;
|
|
4
|
-
//
|
|
5
|
-
// interface $Ref<T> {
|
|
6
|
-
// value: T
|
|
7
|
-
// }
|
|
8
|
-
// namespace System {
|
|
9
|
-
// interface Array$1<T> extends System.Array {
|
|
10
|
-
// get_Item(index: number):T;
|
|
11
|
-
//
|
|
12
|
-
// set_Item(index: number, value: T):void;
|
|
13
|
-
// }
|
|
14
|
-
// }
|
|
15
|
-
// interface $Task<T> {}
|
|
16
|
-
namespace UnityEngine {
|
|
17
|
-
/** Indicate the types of changes to the terrain in OnTerrainChanged callback.
|
|
18
|
-
*/
|
|
19
|
-
enum TerrainChangedFlags
|
|
20
|
-
{ Heightmap = 1, TreeInstances = 2, DelayedHeightmapUpdate = 4, FlushEverythingImmediately = 8, RemoveDirtyDetailsImmediately = 16, HeightmapResolution = 32, Holes = 64, DelayedHolesUpdate = 128, WillBeDestroyed = 256 }
|
|
21
|
-
/** Enum provding terrain rendering options.
|
|
22
|
-
*/
|
|
23
|
-
enum TerrainRenderFlags
|
|
24
|
-
{ heightmap = 1, trees = 2, details = 4, all = 7, Heightmap = 1, Trees = 2, Details = 4, All = 7 }
|
|
25
|
-
/** The Terrain component renders the terrain.
|
|
26
|
-
*/
|
|
27
|
-
class Terrain extends UnityEngine.Behaviour
|
|
28
|
-
{
|
|
29
|
-
protected [__keep_incompatibility]: never;
|
|
30
|
-
/** The Terrain Data that stores heightmaps, terrain textures, detail meshes and trees.
|
|
31
|
-
*/
|
|
32
|
-
public get terrainData(): UnityEngine.TerrainData;
|
|
33
|
-
public set terrainData(value: UnityEngine.TerrainData);
|
|
34
|
-
/** The maximum distance at which trees are rendered.
|
|
35
|
-
*/
|
|
36
|
-
public get treeDistance(): number;
|
|
37
|
-
public set treeDistance(value: number);
|
|
38
|
-
/** Distance from the camera where trees will be rendered as billboards only.
|
|
39
|
-
*/
|
|
40
|
-
public get treeBillboardDistance(): number;
|
|
41
|
-
public set treeBillboardDistance(value: number);
|
|
42
|
-
/** Total distance delta that trees will use to transition from billboard orientation to mesh orientation.
|
|
43
|
-
*/
|
|
44
|
-
public get treeCrossFadeLength(): number;
|
|
45
|
-
public set treeCrossFadeLength(value: number);
|
|
46
|
-
/** Maximum number of trees rendered at full LOD.
|
|
47
|
-
*/
|
|
48
|
-
public get treeMaximumFullLODCount(): number;
|
|
49
|
-
public set treeMaximumFullLODCount(value: number);
|
|
50
|
-
/** Detail objects will be displayed up to this distance.
|
|
51
|
-
*/
|
|
52
|
-
public get detailObjectDistance(): number;
|
|
53
|
-
public set detailObjectDistance(value: number);
|
|
54
|
-
/** Density of detail objects.
|
|
55
|
-
*/
|
|
56
|
-
public get detailObjectDensity(): number;
|
|
57
|
-
public set detailObjectDensity(value: number);
|
|
58
|
-
/** An approximation of how many pixels the terrain will pop in the worst case when switching lod.
|
|
59
|
-
*/
|
|
60
|
-
public get heightmapPixelError(): number;
|
|
61
|
-
public set heightmapPixelError(value: number);
|
|
62
|
-
/** Limits the Terrain's maximum rendering resolution.
|
|
63
|
-
*/
|
|
64
|
-
public get heightmapMaximumLOD(): number;
|
|
65
|
-
public set heightmapMaximumLOD(value: number);
|
|
66
|
-
/** Limits how simplified the rendered terrain can be.
|
|
67
|
-
*/
|
|
68
|
-
public get heightmapMinimumLODSimplification(): number;
|
|
69
|
-
public set heightmapMinimumLODSimplification(value: number);
|
|
70
|
-
/** Heightmap patches beyond basemap distance will use a precomputed low res basemap.
|
|
71
|
-
*/
|
|
72
|
-
public get basemapDistance(): number;
|
|
73
|
-
public set basemapDistance(value: number);
|
|
74
|
-
/** The index of the baked lightmap applied to this terrain.
|
|
75
|
-
*/
|
|
76
|
-
public get lightmapIndex(): number;
|
|
77
|
-
public set lightmapIndex(value: number);
|
|
78
|
-
/** The index of the realtime lightmap applied to this terrain.
|
|
79
|
-
*/
|
|
80
|
-
public get realtimeLightmapIndex(): number;
|
|
81
|
-
public set realtimeLightmapIndex(value: number);
|
|
82
|
-
/** The UV scale & offset used for a baked lightmap.
|
|
83
|
-
*/
|
|
84
|
-
public get lightmapScaleOffset(): UnityEngine.Vector4;
|
|
85
|
-
public set lightmapScaleOffset(value: UnityEngine.Vector4);
|
|
86
|
-
/** The UV scale & offset used for a realtime lightmap.
|
|
87
|
-
*/
|
|
88
|
-
public get realtimeLightmapScaleOffset(): UnityEngine.Vector4;
|
|
89
|
-
public set realtimeLightmapScaleOffset(value: UnityEngine.Vector4);
|
|
90
|
-
/** Defines whether Unity frees per-Camera rendering resources for the Terrain when those resources aren't in use after a certain number of frames.
|
|
91
|
-
*/
|
|
92
|
-
public get keepUnusedRenderingResources(): boolean;
|
|
93
|
-
public set keepUnusedRenderingResources(value: boolean);
|
|
94
|
-
/** Allows you to set the shadow casting mode for the terrain.
|
|
95
|
-
*/
|
|
96
|
-
public get shadowCastingMode(): UnityEngine.Rendering.ShadowCastingMode;
|
|
97
|
-
public set shadowCastingMode(value: UnityEngine.Rendering.ShadowCastingMode);
|
|
98
|
-
/** How reflection probes are used for terrain. See Rendering.ReflectionProbeUsage.
|
|
99
|
-
*/
|
|
100
|
-
public get reflectionProbeUsage(): UnityEngine.Rendering.ReflectionProbeUsage;
|
|
101
|
-
public set reflectionProbeUsage(value: UnityEngine.Rendering.ReflectionProbeUsage);
|
|
102
|
-
/** The custom material Unity uses to render the Terrain.
|
|
103
|
-
*/
|
|
104
|
-
public get materialTemplate(): UnityEngine.Material;
|
|
105
|
-
public set materialTemplate(value: UnityEngine.Material);
|
|
106
|
-
/** Indicates whether Unity draws the Terrain geometry itself.
|
|
107
|
-
*/
|
|
108
|
-
public get drawHeightmap(): boolean;
|
|
109
|
-
public set drawHeightmap(value: boolean);
|
|
110
|
-
/** Specifies if the terrain tile will be automatically connected to adjacent tiles.
|
|
111
|
-
*/
|
|
112
|
-
public get allowAutoConnect(): boolean;
|
|
113
|
-
public set allowAutoConnect(value: boolean);
|
|
114
|
-
/** Grouping ID for auto connect.
|
|
115
|
-
*/
|
|
116
|
-
public get groupingID(): number;
|
|
117
|
-
public set groupingID(value: number);
|
|
118
|
-
/** Set to true to enable the terrain instance renderer. The default value is false.
|
|
119
|
-
*/
|
|
120
|
-
public get drawInstanced(): boolean;
|
|
121
|
-
public set drawInstanced(value: boolean);
|
|
122
|
-
/** When this options is enabled, Terrain heightmap geometries will be added in acceleration structures used for Ray Tracing.
|
|
123
|
-
*/
|
|
124
|
-
public get enableHeightmapRayTracing(): boolean;
|
|
125
|
-
public set enableHeightmapRayTracing(value: boolean);
|
|
126
|
-
/** Returns the normal map texture computed from sampling the heightmap. It is only used when terrain is rendered using instancing.
|
|
127
|
-
*/
|
|
128
|
-
public get normalmapTexture(): UnityEngine.RenderTexture;
|
|
129
|
-
/** Specify if terrain trees and details should be drawn.
|
|
130
|
-
*/
|
|
131
|
-
public get drawTreesAndFoliage(): boolean;
|
|
132
|
-
public set drawTreesAndFoliage(value: boolean);
|
|
133
|
-
/** Set the terrain bounding box scale.
|
|
134
|
-
*/
|
|
135
|
-
public get patchBoundsMultiplier(): UnityEngine.Vector3;
|
|
136
|
-
public set patchBoundsMultiplier(value: UnityEngine.Vector3);
|
|
137
|
-
/** The multiplier to the current LOD bias used for rendering LOD trees (i.e. SpeedTree trees).
|
|
138
|
-
*/
|
|
139
|
-
public get treeLODBiasMultiplier(): number;
|
|
140
|
-
public set treeLODBiasMultiplier(value: number);
|
|
141
|
-
/** Collect detail patches from memory.
|
|
142
|
-
*/
|
|
143
|
-
public get collectDetailPatches(): boolean;
|
|
144
|
-
public set collectDetailPatches(value: boolean);
|
|
145
|
-
/** When enabled, the terrain ignores the terrain overrides set in the QualitySettings.
|
|
146
|
-
*/
|
|
147
|
-
public get ignoreQualitySettings(): boolean;
|
|
148
|
-
public set ignoreQualitySettings(value: boolean);
|
|
149
|
-
/** Controls what part of the terrain should be rendered.
|
|
150
|
-
*/
|
|
151
|
-
public get editorRenderFlags(): UnityEngine.TerrainRenderFlags;
|
|
152
|
-
public set editorRenderFlags(value: UnityEngine.TerrainRenderFlags);
|
|
153
|
-
/** Whether to bake an array of internal light probes for Tree Editor trees (Editor only).
|
|
154
|
-
*/
|
|
155
|
-
public get bakeLightProbesForTrees(): boolean;
|
|
156
|
-
public set bakeLightProbesForTrees(value: boolean);
|
|
157
|
-
/** Removes ringing from light probes on Tree Editor trees (Editor only).
|
|
158
|
-
*/
|
|
159
|
-
public get deringLightProbesForTrees(): boolean;
|
|
160
|
-
public set deringLightProbesForTrees(value: boolean);
|
|
161
|
-
/** The motion vector rendering mode for all SpeedTree models painted on the terrain.
|
|
162
|
-
*/
|
|
163
|
-
public get treeMotionVectorModeOverride(): UnityEngine.TreeMotionVectorModeOverride;
|
|
164
|
-
public set treeMotionVectorModeOverride(value: UnityEngine.TreeMotionVectorModeOverride);
|
|
165
|
-
/** Allows you to specify how Unity chooses the for tree instances.
|
|
166
|
-
*/
|
|
167
|
-
public get preserveTreePrototypeLayers(): boolean;
|
|
168
|
-
public set preserveTreePrototypeLayers(value: boolean);
|
|
169
|
-
/** Graphics format of the Terrain heightmap.
|
|
170
|
-
*/
|
|
171
|
-
public static get heightmapFormat(): UnityEngine.Experimental.Rendering.GraphicsFormat;
|
|
172
|
-
public static get heightmapTextureFormat(): UnityEngine.TextureFormat;
|
|
173
|
-
/** RenderTextureFormat of the terrain heightmap.
|
|
174
|
-
*/
|
|
175
|
-
public static get heightmapRenderTextureFormat(): UnityEngine.RenderTextureFormat;
|
|
176
|
-
/** Graphics format of the Terrain normal map texture.
|
|
177
|
-
*/
|
|
178
|
-
public static get normalmapFormat(): UnityEngine.Experimental.Rendering.GraphicsFormat;
|
|
179
|
-
/** Texture format of the Terrain normal map texture.
|
|
180
|
-
*/
|
|
181
|
-
public static get normalmapTextureFormat(): UnityEngine.TextureFormat;
|
|
182
|
-
/** Render texture format of the Terrain normal map texture.
|
|
183
|
-
*/
|
|
184
|
-
public static get normalmapRenderTextureFormat(): UnityEngine.RenderTextureFormat;
|
|
185
|
-
/** Graphics format of the Terrain holes Texture when it is not compressed.
|
|
186
|
-
*/
|
|
187
|
-
public static get holesFormat(): UnityEngine.Experimental.Rendering.GraphicsFormat;
|
|
188
|
-
/** Render texture format of the Terrain holes Texture.
|
|
189
|
-
*/
|
|
190
|
-
public static get holesRenderTextureFormat(): UnityEngine.RenderTextureFormat;
|
|
191
|
-
/** Graphics format of the Terrain holes Texture when it is compressed.
|
|
192
|
-
*/
|
|
193
|
-
public static get compressedHolesFormat(): UnityEngine.Experimental.Rendering.GraphicsFormat;
|
|
194
|
-
/** Texture format of the Terrain holes Texture when it is compressed.
|
|
195
|
-
*/
|
|
196
|
-
public static get compressedHolesTextureFormat(): UnityEngine.TextureFormat;
|
|
197
|
-
/** The active Terrain. This is a convenient function to get to the main Terrain in the Scene.
|
|
198
|
-
*/
|
|
199
|
-
public static get activeTerrain(): UnityEngine.Terrain;
|
|
200
|
-
/** The active terrains in the Scene.
|
|
201
|
-
*/
|
|
202
|
-
public static get activeTerrains(): System.Array$1<UnityEngine.Terrain>;
|
|
203
|
-
/** The Terrain tile to the left, which is in the negative X direction.
|
|
204
|
-
*/
|
|
205
|
-
public get leftNeighbor(): UnityEngine.Terrain;
|
|
206
|
-
/** The Terrain tile to the left, which is in the positive X direction.
|
|
207
|
-
*/
|
|
208
|
-
public get rightNeighbor(): UnityEngine.Terrain;
|
|
209
|
-
/** Terrain top neighbor.
|
|
210
|
-
*/
|
|
211
|
-
public get topNeighbor(): UnityEngine.Terrain;
|
|
212
|
-
/** Terrain bottom neighbor.
|
|
213
|
-
*/
|
|
214
|
-
public get bottomNeighbor(): UnityEngine.Terrain;
|
|
215
|
-
/** Determines which rendering layers the Terrain renderer lives on.
|
|
216
|
-
*/
|
|
217
|
-
public get renderingLayerMask(): number;
|
|
218
|
-
public set renderingLayerMask(value: number);
|
|
219
|
-
/**
|
|
220
|
-
* @param $cameraInstanceID The InstanceID of the camera being queried. See Object.GetInstanceID.
|
|
221
|
-
* @returns Returns true if all rendering resources for the given camera are saved regardless of usage. Returns false if garbage collection is allowed to free unused resources.
|
|
222
|
-
*/
|
|
223
|
-
public GetKeepUnusedCameraRenderingResources ($cameraInstanceID: number) : boolean
|
|
224
|
-
/** Defines whether Unity cleans up rendering resources for a given Camera during garbage collection.
|
|
225
|
-
* @param $cameraInstanceID The InstanceID of the camera for which freeUnusedRenderingResources is being set. See Object.GetInstanceID.
|
|
226
|
-
* @param $freeUnusedRenderingResources The value to set to this camera's freeUnusedRenderingResources flag.
|
|
227
|
-
*/
|
|
228
|
-
public SetKeepUnusedCameraRenderingResources ($cameraInstanceID: number, $keepUnused: boolean) : void
|
|
229
|
-
public GetClosestReflectionProbes ($result: System.Collections.Generic.List$1<UnityEngine.Rendering.ReflectionProbeBlendInfo>) : void
|
|
230
|
-
/** Samples the height at the given position defined in world space, relative to the Terrain space.
|
|
231
|
-
*/
|
|
232
|
-
public SampleHeight ($worldPosition: UnityEngine.Vector3) : number
|
|
233
|
-
/** Adds a tree instance to the terrain.
|
|
234
|
-
*/
|
|
235
|
-
public AddTreeInstance ($instance: UnityEngine.TreeInstance) : void
|
|
236
|
-
/** Lets you set up the connection between neighboring Terrain tiles. This ensures LOD matches up on neighboring Terrain tiles.
|
|
237
|
-
* @param $left The Terrain tile to the left is in the negative X direction.
|
|
238
|
-
* @param $top The Terrain tile to the top is in the positive Z direction.
|
|
239
|
-
* @param $right The Terrain tile to the right is in the positive X direction.
|
|
240
|
-
* @param $bottom The Terrain tile to the bottom is in the negative Z direction.
|
|
241
|
-
*/
|
|
242
|
-
public SetNeighbors ($left: UnityEngine.Terrain, $top: UnityEngine.Terrain, $right: UnityEngine.Terrain, $bottom: UnityEngine.Terrain) : void
|
|
243
|
-
/** Get the position of the terrain.
|
|
244
|
-
*/
|
|
245
|
-
public GetPosition () : UnityEngine.Vector3
|
|
246
|
-
/** Flushes any change done in the terrain so it takes effect.
|
|
247
|
-
*/
|
|
248
|
-
public Flush () : void
|
|
249
|
-
/** Set the additional material properties when rendering the terrain heightmap using the splat material.
|
|
250
|
-
*/
|
|
251
|
-
public SetSplatMaterialPropertyBlock ($properties: UnityEngine.MaterialPropertyBlock) : void
|
|
252
|
-
/** Get the previously set splat material properties by copying to the dest MaterialPropertyBlock object.
|
|
253
|
-
*/
|
|
254
|
-
public GetSplatMaterialPropertyBlock ($dest: UnityEngine.MaterialPropertyBlock) : void
|
|
255
|
-
/** Marks the current connectivity status as invalid.
|
|
256
|
-
*/
|
|
257
|
-
public static SetConnectivityDirty () : void
|
|
258
|
-
public static GetActiveTerrains ($terrainList: System.Collections.Generic.List$1<UnityEngine.Terrain>) : void
|
|
259
|
-
/** Creates a Terrain including collider from TerrainData.
|
|
260
|
-
*/
|
|
261
|
-
public static CreateTerrainGameObject ($assignTerrain: UnityEngine.TerrainData) : UnityEngine.GameObject
|
|
262
|
-
public constructor ()
|
|
263
|
-
}
|
|
264
|
-
/** The TerrainData class stores heightmaps, detail mesh positions, tree instances, and terrain texture alpha maps.
|
|
265
|
-
*/
|
|
266
|
-
class TerrainData extends UnityEngine.Object
|
|
267
|
-
{
|
|
268
|
-
protected [__keep_incompatibility]: never;
|
|
269
|
-
/** Returns the heightmap texture.
|
|
270
|
-
*/
|
|
271
|
-
public get heightmapTexture(): UnityEngine.RenderTexture;
|
|
272
|
-
/** The size of the heightmap in texels for either the width or the height.
|
|
273
|
-
*/
|
|
274
|
-
public get heightmapResolution(): number;
|
|
275
|
-
public set heightmapResolution(value: number);
|
|
276
|
-
/** Returns a Vector3 where the x and z components are the size of each heightmap sample (i.e. the space between two neighboring heightmap samples), and the y component is the entire Terrain's height range in world space.
|
|
277
|
-
*/
|
|
278
|
-
public get heightmapScale(): UnityEngine.Vector3;
|
|
279
|
-
/** Returns the Terrain holes Texture.
|
|
280
|
-
*/
|
|
281
|
-
public get holesTexture(): UnityEngine.Texture;
|
|
282
|
-
/** Enable the Terrain holes Texture compression.
|
|
283
|
-
*/
|
|
284
|
-
public get enableHolesTextureCompression(): boolean;
|
|
285
|
-
public set enableHolesTextureCompression(value: boolean);
|
|
286
|
-
/** Returns the Terrain holes resolution for both the data and the Texture.
|
|
287
|
-
*/
|
|
288
|
-
public get holesResolution(): number;
|
|
289
|
-
/** The total size in world units of the terrain.
|
|
290
|
-
*/
|
|
291
|
-
public get size(): UnityEngine.Vector3;
|
|
292
|
-
public set size(value: UnityEngine.Vector3);
|
|
293
|
-
/** The local bounding box of the TerrainData object.
|
|
294
|
-
*/
|
|
295
|
-
public get bounds(): UnityEngine.Bounds;
|
|
296
|
-
/** Strength of the waving grass in the terrain.
|
|
297
|
-
*/
|
|
298
|
-
public get wavingGrassStrength(): number;
|
|
299
|
-
public set wavingGrassStrength(value: number);
|
|
300
|
-
/** Amount of waving grass in the terrain.
|
|
301
|
-
*/
|
|
302
|
-
public get wavingGrassAmount(): number;
|
|
303
|
-
public set wavingGrassAmount(value: number);
|
|
304
|
-
/** Speed of the waving grass.
|
|
305
|
-
*/
|
|
306
|
-
public get wavingGrassSpeed(): number;
|
|
307
|
-
public set wavingGrassSpeed(value: number);
|
|
308
|
-
/** Color of the waving grass that the terrain has.
|
|
309
|
-
*/
|
|
310
|
-
public get wavingGrassTint(): UnityEngine.Color;
|
|
311
|
-
public set wavingGrassTint(value: UnityEngine.Color);
|
|
312
|
-
/** The resolution of the detail data stored in TerrainData.
|
|
313
|
-
*/
|
|
314
|
-
public get detailWidth(): number;
|
|
315
|
-
/** The resolution of the detail data stored in TerrainData.
|
|
316
|
-
*/
|
|
317
|
-
public get detailHeight(): number;
|
|
318
|
-
/** The maximum value of each sample in the detail map of the terrain data.
|
|
319
|
-
*/
|
|
320
|
-
public get maxDetailScatterPerRes(): number;
|
|
321
|
-
/** The number of patches along a terrain tile edge. This is squared to make a grid of patches.
|
|
322
|
-
*/
|
|
323
|
-
public get detailPatchCount(): number;
|
|
324
|
-
/** Detail Resolution of the TerrainData.
|
|
325
|
-
*/
|
|
326
|
-
public get detailResolution(): number;
|
|
327
|
-
/** Detail Resolution of each patch. A larger value will decrease the number of batches used by detail objects.
|
|
328
|
-
*/
|
|
329
|
-
public get detailResolutionPerPatch(): number;
|
|
330
|
-
/** Additional resources: DetailScatterMode
|
|
331
|
-
*/
|
|
332
|
-
public get detailScatterMode(): UnityEngine.DetailScatterMode;
|
|
333
|
-
/** Contains the detail texture/meshes that the Terrain has.
|
|
334
|
-
*/
|
|
335
|
-
public get detailPrototypes(): System.Array$1<UnityEngine.DetailPrototype>;
|
|
336
|
-
public set detailPrototypes(value: System.Array$1<UnityEngine.DetailPrototype>);
|
|
337
|
-
/** Contains the current trees placed in the terrain.
|
|
338
|
-
*/
|
|
339
|
-
public get treeInstances(): System.Array$1<UnityEngine.TreeInstance>;
|
|
340
|
-
public set treeInstances(value: System.Array$1<UnityEngine.TreeInstance>);
|
|
341
|
-
/** Returns the number of tree instances.
|
|
342
|
-
*/
|
|
343
|
-
public get treeInstanceCount(): number;
|
|
344
|
-
/** The list of tree prototypes available in the inspector.
|
|
345
|
-
*/
|
|
346
|
-
public get treePrototypes(): System.Array$1<UnityEngine.TreePrototype>;
|
|
347
|
-
public set treePrototypes(value: System.Array$1<UnityEngine.TreePrototype>);
|
|
348
|
-
/** Number of alpha map layers.
|
|
349
|
-
*/
|
|
350
|
-
public get alphamapLayers(): number;
|
|
351
|
-
/** The size of the alpha map in texels for either the width or the height.
|
|
352
|
-
*/
|
|
353
|
-
public get alphamapResolution(): number;
|
|
354
|
-
public set alphamapResolution(value: number);
|
|
355
|
-
/** Width of the alpha map.
|
|
356
|
-
*/
|
|
357
|
-
public get alphamapWidth(): number;
|
|
358
|
-
/** Height of the alpha map. (Read only.)
|
|
359
|
-
*/
|
|
360
|
-
public get alphamapHeight(): number;
|
|
361
|
-
/** Resolution of the base map used for rendering far patches on the terrain.
|
|
362
|
-
*/
|
|
363
|
-
public get baseMapResolution(): number;
|
|
364
|
-
public set baseMapResolution(value: number);
|
|
365
|
-
/** Returns the number of alphamap textures.
|
|
366
|
-
*/
|
|
367
|
-
public get alphamapTextureCount(): number;
|
|
368
|
-
/** Alpha map textures used by the Terrain. Used by Terrain Inspector for undo.
|
|
369
|
-
*/
|
|
370
|
-
public get alphamapTextures(): System.Array$1<UnityEngine.Texture2D>;
|
|
371
|
-
/** Retrieves the terrain layers used by the current terrain.
|
|
372
|
-
*/
|
|
373
|
-
public get terrainLayers(): System.Array$1<UnityEngine.TerrainLayer>;
|
|
374
|
-
public set terrainLayers(value: System.Array$1<UnityEngine.TerrainLayer>);
|
|
375
|
-
/** The name for the Terrain alpha map textures.
|
|
376
|
-
*/
|
|
377
|
-
public static get AlphamapTextureName(): string;
|
|
378
|
-
/** The name for the Terrain holes Texture.
|
|
379
|
-
*/
|
|
380
|
-
public static get HolesTextureName(): string;
|
|
381
|
-
/** Gets the world space height of the Terrain at a certain point x,y without adding the Terrain's world position y.
|
|
382
|
-
*/
|
|
383
|
-
public GetHeight ($x: number, $y: number) : number
|
|
384
|
-
/** Gets an interpolated height at a point x,y. The x and y coordinates are clamped to [0, 1].
|
|
385
|
-
* @param $x X coordinate of the point in the range of [0, 1].
|
|
386
|
-
* @param $y Y coordinate of the point in the range of [0, 1].
|
|
387
|
-
*/
|
|
388
|
-
public GetInterpolatedHeight ($x: number, $y: number) : number
|
|
389
|
-
/** Gets an array of terrain height values using the normalized x,y coordinates.
|
|
390
|
-
* @param $xBase The base x coordinate.
|
|
391
|
-
* @param $yBase The base y coordinate.
|
|
392
|
-
* @param $xCount The number of queries along the X axis.
|
|
393
|
-
* @param $yCount The number of queries along the Y axis.
|
|
394
|
-
* @param $xInterval The interval between each query along the X axis.
|
|
395
|
-
* @param $yInterval The interval between each query along the Y axis.
|
|
396
|
-
*/
|
|
397
|
-
public GetInterpolatedHeights ($xBase: number, $yBase: number, $xCount: number, $yCount: number, $xInterval: number, $yInterval: number) : System.Array$1<number>
|
|
398
|
-
/** Fills the array with Terrain height values using normalized x,y coordinates.
|
|
399
|
-
* @param $results The array to fill with height values.
|
|
400
|
-
* @param $resultXOffset The offset from the beginning of the array, along the X axis, at which to start filling in height values.
|
|
401
|
-
* @param $resultYOffset The offset from the beginning of the array, along the Y axis, at which to start filling in height values.
|
|
402
|
-
* @param $xBase The base x coordinate.
|
|
403
|
-
* @param $yBase The base y coordinate.
|
|
404
|
-
* @param $xCount The number of queries along the X axis.
|
|
405
|
-
* @param $yCount The number of queries along the Y axis.
|
|
406
|
-
* @param $xInterval The interval between each query along the X axis.
|
|
407
|
-
* @param $yInterval The interval between each query along the Y axis.
|
|
408
|
-
*/
|
|
409
|
-
public GetInterpolatedHeights ($results: System.Array$1<number>, $resultXOffset: number, $resultYOffset: number, $xBase: number, $yBase: number, $xCount: number, $yCount: number, $xInterval: number, $yInterval: number) : void
|
|
410
|
-
/** Gets an array of heightmap samples.
|
|
411
|
-
* @param $xBase First index of heightmap samples to retrieve along the Terrain's x axis.
|
|
412
|
-
* @param $yBase First index of heightmap samples to retrieve along the Terrain's z axis.
|
|
413
|
-
* @param $width Number of samples to retrieve along the Terrain's x axis.
|
|
414
|
-
* @param $height Number of samples to retrieve along the Terrain's z axis.
|
|
415
|
-
*/
|
|
416
|
-
public GetHeights ($xBase: number, $yBase: number, $width: number, $height: number) : System.Array$1<number>
|
|
417
|
-
/** Sets an array of heightmap samples.
|
|
418
|
-
* @param $xBase First x index of heightmap samples to set.
|
|
419
|
-
* @param $yBase First y index of heightmap samples to set.
|
|
420
|
-
* @param $heights Array of heightmap samples to set (values range from 0 to 1, array indexed as [y,x]).
|
|
421
|
-
*/
|
|
422
|
-
public SetHeights ($xBase: number, $yBase: number, $heights: System.Array$1<number>) : void
|
|
423
|
-
/** Returns an array of min max height values for all the renderable patches in a terrain. The returned array can be modified and then passed to OverrideMinMaxPatchHeights.
|
|
424
|
-
* @returns Minimum and maximum height values for each patch.
|
|
425
|
-
*/
|
|
426
|
-
public GetPatchMinMaxHeights () : System.Array$1<UnityEngine.PatchExtents>
|
|
427
|
-
/** Override the minimum and maximum patch heights for every renderable terrain patch. Note that the overriden values get reset when the terrain resolution is changed and stays unchanged when the terrain heightmap is painted or changed via script.
|
|
428
|
-
* @param $minMaxHeights Array of minimum and maximum terrain patch height values.
|
|
429
|
-
*/
|
|
430
|
-
public OverrideMinMaxPatchHeights ($minMaxHeights: System.Array$1<UnityEngine.PatchExtents>) : void
|
|
431
|
-
/** Returns an array of tesselation maximum height error values per renderable terrain patch. The returned array can be modified and passed to OverrideMaximumHeightError.
|
|
432
|
-
* @returns Float array of maximum height error values.
|
|
433
|
-
*/
|
|
434
|
-
public GetMaximumHeightError () : System.Array$1<number>
|
|
435
|
-
/** Override the maximum tessellation height error with user provided values. Note that the overriden values get reset when the terrain resolution is changed and stays unchanged when the terrain heightmap is painted or changed via script.
|
|
436
|
-
* @param $maxError Provided maximum height error values.
|
|
437
|
-
*/
|
|
438
|
-
public OverrideMaximumHeightError ($maxError: System.Array$1<number>) : void
|
|
439
|
-
/** Sets an array of heightmap samples.
|
|
440
|
-
* @param $xBase First x index of heightmap samples to set.
|
|
441
|
-
* @param $yBase First y index of heightmap samples to set.
|
|
442
|
-
* @param $heights Array of heightmap samples to set (values range from 0 to 1, array indexed as [y,x]).
|
|
443
|
-
*/
|
|
444
|
-
public SetHeightsDelayLOD ($xBase: number, $yBase: number, $heights: System.Array$1<number>) : void
|
|
445
|
-
/** Gets whether a certain point at x,y is a hole.
|
|
446
|
-
*/
|
|
447
|
-
public IsHole ($x: number, $y: number) : boolean
|
|
448
|
-
/** Gets an array of Terrain holes samples.
|
|
449
|
-
* @param $xBase First x index of Terrain holes samples to retrieve.
|
|
450
|
-
* @param $yBase First y index of Terrain holes samples to retrieve.
|
|
451
|
-
* @param $width Number of samples to retrieve along the Terrain holes x axis.
|
|
452
|
-
* @param $height Number of samples to retrieve along the Terrain holes y axis.
|
|
453
|
-
*/
|
|
454
|
-
public GetHoles ($xBase: number, $yBase: number, $width: number, $height: number) : System.Array$1<boolean>
|
|
455
|
-
/** Sets an array of Terrain holes samples.
|
|
456
|
-
* @param $xBase First x index of Terrain holes samples to set.
|
|
457
|
-
* @param $yBase First y index of Terrain holes samples to set.
|
|
458
|
-
* @param $holes Array of Terrain holes samples to set (array indexed as [y,x]).
|
|
459
|
-
*/
|
|
460
|
-
public SetHoles ($xBase: number, $yBase: number, $holes: System.Array$1<boolean>) : void
|
|
461
|
-
/** Sets an array of Terrain holes samples.
|
|
462
|
-
* @param $xBase First x index of Terrain holes samples to set.
|
|
463
|
-
* @param $yBase First y index of Terrain holes samples to set.
|
|
464
|
-
* @param $holes Array of Terrain holes samples to set (array indexed as [y,x]).
|
|
465
|
-
*/
|
|
466
|
-
public SetHolesDelayLOD ($xBase: number, $yBase: number, $holes: System.Array$1<boolean>) : void
|
|
467
|
-
/** Gets the gradient of the terrain at point (x,y).
|
|
468
|
-
*/
|
|
469
|
-
public GetSteepness ($x: number, $y: number) : number
|
|
470
|
-
/** Get an interpolated normal at a given location.
|
|
471
|
-
*/
|
|
472
|
-
public GetInterpolatedNormal ($x: number, $y: number) : UnityEngine.Vector3
|
|
473
|
-
/** Sets the resolution of the detail map.
|
|
474
|
-
* @param $detailResolution Specifies the number of pixels in the detail resolution map. A larger detailResolution, leads to more accurate detail object painting.
|
|
475
|
-
* @param $resolutionPerPatch Specifies the size in pixels of each individually rendered detail patch. A larger number reduces draw calls, but might increase triangle count since detail patches are culled on a per batch basis. A recommended value is 16. If you use a very large detail object distance and your grass is very sparse, it makes sense to increase the value.
|
|
476
|
-
*/
|
|
477
|
-
public SetDetailResolution ($detailResolution: number, $resolutionPerPatch: number) : void
|
|
478
|
-
/** Sets the DetailScatterMode.
|
|
479
|
-
* @param $detailScatterMode Sets the DetailScatterMode that specifies how to represent detail density at each sample of the detail resolution map.
|
|
480
|
-
*/
|
|
481
|
-
public SetDetailScatterMode ($scatterMode: UnityEngine.DetailScatterMode) : void
|
|
482
|
-
/** Reloads all the values of the available prototypes (ie, detail mesh assets) in the TerrainData Object.
|
|
483
|
-
*/
|
|
484
|
-
public RefreshPrototypes () : void
|
|
485
|
-
/** Returns an array of all supported detail layer indices in the area.
|
|
486
|
-
*/
|
|
487
|
-
public GetSupportedLayers ($xBase: number, $yBase: number, $totalWidth: number, $totalHeight: number) : System.Array$1<number>
|
|
488
|
-
public GetSupportedLayers ($positionBase: UnityEngine.Vector2Int, $size: UnityEngine.Vector2Int) : System.Array$1<number>
|
|
489
|
-
/** Returns a 2D array of the detail object density (i.e. the number of detail objects for this layer) in the specific location.
|
|
490
|
-
* @param $xBase First x index of detail object density data to retrieve.
|
|
491
|
-
* @param $yBase First y index of detail object density data to retrieve.
|
|
492
|
-
* @param $width The amount of detail object density data to retrieve along the Terrain's x axis.
|
|
493
|
-
* @param $height The amount of detail object density data to retrieve along the Terrain's z axis.
|
|
494
|
-
* @param $layer The index of the detail in the TerrainData.detailPrototypes array.
|
|
495
|
-
*/
|
|
496
|
-
public GetDetailLayer ($xBase: number, $yBase: number, $width: number, $height: number, $layer: number) : System.Array$1<number>
|
|
497
|
-
public GetDetailLayer ($positionBase: UnityEngine.Vector2Int, $size: UnityEngine.Vector2Int, $layer: number) : System.Array$1<number>
|
|
498
|
-
/** This function computes and returns an array of detail object transforms for the specified patch and the specified prototype. You can use this function to retrieve the exact same transform data the Unity engine uses for detail rendering.
|
|
499
|
-
* @param $patchX The x index of the patch.
|
|
500
|
-
* @param $patchY The y index of the patch.
|
|
501
|
-
* @param $layer The prototype index.
|
|
502
|
-
* @param $density The density setting of the detail.
|
|
503
|
-
* @param $bounds Returns the bounds of the detail objects.
|
|
504
|
-
*/
|
|
505
|
-
public ComputeDetailInstanceTransforms ($patchX: number, $patchY: number, $layer: number, $density: number, $bounds: $Ref<UnityEngine.Bounds>) : System.Array$1<UnityEngine.DetailInstanceTransform>
|
|
506
|
-
/** This function computes and returns the coverage (how many instances fit in a square unit) of a detail prototype, given its index.
|
|
507
|
-
*/
|
|
508
|
-
public ComputeDetailCoverage ($detailPrototypeIndex: number) : number
|
|
509
|
-
/** Sets the detail layer density map.
|
|
510
|
-
*/
|
|
511
|
-
public SetDetailLayer ($xBase: number, $yBase: number, $layer: number, $details: System.Array$1<number>) : void
|
|
512
|
-
public SetDetailLayer ($basePosition: UnityEngine.Vector2Int, $layer: number, $details: System.Array$1<number>) : void
|
|
513
|
-
/** Returns an array of detail patches, which are each identified by X-Z coordinates. Detail objects in the patches are clamped to the maximum count.
|
|
514
|
-
* @param $density The detail density value. See Terrain.detailObjectDensity.
|
|
515
|
-
*/
|
|
516
|
-
public GetClampedDetailPatches ($density: number) : System.Array$1<UnityEngine.Vector2Int>
|
|
517
|
-
/** Sets the Tree Instance array, and optionally snaps Trees onto the surface of the Terrain heightmap.
|
|
518
|
-
* @param $instances The array of TreeInstance objects.
|
|
519
|
-
* @param $snapToHeightmap Specifies whether to snap Trees to the Terrain heightmap.
|
|
520
|
-
*/
|
|
521
|
-
public SetTreeInstances ($instances: System.Array$1<UnityEngine.TreeInstance>, $snapToHeightmap: boolean) : void
|
|
522
|
-
/** Gets the tree instance at the specified index. It is used as a faster version of treeInstances[index] as this function doesn't create the entire tree instances array.
|
|
523
|
-
* @param $index The index of the tree instance.
|
|
524
|
-
*/
|
|
525
|
-
public GetTreeInstance ($index: number) : UnityEngine.TreeInstance
|
|
526
|
-
/** Sets the tree instance with new parameters at the specified index. However, you cannot change TreeInstance.prototypeIndex and TreeInstance.position. If you change them, the method throws an ArgumentException.
|
|
527
|
-
* @param $index The index of the tree instance.
|
|
528
|
-
* @param $instance The new TreeInstance value.
|
|
529
|
-
*/
|
|
530
|
-
public SetTreeInstance ($index: number, $instance: UnityEngine.TreeInstance) : void
|
|
531
|
-
/** Removes the detail prototype at the specified index.
|
|
532
|
-
* @param $index The index of the detail prototype.
|
|
533
|
-
*/
|
|
534
|
-
public RemoveDetailPrototype ($index: number) : void
|
|
535
|
-
/** Returns the alpha map at a position x, y given a width and height.
|
|
536
|
-
* @param $x The x offset to read from.
|
|
537
|
-
* @param $y The y offset to read from.
|
|
538
|
-
* @param $width The width of the alpha map area to read.
|
|
539
|
-
* @param $height The height of the alpha map area to read.
|
|
540
|
-
* @returns A 3D array of floats, where the 3rd dimension represents the mixing weight of each splatmap at each x,y coordinate.
|
|
541
|
-
*/
|
|
542
|
-
public GetAlphamaps ($x: number, $y: number, $width: number, $height: number) : System.Array$1<number>
|
|
543
|
-
/** Assign all splat values in the given map area.
|
|
544
|
-
*/
|
|
545
|
-
public SetAlphamaps ($x: number, $y: number, $map: System.Array$1<number>) : void
|
|
546
|
-
/** Marks the terrain data as dirty to trigger an update of the terrain basemap texture.
|
|
547
|
-
*/
|
|
548
|
-
public SetBaseMapDirty () : void
|
|
549
|
-
/** Returns the alphamap texture at the specified index.
|
|
550
|
-
* @param $index Index of the alphamap.
|
|
551
|
-
* @returns Alphamap texture at the specified index.
|
|
552
|
-
*/
|
|
553
|
-
public GetAlphamapTexture ($index: number) : UnityEngine.Texture2D
|
|
554
|
-
/** This function sets the terrainLayers property, and in addition, registers the action to the Editor's undo stack.
|
|
555
|
-
* @param $terrainLayers The Terrain Layer assets to set.
|
|
556
|
-
* @param $undoName The name of the Editor's undo action.
|
|
557
|
-
*/
|
|
558
|
-
public SetTerrainLayersRegisterUndo ($terrainLayers: System.Array$1<UnityEngine.TerrainLayer>, $undoName: string) : void
|
|
559
|
-
/** Performs synchronization queued by previous calls to CopyActiveRenderTextureToHeightmap and DirtyHeightmapRegion, which makes the height data and LOD data used for tessellation up to date.
|
|
560
|
-
*/
|
|
561
|
-
public SyncHeightmap () : void
|
|
562
|
-
/** Copies the specified part of the active RenderTexture to the Terrain heightmap texture.
|
|
563
|
-
* @param $sourceRect The part of the active Render Texture to copy.
|
|
564
|
-
* @param $dest The X and Y coordinates of the heightmap texture to copy into.
|
|
565
|
-
* @param $syncControl Controls how CPU synchronization is performed.
|
|
566
|
-
*/
|
|
567
|
-
public CopyActiveRenderTextureToHeightmap ($sourceRect: UnityEngine.RectInt, $dest: UnityEngine.Vector2Int, $syncControl: UnityEngine.TerrainHeightmapSyncControl) : void
|
|
568
|
-
/** Marks the specified part of the heightmap as dirty.
|
|
569
|
-
* @param $region The rectangular region to mark as dirty.
|
|
570
|
-
* @param $syncControl Controls how CPU synchronization is performed.
|
|
571
|
-
*/
|
|
572
|
-
public DirtyHeightmapRegion ($region: UnityEngine.RectInt, $syncControl: UnityEngine.TerrainHeightmapSyncControl) : void
|
|
573
|
-
/** Copies the specified part of the active RenderTexture to the Terrain texture.
|
|
574
|
-
* @param $textureName The name of the Terrain texture to copy into.
|
|
575
|
-
* @param $textureIndex The index of the Terrain texture to copy into.
|
|
576
|
-
* @param $sourceRect The part of the active Render Texture to copy.
|
|
577
|
-
* @param $dest The X and Y coordinates of the Terrain texture to copy into.
|
|
578
|
-
* @param $allowDelayedCPUSync Specifies whether to allow delayed CPU synchronization of the texture.
|
|
579
|
-
*/
|
|
580
|
-
public CopyActiveRenderTextureToTexture ($textureName: string, $textureIndex: number, $sourceRect: UnityEngine.RectInt, $dest: UnityEngine.Vector2Int, $allowDelayedCPUSync: boolean) : void
|
|
581
|
-
/** Marks the specified part of the Terrain texture as dirty.
|
|
582
|
-
* @param $textureName The name of the Terrain texture.
|
|
583
|
-
* @param $region The rectangular region to mark as dirty.
|
|
584
|
-
* @param $allowDelayedCPUSync Specifies whether to allow delayed CPU synchronization of the texture.
|
|
585
|
-
*/
|
|
586
|
-
public DirtyTextureRegion ($textureName: string, $region: UnityEngine.RectInt, $allowDelayedCPUSync: boolean) : void
|
|
587
|
-
/** Performs synchronization queued by previous calls to CopyActiveRenderTextureToTexture and DirtyTextureRegion, which makes CPU data of the Terrain textures up to date.
|
|
588
|
-
* @param $textureName The name of the Terrain texture to synchronize.
|
|
589
|
-
*/
|
|
590
|
-
public SyncTexture ($textureName: string) : void
|
|
591
|
-
public constructor ()
|
|
592
|
-
}
|
|
593
|
-
/** Contains information about a tree placed in the Terrain game object.
|
|
594
|
-
*/
|
|
595
|
-
class TreeInstance extends System.ValueType
|
|
596
|
-
{
|
|
597
|
-
protected [__keep_incompatibility]: never;
|
|
598
|
-
/** Position of the tree.
|
|
599
|
-
*/
|
|
600
|
-
public position : UnityEngine.Vector3
|
|
601
|
-
/** Width scale of this instance (compared to the prototype's size).
|
|
602
|
-
*/
|
|
603
|
-
public widthScale : number
|
|
604
|
-
/** Height scale of this instance (compared to the prototype's size).
|
|
605
|
-
*/
|
|
606
|
-
public heightScale : number
|
|
607
|
-
/** Read-only.
|
|
608
|
-
Rotation of the tree on X-Z plane (in radians).
|
|
609
|
-
*/
|
|
610
|
-
public rotation : number
|
|
611
|
-
/** Color of this instance.
|
|
612
|
-
*/
|
|
613
|
-
public color : UnityEngine.Color32
|
|
614
|
-
/** Lightmap color calculated for this instance.
|
|
615
|
-
*/
|
|
616
|
-
public lightmapColor : UnityEngine.Color32
|
|
617
|
-
/** Index of this instance in the TerrainData.treePrototypes array.
|
|
618
|
-
*/
|
|
619
|
-
public prototypeIndex : number
|
|
620
|
-
}
|
|
621
|
-
/** Options for motion vector rendering on the terrain.
|
|
622
|
-
*/
|
|
623
|
-
enum TreeMotionVectorModeOverride
|
|
624
|
-
{ CameraMotionOnly = 0, PerObjectMotion = 1, ForceNoMotion = 2, InheritFromPrototype = 3 }
|
|
625
|
-
/** Extension methods to the Terrain class, used only for the UpdateGIMaterials method used by the Global Illumination System.
|
|
626
|
-
*/
|
|
627
|
-
class TerrainExtensions extends System.Object
|
|
628
|
-
{
|
|
629
|
-
protected [__keep_incompatibility]: never;
|
|
630
|
-
/** Schedules an update of the albedo and emissive Textures of a system that contains the Terrain.
|
|
631
|
-
*/
|
|
632
|
-
public static UpdateGIMaterials ($terrain: UnityEngine.Terrain) : void
|
|
633
|
-
/** Schedules an update of the albedo and emissive Textures of a system that contains the Terrain.
|
|
634
|
-
*/
|
|
635
|
-
public static UpdateGIMaterials ($terrain: UnityEngine.Terrain, $x: number, $y: number, $width: number, $height: number) : void
|
|
636
|
-
}
|
|
637
|
-
/** Tree Component for the tree creator.
|
|
638
|
-
*/
|
|
639
|
-
class Tree extends UnityEngine.Component
|
|
640
|
-
{
|
|
641
|
-
protected [__keep_incompatibility]: never;
|
|
642
|
-
/** Data asociated to the Tree.
|
|
643
|
-
*/
|
|
644
|
-
public get data(): UnityEngine.ScriptableObject;
|
|
645
|
-
public set data(value: UnityEngine.ScriptableObject);
|
|
646
|
-
/** Tells if there is wind data exported from SpeedTree are saved on this component.
|
|
647
|
-
*/
|
|
648
|
-
public get hasSpeedTreeWind(): boolean;
|
|
649
|
-
public constructor ()
|
|
650
|
-
}
|
|
651
|
-
/** This static class provides events that Unity triggers when Terrain data changes.
|
|
652
|
-
*/
|
|
653
|
-
class TerrainCallbacks extends System.Object
|
|
654
|
-
{
|
|
655
|
-
protected [__keep_incompatibility]: never;
|
|
656
|
-
public static add_heightmapChanged ($value: UnityEngine.TerrainCallbacks.HeightmapChangedCallback) : void
|
|
657
|
-
public static remove_heightmapChanged ($value: UnityEngine.TerrainCallbacks.HeightmapChangedCallback) : void
|
|
658
|
-
public static add_textureChanged ($value: UnityEngine.TerrainCallbacks.TextureChangedCallback) : void
|
|
659
|
-
public static remove_textureChanged ($value: UnityEngine.TerrainCallbacks.TextureChangedCallback) : void
|
|
660
|
-
}
|
|
661
|
-
/** Simple class that contains a pointer to a tree prototype.
|
|
662
|
-
*/
|
|
663
|
-
class TreePrototype extends System.Object
|
|
664
|
-
{
|
|
665
|
-
protected [__keep_incompatibility]: never;
|
|
666
|
-
/** Retrieves the actual GameObject used by the tree.
|
|
667
|
-
*/
|
|
668
|
-
public get prefab(): UnityEngine.GameObject;
|
|
669
|
-
public set prefab(value: UnityEngine.GameObject);
|
|
670
|
-
/** Bend factor of the tree prototype.
|
|
671
|
-
*/
|
|
672
|
-
public get bendFactor(): number;
|
|
673
|
-
public set bendFactor(value: number);
|
|
674
|
-
/** The LOD index of a Tree LODGroup that Unity uses to generate a NavMesh. It uses this value only for Trees with a LODGroup, and ignores this value for regular Trees.
|
|
675
|
-
*/
|
|
676
|
-
public get navMeshLod(): number;
|
|
677
|
-
public set navMeshLod(value: number);
|
|
678
|
-
public constructor ()
|
|
679
|
-
public constructor ($other: UnityEngine.TreePrototype)
|
|
680
|
-
}
|
|
681
|
-
/** Render mode for detail prototypes.
|
|
682
|
-
*/
|
|
683
|
-
enum DetailRenderMode
|
|
684
|
-
{ GrassBillboard = 0, VertexLit = 1, Grass = 2 }
|
|
685
|
-
/** Provides options to specify how details are scattered on the terrain.
|
|
686
|
-
*/
|
|
687
|
-
enum DetailScatterMode
|
|
688
|
-
{ CoverageMode = 0, InstanceCountMode = 1 }
|
|
689
|
-
/** Detail prototype used by the Terrain GameObject.
|
|
690
|
-
*/
|
|
691
|
-
class DetailPrototype extends System.Object
|
|
692
|
-
{
|
|
693
|
-
protected [__keep_incompatibility]: never;
|
|
694
|
-
/** GameObject used by the DetailPrototype.
|
|
695
|
-
*/
|
|
696
|
-
public get prototype(): UnityEngine.GameObject;
|
|
697
|
-
public set prototype(value: UnityEngine.GameObject);
|
|
698
|
-
/** Texture used by the DetailPrototype.
|
|
699
|
-
*/
|
|
700
|
-
public get prototypeTexture(): UnityEngine.Texture2D;
|
|
701
|
-
public set prototypeTexture(value: UnityEngine.Texture2D);
|
|
702
|
-
/** Minimum width of the grass billboards (if render mode is GrassBillboard).
|
|
703
|
-
*/
|
|
704
|
-
public get minWidth(): number;
|
|
705
|
-
public set minWidth(value: number);
|
|
706
|
-
/** Maximum width of the grass billboards (if render mode is GrassBillboard).
|
|
707
|
-
*/
|
|
708
|
-
public get maxWidth(): number;
|
|
709
|
-
public set maxWidth(value: number);
|
|
710
|
-
/** Minimum height of the grass billboards (if render mode is GrassBillboard).
|
|
711
|
-
*/
|
|
712
|
-
public get minHeight(): number;
|
|
713
|
-
public set minHeight(value: number);
|
|
714
|
-
/** Maximum height of the grass billboards (if render mode is GrassBillboard).
|
|
715
|
-
*/
|
|
716
|
-
public get maxHeight(): number;
|
|
717
|
-
public set maxHeight(value: number);
|
|
718
|
-
/** Specifies the random seed value for detail object placement.
|
|
719
|
-
*/
|
|
720
|
-
public get noiseSeed(): number;
|
|
721
|
-
public set noiseSeed(value: number);
|
|
722
|
-
/** Controls the spatial frequency of the noise pattern used to vary the scale and color of the detail objects.
|
|
723
|
-
*/
|
|
724
|
-
public get noiseSpread(): number;
|
|
725
|
-
public set noiseSpread(value: number);
|
|
726
|
-
/** Controls detail density for this detail prototype, relative to it's size.
|
|
727
|
-
*/
|
|
728
|
-
public get density(): number;
|
|
729
|
-
public set density(value: number);
|
|
730
|
-
/** Controls how far away detail objects are from the edge of the hole area.
|
|
731
|
-
*/
|
|
732
|
-
public get holeEdgePadding(): number;
|
|
733
|
-
public set holeEdgePadding(value: number);
|
|
734
|
-
/** Color when the DetailPrototypes are "healthy".
|
|
735
|
-
*/
|
|
736
|
-
public get healthyColor(): UnityEngine.Color;
|
|
737
|
-
public set healthyColor(value: UnityEngine.Color);
|
|
738
|
-
/** Color when the DetailPrototypes are "dry".
|
|
739
|
-
*/
|
|
740
|
-
public get dryColor(): UnityEngine.Color;
|
|
741
|
-
public set dryColor(value: UnityEngine.Color);
|
|
742
|
-
/** Render mode for the DetailPrototype.
|
|
743
|
-
*/
|
|
744
|
-
public get renderMode(): UnityEngine.DetailRenderMode;
|
|
745
|
-
public set renderMode(value: UnityEngine.DetailRenderMode);
|
|
746
|
-
/** Indicates whether this detail prototype uses the Mesh object from the GameObject specified by prototype.
|
|
747
|
-
*/
|
|
748
|
-
public get usePrototypeMesh(): boolean;
|
|
749
|
-
public set usePrototypeMesh(value: boolean);
|
|
750
|
-
/** Indicates whether this detail prototype uses for rendering.
|
|
751
|
-
*/
|
|
752
|
-
public get useInstancing(): boolean;
|
|
753
|
-
public set useInstancing(value: boolean);
|
|
754
|
-
/** Controls the detail's target coverage.
|
|
755
|
-
*/
|
|
756
|
-
public get targetCoverage(): number;
|
|
757
|
-
public set targetCoverage(value: number);
|
|
758
|
-
/** Indicates the global density scale set in the terrain settings affects this detail prototype.
|
|
759
|
-
*/
|
|
760
|
-
public get useDensityScaling(): boolean;
|
|
761
|
-
public set useDensityScaling(value: boolean);
|
|
762
|
-
/** Rotate detail axis parallel to the ground's normal direction, so that the detail is perpendicular to the ground.
|
|
763
|
-
*/
|
|
764
|
-
public get alignToGround(): number;
|
|
765
|
-
public set alignToGround(value: number);
|
|
766
|
-
/** Controls how Unity generates the detail positions.
|
|
767
|
-
*/
|
|
768
|
-
public get positionJitter(): number;
|
|
769
|
-
public set positionJitter(value: number);
|
|
770
|
-
/** Returns true if the detail prototype is valid and the Terrain can accept it.
|
|
771
|
-
* @param $errorMessage Returns a message that indicates the cause of failed validation.
|
|
772
|
-
*/
|
|
773
|
-
public Validate () : boolean
|
|
774
|
-
/** Returns true if the detail prototype is valid and the Terrain can accept it.
|
|
775
|
-
* @param $errorMessage Returns a message that indicates the cause of failed validation.
|
|
776
|
-
*/
|
|
777
|
-
public Validate ($errorMessage: $Ref<string>) : boolean
|
|
778
|
-
public constructor ()
|
|
779
|
-
public constructor ($other: UnityEngine.DetailPrototype)
|
|
780
|
-
}
|
|
781
|
-
/** A Splat prototype is just a texture that is used by the TerrainData.
|
|
782
|
-
*/
|
|
783
|
-
class SplatPrototype extends System.Object
|
|
784
|
-
{
|
|
785
|
-
protected [__keep_incompatibility]: never;
|
|
786
|
-
/** Texture of the splat applied to the Terrain.
|
|
787
|
-
*/
|
|
788
|
-
public get texture(): UnityEngine.Texture2D;
|
|
789
|
-
public set texture(value: UnityEngine.Texture2D);
|
|
790
|
-
/** Normal map of the splat applied to the Terrain.
|
|
791
|
-
*/
|
|
792
|
-
public get normalMap(): UnityEngine.Texture2D;
|
|
793
|
-
public set normalMap(value: UnityEngine.Texture2D);
|
|
794
|
-
/** Size of the tile used in the texture of the SplatPrototype.
|
|
795
|
-
*/
|
|
796
|
-
public get tileSize(): UnityEngine.Vector2;
|
|
797
|
-
public set tileSize(value: UnityEngine.Vector2);
|
|
798
|
-
/** Offset of the tile texture of the SplatPrototype.
|
|
799
|
-
*/
|
|
800
|
-
public get tileOffset(): UnityEngine.Vector2;
|
|
801
|
-
public set tileOffset(value: UnityEngine.Vector2);
|
|
802
|
-
public get specular(): UnityEngine.Color;
|
|
803
|
-
public set specular(value: UnityEngine.Color);
|
|
804
|
-
/** The metallic value of the splat layer.
|
|
805
|
-
*/
|
|
806
|
-
public get metallic(): number;
|
|
807
|
-
public set metallic(value: number);
|
|
808
|
-
/** The smoothness value of the splat layer when the main texture has no alpha channel.
|
|
809
|
-
*/
|
|
810
|
-
public get smoothness(): number;
|
|
811
|
-
public set smoothness(value: number);
|
|
812
|
-
public constructor ()
|
|
813
|
-
}
|
|
814
|
-
/** Structure containing minimum and maximum terrain patch height values.
|
|
815
|
-
*/
|
|
816
|
-
class PatchExtents extends System.ValueType
|
|
817
|
-
{
|
|
818
|
-
protected [__keep_incompatibility]: never;
|
|
819
|
-
/** Minimum height of a terrain patch.
|
|
820
|
-
*/
|
|
821
|
-
public get min(): number;
|
|
822
|
-
public set min(value: number);
|
|
823
|
-
/** Maximum height of a terrain patch.
|
|
824
|
-
*/
|
|
825
|
-
public get max(): number;
|
|
826
|
-
public set max(value: number);
|
|
827
|
-
}
|
|
828
|
-
/** Controls what Terrain heightmap data to synchronize when there are changes to the heightmap texture.
|
|
829
|
-
*/
|
|
830
|
-
enum TerrainHeightmapSyncControl
|
|
831
|
-
{ None = 0, HeightOnly = 1, HeightAndLod = 2 }
|
|
832
|
-
/** Describes the transform of a Terrain detail object.
|
|
833
|
-
*/
|
|
834
|
-
class DetailInstanceTransform extends System.ValueType
|
|
835
|
-
{
|
|
836
|
-
protected [__keep_incompatibility]: never;
|
|
837
|
-
/** The X coordinate of the detail object in the Terrain's local space. To get the X in world space, add this value to position X of the Terrain.
|
|
838
|
-
*/
|
|
839
|
-
public posX : number
|
|
840
|
-
/** The Y coordinate of the detail object in the Terrain's local space. To get the Y in world space, add this value to position Y of the Terrain.
|
|
841
|
-
*/
|
|
842
|
-
public posY : number
|
|
843
|
-
/** The Z coordinate of the detail object in the Terrain's local space. To get the Z in world space, add this value to position Z of the Terrain.
|
|
844
|
-
*/
|
|
845
|
-
public posZ : number
|
|
846
|
-
/** The X and Z scale values of the detail object. These two values are always the same.
|
|
847
|
-
*/
|
|
848
|
-
public scaleXZ : number
|
|
849
|
-
/** The Y scale value of the detail object.
|
|
850
|
-
*/
|
|
851
|
-
public scaleY : number
|
|
852
|
-
/** The angle, in radians, at which the detail object rotates around the Y-axis.
|
|
853
|
-
*/
|
|
854
|
-
public rotationY : number
|
|
855
|
-
}
|
|
856
|
-
/** Description of a terrain layer.
|
|
857
|
-
*/
|
|
858
|
-
class TerrainLayer extends UnityEngine.Object
|
|
859
|
-
{
|
|
860
|
-
protected [__keep_incompatibility]: never;
|
|
861
|
-
/** The diffuse texture used by the terrain layer.
|
|
862
|
-
*/
|
|
863
|
-
public get diffuseTexture(): UnityEngine.Texture2D;
|
|
864
|
-
public set diffuseTexture(value: UnityEngine.Texture2D);
|
|
865
|
-
/** Normal map texture used by the terrain layer.
|
|
866
|
-
*/
|
|
867
|
-
public get normalMapTexture(): UnityEngine.Texture2D;
|
|
868
|
-
public set normalMapTexture(value: UnityEngine.Texture2D);
|
|
869
|
-
/** The mask map texture used by the terrain layer.
|
|
870
|
-
*/
|
|
871
|
-
public get maskMapTexture(): UnityEngine.Texture2D;
|
|
872
|
-
public set maskMapTexture(value: UnityEngine.Texture2D);
|
|
873
|
-
/** UV Tiling size.
|
|
874
|
-
*/
|
|
875
|
-
public get tileSize(): UnityEngine.Vector2;
|
|
876
|
-
public set tileSize(value: UnityEngine.Vector2);
|
|
877
|
-
/** UV tiling offset.
|
|
878
|
-
*/
|
|
879
|
-
public get tileOffset(): UnityEngine.Vector2;
|
|
880
|
-
public set tileOffset(value: UnityEngine.Vector2);
|
|
881
|
-
/** Specular color.
|
|
882
|
-
*/
|
|
883
|
-
public get specular(): UnityEngine.Color;
|
|
884
|
-
public set specular(value: UnityEngine.Color);
|
|
885
|
-
/** Metallic factor used by the terrain layer.
|
|
886
|
-
*/
|
|
887
|
-
public get metallic(): number;
|
|
888
|
-
public set metallic(value: number);
|
|
889
|
-
/** Smoothness of the specular reflection.
|
|
890
|
-
*/
|
|
891
|
-
public get smoothness(): number;
|
|
892
|
-
public set smoothness(value: number);
|
|
893
|
-
/** A float value that scales the normal vector. The minimum value is 0, the maximum value is 1.
|
|
894
|
-
*/
|
|
895
|
-
public get normalScale(): number;
|
|
896
|
-
public set normalScale(value: number);
|
|
897
|
-
/** A Vector4 value specifying the minimum RGBA value that the diffuse texture maps to when the value of the channel is 0.
|
|
898
|
-
*/
|
|
899
|
-
public get diffuseRemapMin(): UnityEngine.Vector4;
|
|
900
|
-
public set diffuseRemapMin(value: UnityEngine.Vector4);
|
|
901
|
-
/** A Vector4 value specifying the maximum RGBA value that the diffuse texture maps to when the value of the channel is 1.
|
|
902
|
-
*/
|
|
903
|
-
public get diffuseRemapMax(): UnityEngine.Vector4;
|
|
904
|
-
public set diffuseRemapMax(value: UnityEngine.Vector4);
|
|
905
|
-
/** A Vector4 value specifying the minimum RGBA value that the mask map texture maps to when the value of the channel is 0.
|
|
906
|
-
*/
|
|
907
|
-
public get maskMapRemapMin(): UnityEngine.Vector4;
|
|
908
|
-
public set maskMapRemapMin(value: UnityEngine.Vector4);
|
|
909
|
-
/** A Vector4 value specifying the maximum RGBA value that the mask map texture maps to when the value of the channel is 1.
|
|
910
|
-
*/
|
|
911
|
-
public get maskMapRemapMax(): UnityEngine.Vector4;
|
|
912
|
-
public set maskMapRemapMax(value: UnityEngine.Vector4);
|
|
913
|
-
/** Choose the source for smoothness value.
|
|
914
|
-
*/
|
|
915
|
-
public get smoothnessSource(): UnityEngine.TerrainLayerSmoothnessSource;
|
|
916
|
-
public set smoothnessSource(value: UnityEngine.TerrainLayerSmoothnessSource);
|
|
917
|
-
public constructor ()
|
|
918
|
-
}
|
|
919
|
-
/** Source of smoothness value used in the underlying splat material of a TerrainLayer when TerrainLayer.diffuseTexture has an alpha channel.
|
|
920
|
-
*/
|
|
921
|
-
enum TerrainLayerSmoothnessSource
|
|
922
|
-
{ Constant = 0, DiffuseAlphaChannel = 1 }
|
|
923
|
-
}
|
|
924
|
-
namespace UnityEngine.Terrain {
|
|
925
|
-
enum MaterialType
|
|
926
|
-
{ BuiltInStandard = 0, BuiltInLegacyDiffuse = 1, BuiltInLegacySpecular = 2, Custom = 3 }
|
|
927
|
-
}
|
|
928
|
-
namespace UnityEngine.TerrainCallbacks {
|
|
929
|
-
interface HeightmapChangedCallback
|
|
930
|
-
{
|
|
931
|
-
(terrain: UnityEngine.Terrain, heightRegion: UnityEngine.RectInt, synched: boolean) : void;
|
|
932
|
-
Invoke?: (terrain: UnityEngine.Terrain, heightRegion: UnityEngine.RectInt, synched: boolean) => void;
|
|
933
|
-
}
|
|
934
|
-
var HeightmapChangedCallback: { new (func: (terrain: UnityEngine.Terrain, heightRegion: UnityEngine.RectInt, synched: boolean) => void): HeightmapChangedCallback; }
|
|
935
|
-
interface TextureChangedCallback
|
|
936
|
-
{
|
|
937
|
-
(terrain: UnityEngine.Terrain, textureName: string, texelRegion: UnityEngine.RectInt, synched: boolean) : void;
|
|
938
|
-
Invoke?: (terrain: UnityEngine.Terrain, textureName: string, texelRegion: UnityEngine.RectInt, synched: boolean) => void;
|
|
939
|
-
}
|
|
940
|
-
var TextureChangedCallback: { new (func: (terrain: UnityEngine.Terrain, textureName: string, texelRegion: UnityEngine.RectInt, synched: boolean) => void): TextureChangedCallback; }
|
|
941
|
-
}
|
|
942
|
-
namespace UnityEngine.TerrainUtils {
|
|
943
|
-
/** Specifies a set of 2D tile coordinates.
|
|
944
|
-
*/
|
|
945
|
-
class TerrainTileCoord extends System.ValueType
|
|
946
|
-
{
|
|
947
|
-
protected [__keep_incompatibility]: never;
|
|
948
|
-
/** Tile X coordinate.
|
|
949
|
-
*/
|
|
950
|
-
public tileX : number
|
|
951
|
-
/** Tile Z coordinate.
|
|
952
|
-
*/
|
|
953
|
-
public tileZ : number
|
|
954
|
-
public constructor ($tileX: number, $tileZ: number)
|
|
955
|
-
}
|
|
956
|
-
/** Type for mapping 2D (X,Z) tile coordinates to a Terrain object.
|
|
957
|
-
*/
|
|
958
|
-
class TerrainMap extends System.Object
|
|
959
|
-
{
|
|
960
|
-
protected [__keep_incompatibility]: never;
|
|
961
|
-
/** Mapping from TileCoord to Terrain.
|
|
962
|
-
*/
|
|
963
|
-
public get terrainTiles(): System.Collections.Generic.Dictionary$2<UnityEngine.TerrainUtils.TerrainTileCoord, UnityEngine.Terrain>;
|
|
964
|
-
/** Retrieves the Terrain object corresponding to the tile coordinates (tileX,tileZ).
|
|
965
|
-
* @param $tileX Tile X coordinate.
|
|
966
|
-
* @param $tileZ Tile Z coordinate.
|
|
967
|
-
* @returns Returns a valid Terrain object if successful, null otherwise.
|
|
968
|
-
*/
|
|
969
|
-
public GetTerrain ($tileX: number, $tileZ: number) : UnityEngine.Terrain
|
|
970
|
-
public static CreateFromConnectedNeighbors ($originTerrain: UnityEngine.Terrain, $filter?: System.Predicate$1<UnityEngine.Terrain>, $fullValidation?: boolean) : UnityEngine.TerrainUtils.TerrainMap
|
|
971
|
-
public static CreateFromPlacement ($originTerrain: UnityEngine.Terrain, $filter?: System.Predicate$1<UnityEngine.Terrain>, $fullValidation?: boolean) : UnityEngine.TerrainUtils.TerrainMap
|
|
972
|
-
public static CreateFromPlacement ($gridOrigin: UnityEngine.Vector2, $gridSize: UnityEngine.Vector2, $filter?: System.Predicate$1<UnityEngine.Terrain>, $fullValidation?: boolean) : UnityEngine.TerrainUtils.TerrainMap
|
|
973
|
-
public constructor ()
|
|
974
|
-
}
|
|
975
|
-
/** Provides a set of utility functions that are used by the terrain tools.
|
|
976
|
-
*/
|
|
977
|
-
class TerrainUtility extends System.Object
|
|
978
|
-
{
|
|
979
|
-
protected [__keep_incompatibility]: never;
|
|
980
|
-
/** Automatically connects neighboring terrains.
|
|
981
|
-
*/
|
|
982
|
-
public static AutoConnect () : void
|
|
983
|
-
}
|
|
984
|
-
}
|
|
985
|
-
namespace UnityEngine.TerrainTools {
|
|
986
|
-
/** Represents a linear 2D transformation between brush UV space and a target XY space (typically this is a Terrain-local object space.)
|
|
987
|
-
*/
|
|
988
|
-
class BrushTransform extends System.ValueType
|
|
989
|
-
{
|
|
990
|
-
protected [__keep_incompatibility]: never;
|
|
991
|
-
/** (Read Only) Brush UV origin, in XY space.
|
|
992
|
-
*/
|
|
993
|
-
public get brushOrigin(): UnityEngine.Vector2;
|
|
994
|
-
/** (Read Only) Brush U vector, in XY space.
|
|
995
|
-
*/
|
|
996
|
-
public get brushU(): UnityEngine.Vector2;
|
|
997
|
-
/** (Read Only) Brush V vector, in XY space.
|
|
998
|
-
*/
|
|
999
|
-
public get brushV(): UnityEngine.Vector2;
|
|
1000
|
-
/** (Read Only) Target XY origin, in Brush UV space.
|
|
1001
|
-
*/
|
|
1002
|
-
public get targetOrigin(): UnityEngine.Vector2;
|
|
1003
|
-
/** (Read Only) Target X vector, in Brush UV space.
|
|
1004
|
-
*/
|
|
1005
|
-
public get targetX(): UnityEngine.Vector2;
|
|
1006
|
-
/** (Read Only) Target Y vector, in Brush UV space.
|
|
1007
|
-
*/
|
|
1008
|
-
public get targetY(): UnityEngine.Vector2;
|
|
1009
|
-
/** Get the axis-aligned bounding rectangle of the brush, in target XY space.
|
|
1010
|
-
* @returns Bounding rectangle in target XY space.
|
|
1011
|
-
*/
|
|
1012
|
-
public GetBrushXYBounds () : UnityEngine.Rect
|
|
1013
|
-
/** Creates an axis-aligned BrushTransform from a rectangle.
|
|
1014
|
-
* @param $brushRect Brush rectangle, in target XY coordinates.
|
|
1015
|
-
* @returns BrushTransform describing the brush.
|
|
1016
|
-
*/
|
|
1017
|
-
public static FromRect ($brushRect: UnityEngine.Rect) : UnityEngine.TerrainTools.BrushTransform
|
|
1018
|
-
/** Applies the transform to convert a target XY coordinate to Brush UV space.
|
|
1019
|
-
* @param $targetXY Point in target XY space.
|
|
1020
|
-
* @returns Point transformed to Brush UV space.
|
|
1021
|
-
*/
|
|
1022
|
-
public ToBrushUV ($targetXY: UnityEngine.Vector2) : UnityEngine.Vector2
|
|
1023
|
-
/** Applies the transform to convert a Brush UV coordinate to the target XY space.
|
|
1024
|
-
* @param $brushUV Brush UV coordinate to transform.
|
|
1025
|
-
* @returns Target XY coordinate.
|
|
1026
|
-
*/
|
|
1027
|
-
public FromBrushUV ($brushUV: UnityEngine.Vector2) : UnityEngine.Vector2
|
|
1028
|
-
public constructor ($brushOrigin: UnityEngine.Vector2, $brushU: UnityEngine.Vector2, $brushV: UnityEngine.Vector2)
|
|
1029
|
-
}
|
|
1030
|
-
/** The context for a paint operation that may span multiple connected Terrain tiles.
|
|
1031
|
-
*/
|
|
1032
|
-
class PaintContext extends System.Object
|
|
1033
|
-
{
|
|
1034
|
-
protected [__keep_incompatibility]: never;
|
|
1035
|
-
/** (Read Only) The Terrain used to build the PaintContext.
|
|
1036
|
-
*/
|
|
1037
|
-
public get originTerrain(): UnityEngine.Terrain;
|
|
1038
|
-
/** (Read Only) The pixel rectangle that this PaintContext represents.
|
|
1039
|
-
*/
|
|
1040
|
-
public get pixelRect(): UnityEngine.RectInt;
|
|
1041
|
-
/** (Read Only) The width of the target terrain texture. This is the resolution for a single Terrain.
|
|
1042
|
-
*/
|
|
1043
|
-
public get targetTextureWidth(): number;
|
|
1044
|
-
/** (Read Only) The height of the target terrain texture. This is the resolution for a single Terrain.
|
|
1045
|
-
*/
|
|
1046
|
-
public get targetTextureHeight(): number;
|
|
1047
|
-
/** (Read Only) The size of a PaintContext pixel in terrain units (as defined by originTerrain.)
|
|
1048
|
-
*/
|
|
1049
|
-
public get pixelSize(): UnityEngine.Vector2;
|
|
1050
|
-
/** (Read Only) Render target that stores the original data from the Terrain tiles.
|
|
1051
|
-
*/
|
|
1052
|
-
public get sourceRenderTexture(): UnityEngine.RenderTexture;
|
|
1053
|
-
/** (Read Only) RenderTexture that an edit operation writes to modify the data.
|
|
1054
|
-
*/
|
|
1055
|
-
public get destinationRenderTexture(): UnityEngine.RenderTexture;
|
|
1056
|
-
/** (Read Only) The value of RenderTexture.active at the time CreateRenderTargets is called.
|
|
1057
|
-
*/
|
|
1058
|
-
public get oldRenderTexture(): UnityEngine.RenderTexture;
|
|
1059
|
-
/** (Read Only) The number of Terrain tiles in this PaintContext.
|
|
1060
|
-
*/
|
|
1061
|
-
public get terrainCount(): number;
|
|
1062
|
-
/** The minimum height of all Terrain tiles that this PaintContext touches in world space.
|
|
1063
|
-
*/
|
|
1064
|
-
public get heightWorldSpaceMin(): number;
|
|
1065
|
-
/** The height range (from Min to Max) of all Terrain tiles that this PaintContext touches in world space.
|
|
1066
|
-
*/
|
|
1067
|
-
public get heightWorldSpaceSize(): number;
|
|
1068
|
-
/** Unity uses this value internally to transform a [0, 1] height value to a texel value, which is stored in TerrainData.heightmapTexture.
|
|
1069
|
-
*/
|
|
1070
|
-
public static get kNormalizedHeightScale(): number;
|
|
1071
|
-
/** Retrieves a Terrain from the PaintContext.
|
|
1072
|
-
* @param $terrainIndex Index of the terrain.
|
|
1073
|
-
* @returns Returns the Terrain object.
|
|
1074
|
-
*/
|
|
1075
|
-
public GetTerrain ($terrainIndex: number) : UnityEngine.Terrain
|
|
1076
|
-
/** Retrieves the clipped pixel rectangle for a Terrain.
|
|
1077
|
-
* @param $terrainIndex Index of the Terrain.
|
|
1078
|
-
* @returns Returns the clipped pixel rectangle.
|
|
1079
|
-
*/
|
|
1080
|
-
public GetClippedPixelRectInTerrainPixels ($terrainIndex: number) : UnityEngine.RectInt
|
|
1081
|
-
/** Retrieves the clipped pixel rectangle for a Terrain, relative to the PaintContext render textures.
|
|
1082
|
-
* @param $terrainIndex Index of the Terrain.
|
|
1083
|
-
* @returns Returns the clipped pixel rectangle.
|
|
1084
|
-
*/
|
|
1085
|
-
public GetClippedPixelRectInRenderTexturePixels ($terrainIndex: number) : UnityEngine.RectInt
|
|
1086
|
-
/** Constructs a PaintContext that you can use to edit a texture on a Terrain, in the region defined by boundsInTerrainSpace and extraBorderPixels.
|
|
1087
|
-
* @param $terrain Terrain that defines terrain space for this PaintContext.
|
|
1088
|
-
* @param $boundsInTerrainSpace Terrain space bounds to edit in the target terrain texture.
|
|
1089
|
-
* @param $inputTextureWidth Width of the input Terrain Texture for all connected Terrains.
|
|
1090
|
-
* @param $inputTextureHeight Height of the input Terrain Texture for all connected Terrains.
|
|
1091
|
-
* @param $extraBorderPixels Number of extra border pixels required. The default value is 0.
|
|
1092
|
-
* @param $sharedBoundaryTexel Whether to stretch the Textures so that edge texels lie on the Terrain boundary, and are shared with connected Terrains.
|
|
1093
|
-
* @param $fillOutsideTerrain Whether to fill empty space outside of the Terrain tiles with data from the nearest tile.
|
|
1094
|
-
*/
|
|
1095
|
-
public static CreateFromBounds ($terrain: UnityEngine.Terrain, $boundsInTerrainSpace: UnityEngine.Rect, $inputTextureWidth: number, $inputTextureHeight: number, $extraBorderPixels?: number, $sharedBoundaryTexel?: boolean, $fillOutsideTerrain?: boolean) : UnityEngine.TerrainTools.PaintContext
|
|
1096
|
-
/** Creates the sourceRenderTexture and destinationRenderTexture.
|
|
1097
|
-
* @param $colorFormat Render Texture format.
|
|
1098
|
-
*/
|
|
1099
|
-
public CreateRenderTargets ($colorFormat: UnityEngine.RenderTextureFormat) : void
|
|
1100
|
-
/** Releases the allocated resources of this PaintContext.
|
|
1101
|
-
* @param $restoreRenderTexture When true, indicates that this function restores RenderTexture.active
|
|
1102
|
-
*/
|
|
1103
|
-
public Cleanup ($restoreRenderTexture?: boolean) : void
|
|
1104
|
-
public Gather ($terrainSource: System.Func$2<UnityEngine.TerrainTools.PaintContext.ITerrainInfo, UnityEngine.Texture>, $defaultColor: UnityEngine.Color, $blitMaterial?: UnityEngine.Material, $blitPass?: number, $beforeBlit?: System.Action$1<UnityEngine.TerrainTools.PaintContext.ITerrainInfo>, $afterBlit?: System.Action$1<UnityEngine.TerrainTools.PaintContext.ITerrainInfo>) : void
|
|
1105
|
-
public Scatter ($terrainDest: System.Func$2<UnityEngine.TerrainTools.PaintContext.ITerrainInfo, UnityEngine.RenderTexture>, $blitMaterial?: UnityEngine.Material, $blitPass?: number, $beforeBlit?: System.Action$1<UnityEngine.TerrainTools.PaintContext.ITerrainInfo>, $afterBlit?: System.Action$1<UnityEngine.TerrainTools.PaintContext.ITerrainInfo>) : void
|
|
1106
|
-
/** Gathers the heightmap information into sourceRenderTexture.
|
|
1107
|
-
*/
|
|
1108
|
-
public GatherHeightmap () : void
|
|
1109
|
-
/** Applies an edited heightmap PaintContext by copying modifications back to the source Terrain tiles.
|
|
1110
|
-
* @param $editorUndoName Unique name used for the undo stack.
|
|
1111
|
-
*/
|
|
1112
|
-
public ScatterHeightmap ($editorUndoName: string) : void
|
|
1113
|
-
/** Gathers the Terrain holes information into sourceRenderTexture.
|
|
1114
|
-
*/
|
|
1115
|
-
public GatherHoles () : void
|
|
1116
|
-
/** Applies an edited Terrain holes PaintContext by copying modifications back to the source Terrain tiles.
|
|
1117
|
-
* @param $editorUndoName Unique name used for the undo stack.
|
|
1118
|
-
*/
|
|
1119
|
-
public ScatterHoles ($editorUndoName: string) : void
|
|
1120
|
-
/** Gathers the normal information into sourceRenderTexture.
|
|
1121
|
-
*/
|
|
1122
|
-
public GatherNormals () : void
|
|
1123
|
-
/** Gathers the alphamap information into sourceRenderTexture.
|
|
1124
|
-
* @param $inputLayer TerrainLayer used for painting.
|
|
1125
|
-
* @param $addLayerIfDoesntExist Set to true to specify that the inputLayer is added to the terrain if it does not already exist. Set to false to specify that terrain layers are not added to the terrain.
|
|
1126
|
-
*/
|
|
1127
|
-
public GatherAlphamap ($inputLayer: UnityEngine.TerrainLayer, $addLayerIfDoesntExist?: boolean) : void
|
|
1128
|
-
/** Applies an edited alphamap PaintContext by copying modifications back to the source Terrain tiles.
|
|
1129
|
-
* @param $editorUndoName Unique name used for the undo stack.
|
|
1130
|
-
*/
|
|
1131
|
-
public ScatterAlphamap ($editorUndoName: string) : void
|
|
1132
|
-
/** Flushes the delayed actions created by PaintContext heightmap and alphamap modifications.
|
|
1133
|
-
*/
|
|
1134
|
-
public static ApplyDelayedActions () : void
|
|
1135
|
-
public constructor ($terrain: UnityEngine.Terrain, $pixelRect: UnityEngine.RectInt, $targetTextureWidth: number, $targetTextureHeight: number, $sharedBoundaryTexel?: boolean, $fillOutsideTerrain?: boolean)
|
|
1136
|
-
}
|
|
1137
|
-
/** Built-in render passes for paint material.
|
|
1138
|
-
*/
|
|
1139
|
-
enum TerrainBuiltinPaintMaterialPasses
|
|
1140
|
-
{ RaiseLowerHeight = 0, StampHeight = 1, SetHeights = 2, SmoothHeights = 3, PaintTexture = 4, PaintHoles = 5 }
|
|
1141
|
-
/** A set of utility functions for custom terrain paint tools.
|
|
1142
|
-
*/
|
|
1143
|
-
class TerrainPaintUtility extends System.Object
|
|
1144
|
-
{
|
|
1145
|
-
protected [__keep_incompatibility]: never;
|
|
1146
|
-
/** Returns the built-in in paint material used by the built-in tools.
|
|
1147
|
-
* @returns Built-in terrain paint material.
|
|
1148
|
-
*/
|
|
1149
|
-
public static GetBuiltinPaintMaterial () : UnityEngine.Material
|
|
1150
|
-
/** Calculates the minimum and maximum Brush size limits, in world space.
|
|
1151
|
-
* @param $minBrushWorldSize Returns the minimum Brush size, in world space units.
|
|
1152
|
-
* @param $maxBrushWorldSize Returns the maximum Brush size, in world space units.
|
|
1153
|
-
* @param $terrainTileWorldSize The size of a Terrain tile, in world space units.
|
|
1154
|
-
* @param $terrainTileTextureResolutionPixels The resolution of the Terrain tile texture the Brush edits, in pixels.
|
|
1155
|
-
* @param $minBrushResolutionPixels The minimum Brush resolution, in pixels. Default is 1 pixel.
|
|
1156
|
-
* @param $maxBrushResolutionPixels The maximum Brush resolution, in pixels. Default is 8192 pixels.
|
|
1157
|
-
*/
|
|
1158
|
-
public static GetBrushWorldSizeLimits ($minBrushWorldSize: $Ref<number>, $maxBrushWorldSize: $Ref<number>, $terrainTileWorldSize: number, $terrainTileTextureResolutionPixels: number, $minBrushResolutionPixels?: number, $maxBrushResolutionPixels?: number) : void
|
|
1159
|
-
/** Creates a BrushTransform from the input parameters.
|
|
1160
|
-
* @param $terrain Reference terrain, defines terrain UV and object space.
|
|
1161
|
-
* @param $brushCenterTerrainUV Center point of the brush, in terrain UV space (0-1 across the terrain tile).
|
|
1162
|
-
* @param $brushSize Size of the brush, in terrain space.
|
|
1163
|
-
* @param $brushRotationDegrees Brush rotation in degrees (clockwise).
|
|
1164
|
-
* @returns Transform from terrain space to Brush UVs.
|
|
1165
|
-
*/
|
|
1166
|
-
public static CalculateBrushTransform ($terrain: UnityEngine.Terrain, $brushCenterTerrainUV: UnityEngine.Vector2, $brushSize: number, $brushRotationDegrees: number) : UnityEngine.TerrainTools.BrushTransform
|
|
1167
|
-
/** Builds a Scale & Offset transform to convert between one PaintContext's UV space and another PaintContext's UV space.
|
|
1168
|
-
* @param $src Source PaintContext.
|
|
1169
|
-
* @param $dst Destination PaintContext.
|
|
1170
|
-
* @param $scaleOffset ScaleOffset transform.
|
|
1171
|
-
*/
|
|
1172
|
-
public static BuildTransformPaintContextUVToPaintContextUV ($src: UnityEngine.TerrainTools.PaintContext, $dst: UnityEngine.TerrainTools.PaintContext, $scaleOffset: $Ref<UnityEngine.Vector4>) : void
|
|
1173
|
-
/** Sets up all of the material properties used by functions in TerrainTool.cginc.
|
|
1174
|
-
* @param $paintContext PaintContext describing the area we are editing, and the terrain space.
|
|
1175
|
-
* @param $brushXform BrushTransform from terrain space to Brush UVs.
|
|
1176
|
-
* @param $material Material to populate with transform properties.
|
|
1177
|
-
*/
|
|
1178
|
-
public static SetupTerrainToolMaterialProperties ($paintContext: UnityEngine.TerrainTools.PaintContext, $brushXform: $Ref<UnityEngine.TerrainTools.BrushTransform>, $material: UnityEngine.Material) : void
|
|
1179
|
-
/** Releases the allocated resources of the specified PaintContext.
|
|
1180
|
-
* @param $ctx The PaintContext containing the resources to release.
|
|
1181
|
-
*/
|
|
1182
|
-
public static ReleaseContextResources ($ctx: UnityEngine.TerrainTools.PaintContext) : void
|
|
1183
|
-
/** Helper function to set up a PaintContext for modifying the heightmap of one or more Terrain tiles.
|
|
1184
|
-
* @param $terrain Reference Terrain tile.
|
|
1185
|
-
* @param $boundsInTerrainSpace The region in terrain space to edit.
|
|
1186
|
-
* @param $extraBorderPixels Number of extra border pixels required.
|
|
1187
|
-
* @param $fillOutsideTerrain Whether to fill empty space outside of Terrain tiles with data from the nearest tile.
|
|
1188
|
-
* @returns PaintContext containing the combined heightmap data for the specified region.
|
|
1189
|
-
*/
|
|
1190
|
-
public static BeginPaintHeightmap ($terrain: UnityEngine.Terrain, $boundsInTerrainSpace: UnityEngine.Rect, $extraBorderPixels?: number, $fillOutsideTerrain?: boolean) : UnityEngine.TerrainTools.PaintContext
|
|
1191
|
-
/** Helper function to complete a heightmap modification.
|
|
1192
|
-
* @param $ctx The heightmap paint context to complete.
|
|
1193
|
-
* @param $editorUndoName Unique name used for the undo stack.
|
|
1194
|
-
*/
|
|
1195
|
-
public static EndPaintHeightmap ($ctx: UnityEngine.TerrainTools.PaintContext, $editorUndoName: string) : void
|
|
1196
|
-
/** Helper function to set up a PaintContext for modifying the Terrain holes of one or more Terrain tiles.
|
|
1197
|
-
* @param $terrain Reference Terrain tile.
|
|
1198
|
-
* @param $boundsInTerrainSpace The region in Terrain space to edit.
|
|
1199
|
-
* @param $extraBorderPixels Number of extra border pixels required.
|
|
1200
|
-
* @param $fillOutsideTerrain Whether to fill empty space outside of Terrain tiles with data from the nearest tile.
|
|
1201
|
-
* @returns PaintContext that contains the combined Terrain holes data for the specified region.
|
|
1202
|
-
*/
|
|
1203
|
-
public static BeginPaintHoles ($terrain: UnityEngine.Terrain, $boundsInTerrainSpace: UnityEngine.Rect, $extraBorderPixels?: number, $fillOutsideTerrain?: boolean) : UnityEngine.TerrainTools.PaintContext
|
|
1204
|
-
/** Helper function to complete a Terrain holes modification.
|
|
1205
|
-
* @param $ctx The Terrain holes PaintContext to complete.
|
|
1206
|
-
* @param $editorUndoName Unique name used for the undo stack.
|
|
1207
|
-
*/
|
|
1208
|
-
public static EndPaintHoles ($ctx: UnityEngine.TerrainTools.PaintContext, $editorUndoName: string) : void
|
|
1209
|
-
/** Helper function to set up a PaintContext that collects mesh normal data from one or more Terrain tiles.
|
|
1210
|
-
* @param $terrain Reference Terrain tile.
|
|
1211
|
-
* @param $boundsInTerrainSpace The region in terrain space from which to collect normals.
|
|
1212
|
-
* @param $extraBorderPixels Number of extra border pixels required.
|
|
1213
|
-
* @param $fillOutsideTerrain Whether to fill empty space outside of Terrain tiles with data from the nearest tile.
|
|
1214
|
-
* @returns PaintContext containing the combined normalmap data for the specified region.
|
|
1215
|
-
*/
|
|
1216
|
-
public static CollectNormals ($terrain: UnityEngine.Terrain, $boundsInTerrainSpace: UnityEngine.Rect, $extraBorderPixels?: number, $fillOutsideTerrain?: boolean) : UnityEngine.TerrainTools.PaintContext
|
|
1217
|
-
/** Helper function to set up a PaintContext for modifying the alphamap of one or more Terrain tiles.
|
|
1218
|
-
* @param $terrain Reference Terrain tile.
|
|
1219
|
-
* @param $inputLayer Selects the alphamap to paint.
|
|
1220
|
-
* @param $boundsInTerrainSpace The region in terrain space to edit.
|
|
1221
|
-
* @param $extraBorderPixels Number of extra border pixels required.
|
|
1222
|
-
* @param $fillOutsideTerrain Whether to fill empty space outside of Terrain tiles with data from the nearest tile.
|
|
1223
|
-
* @returns PaintContext containing the combined alphamap data for the specified region.
|
|
1224
|
-
*/
|
|
1225
|
-
public static BeginPaintTexture ($terrain: UnityEngine.Terrain, $boundsInTerrainSpace: UnityEngine.Rect, $inputLayer: UnityEngine.TerrainLayer, $extraBorderPixels?: number, $fillOutsideTerrain?: boolean) : UnityEngine.TerrainTools.PaintContext
|
|
1226
|
-
/** Helper function to complete a texture alphamap modification.
|
|
1227
|
-
* @param $ctx The texture paint context to complete.
|
|
1228
|
-
* @param $editorUndoName Unique name used for the undo stack.
|
|
1229
|
-
*/
|
|
1230
|
-
public static EndPaintTexture ($ctx: UnityEngine.TerrainTools.PaintContext, $editorUndoName: string) : void
|
|
1231
|
-
/** Returns the default material for blitting operations.
|
|
1232
|
-
* @returns Built in "Hidden/BlitCopy" material.
|
|
1233
|
-
*/
|
|
1234
|
-
public static GetBlitMaterial () : UnityEngine.Material
|
|
1235
|
-
/** Returns the Material to use when copying the Terrain heightmap.
|
|
1236
|
-
* @returns Built in "HiddenTerrainEngineHeightBlitCopy" material.
|
|
1237
|
-
*/
|
|
1238
|
-
public static GetHeightBlitMaterial () : UnityEngine.Material
|
|
1239
|
-
/** Returns the default copy terrain layer material.
|
|
1240
|
-
* @returns Built in "HiddenTerrainTerrainLayerUtils" material.
|
|
1241
|
-
*/
|
|
1242
|
-
public static GetCopyTerrainLayerMaterial () : UnityEngine.Material
|
|
1243
|
-
/** Returns the alphamap texture at mapIndex.
|
|
1244
|
-
* @param $terrain Terrain tile.
|
|
1245
|
-
* @param $mapIndex Index to retrieve.
|
|
1246
|
-
* @returns Alphamap texture at mapIndex.
|
|
1247
|
-
*/
|
|
1248
|
-
public static GetTerrainAlphaMapChecked ($terrain: UnityEngine.Terrain, $mapIndex: number) : UnityEngine.Texture2D
|
|
1249
|
-
/** Finds the index of a TerrainLayer in a Terrain tile.
|
|
1250
|
-
* @param $terrain Terrain tile.
|
|
1251
|
-
* @param $inputLayer Terrain layer to search for.
|
|
1252
|
-
* @returns Returns the index of the terrain layer if it exists or -1 if it doesn't exist.
|
|
1253
|
-
*/
|
|
1254
|
-
public static FindTerrainLayerIndex ($terrain: UnityEngine.Terrain, $inputLayer: UnityEngine.TerrainLayer) : number
|
|
1255
|
-
}
|
|
1256
|
-
}
|
|
1257
|
-
namespace UnityEngine.TerrainTools.PaintContext {
|
|
1258
|
-
interface ITerrainInfo
|
|
1259
|
-
{
|
|
1260
|
-
terrain : UnityEngine.Terrain
|
|
1261
|
-
clippedTerrainPixels : UnityEngine.RectInt
|
|
1262
|
-
clippedPCPixels : UnityEngine.RectInt
|
|
1263
|
-
paddedTerrainPixels : UnityEngine.RectInt
|
|
1264
|
-
paddedPCPixels : UnityEngine.RectInt
|
|
1265
|
-
gatherEnable : boolean
|
|
1266
|
-
scatterEnable : boolean
|
|
1267
|
-
userData : any
|
|
1268
|
-
}
|
|
1269
|
-
}
|
|
1270
|
-
}
|
|
1
|
+
|
|
2
|
+
declare namespace CS {
|
|
3
|
+
// const __keep_incompatibility: unique symbol;
|
|
4
|
+
//
|
|
5
|
+
// interface $Ref<T> {
|
|
6
|
+
// value: T
|
|
7
|
+
// }
|
|
8
|
+
// namespace System {
|
|
9
|
+
// interface Array$1<T> extends System.Array {
|
|
10
|
+
// get_Item(index: number):T;
|
|
11
|
+
//
|
|
12
|
+
// set_Item(index: number, value: T):void;
|
|
13
|
+
// }
|
|
14
|
+
// }
|
|
15
|
+
// interface $Task<T> {}
|
|
16
|
+
namespace UnityEngine {
|
|
17
|
+
/** Indicate the types of changes to the terrain in OnTerrainChanged callback.
|
|
18
|
+
*/
|
|
19
|
+
enum TerrainChangedFlags
|
|
20
|
+
{ Heightmap = 1, TreeInstances = 2, DelayedHeightmapUpdate = 4, FlushEverythingImmediately = 8, RemoveDirtyDetailsImmediately = 16, HeightmapResolution = 32, Holes = 64, DelayedHolesUpdate = 128, WillBeDestroyed = 256 }
|
|
21
|
+
/** Enum provding terrain rendering options.
|
|
22
|
+
*/
|
|
23
|
+
enum TerrainRenderFlags
|
|
24
|
+
{ heightmap = 1, trees = 2, details = 4, all = 7, Heightmap = 1, Trees = 2, Details = 4, All = 7 }
|
|
25
|
+
/** The Terrain component renders the terrain.
|
|
26
|
+
*/
|
|
27
|
+
class Terrain extends UnityEngine.Behaviour
|
|
28
|
+
{
|
|
29
|
+
protected [__keep_incompatibility]: never;
|
|
30
|
+
/** The Terrain Data that stores heightmaps, terrain textures, detail meshes and trees.
|
|
31
|
+
*/
|
|
32
|
+
public get terrainData(): UnityEngine.TerrainData;
|
|
33
|
+
public set terrainData(value: UnityEngine.TerrainData);
|
|
34
|
+
/** The maximum distance at which trees are rendered.
|
|
35
|
+
*/
|
|
36
|
+
public get treeDistance(): number;
|
|
37
|
+
public set treeDistance(value: number);
|
|
38
|
+
/** Distance from the camera where trees will be rendered as billboards only.
|
|
39
|
+
*/
|
|
40
|
+
public get treeBillboardDistance(): number;
|
|
41
|
+
public set treeBillboardDistance(value: number);
|
|
42
|
+
/** Total distance delta that trees will use to transition from billboard orientation to mesh orientation.
|
|
43
|
+
*/
|
|
44
|
+
public get treeCrossFadeLength(): number;
|
|
45
|
+
public set treeCrossFadeLength(value: number);
|
|
46
|
+
/** Maximum number of trees rendered at full LOD.
|
|
47
|
+
*/
|
|
48
|
+
public get treeMaximumFullLODCount(): number;
|
|
49
|
+
public set treeMaximumFullLODCount(value: number);
|
|
50
|
+
/** Detail objects will be displayed up to this distance.
|
|
51
|
+
*/
|
|
52
|
+
public get detailObjectDistance(): number;
|
|
53
|
+
public set detailObjectDistance(value: number);
|
|
54
|
+
/** Density of detail objects.
|
|
55
|
+
*/
|
|
56
|
+
public get detailObjectDensity(): number;
|
|
57
|
+
public set detailObjectDensity(value: number);
|
|
58
|
+
/** An approximation of how many pixels the terrain will pop in the worst case when switching lod.
|
|
59
|
+
*/
|
|
60
|
+
public get heightmapPixelError(): number;
|
|
61
|
+
public set heightmapPixelError(value: number);
|
|
62
|
+
/** Limits the Terrain's maximum rendering resolution.
|
|
63
|
+
*/
|
|
64
|
+
public get heightmapMaximumLOD(): number;
|
|
65
|
+
public set heightmapMaximumLOD(value: number);
|
|
66
|
+
/** Limits how simplified the rendered terrain can be.
|
|
67
|
+
*/
|
|
68
|
+
public get heightmapMinimumLODSimplification(): number;
|
|
69
|
+
public set heightmapMinimumLODSimplification(value: number);
|
|
70
|
+
/** Heightmap patches beyond basemap distance will use a precomputed low res basemap.
|
|
71
|
+
*/
|
|
72
|
+
public get basemapDistance(): number;
|
|
73
|
+
public set basemapDistance(value: number);
|
|
74
|
+
/** The index of the baked lightmap applied to this terrain.
|
|
75
|
+
*/
|
|
76
|
+
public get lightmapIndex(): number;
|
|
77
|
+
public set lightmapIndex(value: number);
|
|
78
|
+
/** The index of the realtime lightmap applied to this terrain.
|
|
79
|
+
*/
|
|
80
|
+
public get realtimeLightmapIndex(): number;
|
|
81
|
+
public set realtimeLightmapIndex(value: number);
|
|
82
|
+
/** The UV scale & offset used for a baked lightmap.
|
|
83
|
+
*/
|
|
84
|
+
public get lightmapScaleOffset(): UnityEngine.Vector4;
|
|
85
|
+
public set lightmapScaleOffset(value: UnityEngine.Vector4);
|
|
86
|
+
/** The UV scale & offset used for a realtime lightmap.
|
|
87
|
+
*/
|
|
88
|
+
public get realtimeLightmapScaleOffset(): UnityEngine.Vector4;
|
|
89
|
+
public set realtimeLightmapScaleOffset(value: UnityEngine.Vector4);
|
|
90
|
+
/** Defines whether Unity frees per-Camera rendering resources for the Terrain when those resources aren't in use after a certain number of frames.
|
|
91
|
+
*/
|
|
92
|
+
public get keepUnusedRenderingResources(): boolean;
|
|
93
|
+
public set keepUnusedRenderingResources(value: boolean);
|
|
94
|
+
/** Allows you to set the shadow casting mode for the terrain.
|
|
95
|
+
*/
|
|
96
|
+
public get shadowCastingMode(): UnityEngine.Rendering.ShadowCastingMode;
|
|
97
|
+
public set shadowCastingMode(value: UnityEngine.Rendering.ShadowCastingMode);
|
|
98
|
+
/** How reflection probes are used for terrain. See Rendering.ReflectionProbeUsage.
|
|
99
|
+
*/
|
|
100
|
+
public get reflectionProbeUsage(): UnityEngine.Rendering.ReflectionProbeUsage;
|
|
101
|
+
public set reflectionProbeUsage(value: UnityEngine.Rendering.ReflectionProbeUsage);
|
|
102
|
+
/** The custom material Unity uses to render the Terrain.
|
|
103
|
+
*/
|
|
104
|
+
public get materialTemplate(): UnityEngine.Material;
|
|
105
|
+
public set materialTemplate(value: UnityEngine.Material);
|
|
106
|
+
/** Indicates whether Unity draws the Terrain geometry itself.
|
|
107
|
+
*/
|
|
108
|
+
public get drawHeightmap(): boolean;
|
|
109
|
+
public set drawHeightmap(value: boolean);
|
|
110
|
+
/** Specifies if the terrain tile will be automatically connected to adjacent tiles.
|
|
111
|
+
*/
|
|
112
|
+
public get allowAutoConnect(): boolean;
|
|
113
|
+
public set allowAutoConnect(value: boolean);
|
|
114
|
+
/** Grouping ID for auto connect.
|
|
115
|
+
*/
|
|
116
|
+
public get groupingID(): number;
|
|
117
|
+
public set groupingID(value: number);
|
|
118
|
+
/** Set to true to enable the terrain instance renderer. The default value is false.
|
|
119
|
+
*/
|
|
120
|
+
public get drawInstanced(): boolean;
|
|
121
|
+
public set drawInstanced(value: boolean);
|
|
122
|
+
/** When this options is enabled, Terrain heightmap geometries will be added in acceleration structures used for Ray Tracing.
|
|
123
|
+
*/
|
|
124
|
+
public get enableHeightmapRayTracing(): boolean;
|
|
125
|
+
public set enableHeightmapRayTracing(value: boolean);
|
|
126
|
+
/** Returns the normal map texture computed from sampling the heightmap. It is only used when terrain is rendered using instancing.
|
|
127
|
+
*/
|
|
128
|
+
public get normalmapTexture(): UnityEngine.RenderTexture;
|
|
129
|
+
/** Specify if terrain trees and details should be drawn.
|
|
130
|
+
*/
|
|
131
|
+
public get drawTreesAndFoliage(): boolean;
|
|
132
|
+
public set drawTreesAndFoliage(value: boolean);
|
|
133
|
+
/** Set the terrain bounding box scale.
|
|
134
|
+
*/
|
|
135
|
+
public get patchBoundsMultiplier(): UnityEngine.Vector3;
|
|
136
|
+
public set patchBoundsMultiplier(value: UnityEngine.Vector3);
|
|
137
|
+
/** The multiplier to the current LOD bias used for rendering LOD trees (i.e. SpeedTree trees).
|
|
138
|
+
*/
|
|
139
|
+
public get treeLODBiasMultiplier(): number;
|
|
140
|
+
public set treeLODBiasMultiplier(value: number);
|
|
141
|
+
/** Collect detail patches from memory.
|
|
142
|
+
*/
|
|
143
|
+
public get collectDetailPatches(): boolean;
|
|
144
|
+
public set collectDetailPatches(value: boolean);
|
|
145
|
+
/** When enabled, the terrain ignores the terrain overrides set in the QualitySettings.
|
|
146
|
+
*/
|
|
147
|
+
public get ignoreQualitySettings(): boolean;
|
|
148
|
+
public set ignoreQualitySettings(value: boolean);
|
|
149
|
+
/** Controls what part of the terrain should be rendered.
|
|
150
|
+
*/
|
|
151
|
+
public get editorRenderFlags(): UnityEngine.TerrainRenderFlags;
|
|
152
|
+
public set editorRenderFlags(value: UnityEngine.TerrainRenderFlags);
|
|
153
|
+
/** Whether to bake an array of internal light probes for Tree Editor trees (Editor only).
|
|
154
|
+
*/
|
|
155
|
+
public get bakeLightProbesForTrees(): boolean;
|
|
156
|
+
public set bakeLightProbesForTrees(value: boolean);
|
|
157
|
+
/** Removes ringing from light probes on Tree Editor trees (Editor only).
|
|
158
|
+
*/
|
|
159
|
+
public get deringLightProbesForTrees(): boolean;
|
|
160
|
+
public set deringLightProbesForTrees(value: boolean);
|
|
161
|
+
/** The motion vector rendering mode for all SpeedTree models painted on the terrain.
|
|
162
|
+
*/
|
|
163
|
+
public get treeMotionVectorModeOverride(): UnityEngine.TreeMotionVectorModeOverride;
|
|
164
|
+
public set treeMotionVectorModeOverride(value: UnityEngine.TreeMotionVectorModeOverride);
|
|
165
|
+
/** Allows you to specify how Unity chooses the for tree instances.
|
|
166
|
+
*/
|
|
167
|
+
public get preserveTreePrototypeLayers(): boolean;
|
|
168
|
+
public set preserveTreePrototypeLayers(value: boolean);
|
|
169
|
+
/** Graphics format of the Terrain heightmap.
|
|
170
|
+
*/
|
|
171
|
+
public static get heightmapFormat(): UnityEngine.Experimental.Rendering.GraphicsFormat;
|
|
172
|
+
public static get heightmapTextureFormat(): UnityEngine.TextureFormat;
|
|
173
|
+
/** RenderTextureFormat of the terrain heightmap.
|
|
174
|
+
*/
|
|
175
|
+
public static get heightmapRenderTextureFormat(): UnityEngine.RenderTextureFormat;
|
|
176
|
+
/** Graphics format of the Terrain normal map texture.
|
|
177
|
+
*/
|
|
178
|
+
public static get normalmapFormat(): UnityEngine.Experimental.Rendering.GraphicsFormat;
|
|
179
|
+
/** Texture format of the Terrain normal map texture.
|
|
180
|
+
*/
|
|
181
|
+
public static get normalmapTextureFormat(): UnityEngine.TextureFormat;
|
|
182
|
+
/** Render texture format of the Terrain normal map texture.
|
|
183
|
+
*/
|
|
184
|
+
public static get normalmapRenderTextureFormat(): UnityEngine.RenderTextureFormat;
|
|
185
|
+
/** Graphics format of the Terrain holes Texture when it is not compressed.
|
|
186
|
+
*/
|
|
187
|
+
public static get holesFormat(): UnityEngine.Experimental.Rendering.GraphicsFormat;
|
|
188
|
+
/** Render texture format of the Terrain holes Texture.
|
|
189
|
+
*/
|
|
190
|
+
public static get holesRenderTextureFormat(): UnityEngine.RenderTextureFormat;
|
|
191
|
+
/** Graphics format of the Terrain holes Texture when it is compressed.
|
|
192
|
+
*/
|
|
193
|
+
public static get compressedHolesFormat(): UnityEngine.Experimental.Rendering.GraphicsFormat;
|
|
194
|
+
/** Texture format of the Terrain holes Texture when it is compressed.
|
|
195
|
+
*/
|
|
196
|
+
public static get compressedHolesTextureFormat(): UnityEngine.TextureFormat;
|
|
197
|
+
/** The active Terrain. This is a convenient function to get to the main Terrain in the Scene.
|
|
198
|
+
*/
|
|
199
|
+
public static get activeTerrain(): UnityEngine.Terrain;
|
|
200
|
+
/** The active terrains in the Scene.
|
|
201
|
+
*/
|
|
202
|
+
public static get activeTerrains(): System.Array$1<UnityEngine.Terrain>;
|
|
203
|
+
/** The Terrain tile to the left, which is in the negative X direction.
|
|
204
|
+
*/
|
|
205
|
+
public get leftNeighbor(): UnityEngine.Terrain;
|
|
206
|
+
/** The Terrain tile to the left, which is in the positive X direction.
|
|
207
|
+
*/
|
|
208
|
+
public get rightNeighbor(): UnityEngine.Terrain;
|
|
209
|
+
/** Terrain top neighbor.
|
|
210
|
+
*/
|
|
211
|
+
public get topNeighbor(): UnityEngine.Terrain;
|
|
212
|
+
/** Terrain bottom neighbor.
|
|
213
|
+
*/
|
|
214
|
+
public get bottomNeighbor(): UnityEngine.Terrain;
|
|
215
|
+
/** Determines which rendering layers the Terrain renderer lives on.
|
|
216
|
+
*/
|
|
217
|
+
public get renderingLayerMask(): number;
|
|
218
|
+
public set renderingLayerMask(value: number);
|
|
219
|
+
/**
|
|
220
|
+
* @param $cameraInstanceID The InstanceID of the camera being queried. See Object.GetInstanceID.
|
|
221
|
+
* @returns Returns true if all rendering resources for the given camera are saved regardless of usage. Returns false if garbage collection is allowed to free unused resources.
|
|
222
|
+
*/
|
|
223
|
+
public GetKeepUnusedCameraRenderingResources ($cameraInstanceID: number) : boolean
|
|
224
|
+
/** Defines whether Unity cleans up rendering resources for a given Camera during garbage collection.
|
|
225
|
+
* @param $cameraInstanceID The InstanceID of the camera for which freeUnusedRenderingResources is being set. See Object.GetInstanceID.
|
|
226
|
+
* @param $freeUnusedRenderingResources The value to set to this camera's freeUnusedRenderingResources flag.
|
|
227
|
+
*/
|
|
228
|
+
public SetKeepUnusedCameraRenderingResources ($cameraInstanceID: number, $keepUnused: boolean) : void
|
|
229
|
+
public GetClosestReflectionProbes ($result: System.Collections.Generic.List$1<UnityEngine.Rendering.ReflectionProbeBlendInfo>) : void
|
|
230
|
+
/** Samples the height at the given position defined in world space, relative to the Terrain space.
|
|
231
|
+
*/
|
|
232
|
+
public SampleHeight ($worldPosition: UnityEngine.Vector3) : number
|
|
233
|
+
/** Adds a tree instance to the terrain.
|
|
234
|
+
*/
|
|
235
|
+
public AddTreeInstance ($instance: UnityEngine.TreeInstance) : void
|
|
236
|
+
/** Lets you set up the connection between neighboring Terrain tiles. This ensures LOD matches up on neighboring Terrain tiles.
|
|
237
|
+
* @param $left The Terrain tile to the left is in the negative X direction.
|
|
238
|
+
* @param $top The Terrain tile to the top is in the positive Z direction.
|
|
239
|
+
* @param $right The Terrain tile to the right is in the positive X direction.
|
|
240
|
+
* @param $bottom The Terrain tile to the bottom is in the negative Z direction.
|
|
241
|
+
*/
|
|
242
|
+
public SetNeighbors ($left: UnityEngine.Terrain, $top: UnityEngine.Terrain, $right: UnityEngine.Terrain, $bottom: UnityEngine.Terrain) : void
|
|
243
|
+
/** Get the position of the terrain.
|
|
244
|
+
*/
|
|
245
|
+
public GetPosition () : UnityEngine.Vector3
|
|
246
|
+
/** Flushes any change done in the terrain so it takes effect.
|
|
247
|
+
*/
|
|
248
|
+
public Flush () : void
|
|
249
|
+
/** Set the additional material properties when rendering the terrain heightmap using the splat material.
|
|
250
|
+
*/
|
|
251
|
+
public SetSplatMaterialPropertyBlock ($properties: UnityEngine.MaterialPropertyBlock) : void
|
|
252
|
+
/** Get the previously set splat material properties by copying to the dest MaterialPropertyBlock object.
|
|
253
|
+
*/
|
|
254
|
+
public GetSplatMaterialPropertyBlock ($dest: UnityEngine.MaterialPropertyBlock) : void
|
|
255
|
+
/** Marks the current connectivity status as invalid.
|
|
256
|
+
*/
|
|
257
|
+
public static SetConnectivityDirty () : void
|
|
258
|
+
public static GetActiveTerrains ($terrainList: System.Collections.Generic.List$1<UnityEngine.Terrain>) : void
|
|
259
|
+
/** Creates a Terrain including collider from TerrainData.
|
|
260
|
+
*/
|
|
261
|
+
public static CreateTerrainGameObject ($assignTerrain: UnityEngine.TerrainData) : UnityEngine.GameObject
|
|
262
|
+
public constructor ()
|
|
263
|
+
}
|
|
264
|
+
/** The TerrainData class stores heightmaps, detail mesh positions, tree instances, and terrain texture alpha maps.
|
|
265
|
+
*/
|
|
266
|
+
class TerrainData extends UnityEngine.Object
|
|
267
|
+
{
|
|
268
|
+
protected [__keep_incompatibility]: never;
|
|
269
|
+
/** Returns the heightmap texture.
|
|
270
|
+
*/
|
|
271
|
+
public get heightmapTexture(): UnityEngine.RenderTexture;
|
|
272
|
+
/** The size of the heightmap in texels for either the width or the height.
|
|
273
|
+
*/
|
|
274
|
+
public get heightmapResolution(): number;
|
|
275
|
+
public set heightmapResolution(value: number);
|
|
276
|
+
/** Returns a Vector3 where the x and z components are the size of each heightmap sample (i.e. the space between two neighboring heightmap samples), and the y component is the entire Terrain's height range in world space.
|
|
277
|
+
*/
|
|
278
|
+
public get heightmapScale(): UnityEngine.Vector3;
|
|
279
|
+
/** Returns the Terrain holes Texture.
|
|
280
|
+
*/
|
|
281
|
+
public get holesTexture(): UnityEngine.Texture;
|
|
282
|
+
/** Enable the Terrain holes Texture compression.
|
|
283
|
+
*/
|
|
284
|
+
public get enableHolesTextureCompression(): boolean;
|
|
285
|
+
public set enableHolesTextureCompression(value: boolean);
|
|
286
|
+
/** Returns the Terrain holes resolution for both the data and the Texture.
|
|
287
|
+
*/
|
|
288
|
+
public get holesResolution(): number;
|
|
289
|
+
/** The total size in world units of the terrain.
|
|
290
|
+
*/
|
|
291
|
+
public get size(): UnityEngine.Vector3;
|
|
292
|
+
public set size(value: UnityEngine.Vector3);
|
|
293
|
+
/** The local bounding box of the TerrainData object.
|
|
294
|
+
*/
|
|
295
|
+
public get bounds(): UnityEngine.Bounds;
|
|
296
|
+
/** Strength of the waving grass in the terrain.
|
|
297
|
+
*/
|
|
298
|
+
public get wavingGrassStrength(): number;
|
|
299
|
+
public set wavingGrassStrength(value: number);
|
|
300
|
+
/** Amount of waving grass in the terrain.
|
|
301
|
+
*/
|
|
302
|
+
public get wavingGrassAmount(): number;
|
|
303
|
+
public set wavingGrassAmount(value: number);
|
|
304
|
+
/** Speed of the waving grass.
|
|
305
|
+
*/
|
|
306
|
+
public get wavingGrassSpeed(): number;
|
|
307
|
+
public set wavingGrassSpeed(value: number);
|
|
308
|
+
/** Color of the waving grass that the terrain has.
|
|
309
|
+
*/
|
|
310
|
+
public get wavingGrassTint(): UnityEngine.Color;
|
|
311
|
+
public set wavingGrassTint(value: UnityEngine.Color);
|
|
312
|
+
/** The resolution of the detail data stored in TerrainData.
|
|
313
|
+
*/
|
|
314
|
+
public get detailWidth(): number;
|
|
315
|
+
/** The resolution of the detail data stored in TerrainData.
|
|
316
|
+
*/
|
|
317
|
+
public get detailHeight(): number;
|
|
318
|
+
/** The maximum value of each sample in the detail map of the terrain data.
|
|
319
|
+
*/
|
|
320
|
+
public get maxDetailScatterPerRes(): number;
|
|
321
|
+
/** The number of patches along a terrain tile edge. This is squared to make a grid of patches.
|
|
322
|
+
*/
|
|
323
|
+
public get detailPatchCount(): number;
|
|
324
|
+
/** Detail Resolution of the TerrainData.
|
|
325
|
+
*/
|
|
326
|
+
public get detailResolution(): number;
|
|
327
|
+
/** Detail Resolution of each patch. A larger value will decrease the number of batches used by detail objects.
|
|
328
|
+
*/
|
|
329
|
+
public get detailResolutionPerPatch(): number;
|
|
330
|
+
/** Additional resources: DetailScatterMode
|
|
331
|
+
*/
|
|
332
|
+
public get detailScatterMode(): UnityEngine.DetailScatterMode;
|
|
333
|
+
/** Contains the detail texture/meshes that the Terrain has.
|
|
334
|
+
*/
|
|
335
|
+
public get detailPrototypes(): System.Array$1<UnityEngine.DetailPrototype>;
|
|
336
|
+
public set detailPrototypes(value: System.Array$1<UnityEngine.DetailPrototype>);
|
|
337
|
+
/** Contains the current trees placed in the terrain.
|
|
338
|
+
*/
|
|
339
|
+
public get treeInstances(): System.Array$1<UnityEngine.TreeInstance>;
|
|
340
|
+
public set treeInstances(value: System.Array$1<UnityEngine.TreeInstance>);
|
|
341
|
+
/** Returns the number of tree instances.
|
|
342
|
+
*/
|
|
343
|
+
public get treeInstanceCount(): number;
|
|
344
|
+
/** The list of tree prototypes available in the inspector.
|
|
345
|
+
*/
|
|
346
|
+
public get treePrototypes(): System.Array$1<UnityEngine.TreePrototype>;
|
|
347
|
+
public set treePrototypes(value: System.Array$1<UnityEngine.TreePrototype>);
|
|
348
|
+
/** Number of alpha map layers.
|
|
349
|
+
*/
|
|
350
|
+
public get alphamapLayers(): number;
|
|
351
|
+
/** The size of the alpha map in texels for either the width or the height.
|
|
352
|
+
*/
|
|
353
|
+
public get alphamapResolution(): number;
|
|
354
|
+
public set alphamapResolution(value: number);
|
|
355
|
+
/** Width of the alpha map.
|
|
356
|
+
*/
|
|
357
|
+
public get alphamapWidth(): number;
|
|
358
|
+
/** Height of the alpha map. (Read only.)
|
|
359
|
+
*/
|
|
360
|
+
public get alphamapHeight(): number;
|
|
361
|
+
/** Resolution of the base map used for rendering far patches on the terrain.
|
|
362
|
+
*/
|
|
363
|
+
public get baseMapResolution(): number;
|
|
364
|
+
public set baseMapResolution(value: number);
|
|
365
|
+
/** Returns the number of alphamap textures.
|
|
366
|
+
*/
|
|
367
|
+
public get alphamapTextureCount(): number;
|
|
368
|
+
/** Alpha map textures used by the Terrain. Used by Terrain Inspector for undo.
|
|
369
|
+
*/
|
|
370
|
+
public get alphamapTextures(): System.Array$1<UnityEngine.Texture2D>;
|
|
371
|
+
/** Retrieves the terrain layers used by the current terrain.
|
|
372
|
+
*/
|
|
373
|
+
public get terrainLayers(): System.Array$1<UnityEngine.TerrainLayer>;
|
|
374
|
+
public set terrainLayers(value: System.Array$1<UnityEngine.TerrainLayer>);
|
|
375
|
+
/** The name for the Terrain alpha map textures.
|
|
376
|
+
*/
|
|
377
|
+
public static get AlphamapTextureName(): string;
|
|
378
|
+
/** The name for the Terrain holes Texture.
|
|
379
|
+
*/
|
|
380
|
+
public static get HolesTextureName(): string;
|
|
381
|
+
/** Gets the world space height of the Terrain at a certain point x,y without adding the Terrain's world position y.
|
|
382
|
+
*/
|
|
383
|
+
public GetHeight ($x: number, $y: number) : number
|
|
384
|
+
/** Gets an interpolated height at a point x,y. The x and y coordinates are clamped to [0, 1].
|
|
385
|
+
* @param $x X coordinate of the point in the range of [0, 1].
|
|
386
|
+
* @param $y Y coordinate of the point in the range of [0, 1].
|
|
387
|
+
*/
|
|
388
|
+
public GetInterpolatedHeight ($x: number, $y: number) : number
|
|
389
|
+
/** Gets an array of terrain height values using the normalized x,y coordinates.
|
|
390
|
+
* @param $xBase The base x coordinate.
|
|
391
|
+
* @param $yBase The base y coordinate.
|
|
392
|
+
* @param $xCount The number of queries along the X axis.
|
|
393
|
+
* @param $yCount The number of queries along the Y axis.
|
|
394
|
+
* @param $xInterval The interval between each query along the X axis.
|
|
395
|
+
* @param $yInterval The interval between each query along the Y axis.
|
|
396
|
+
*/
|
|
397
|
+
public GetInterpolatedHeights ($xBase: number, $yBase: number, $xCount: number, $yCount: number, $xInterval: number, $yInterval: number) : System.Array$1<number>
|
|
398
|
+
/** Fills the array with Terrain height values using normalized x,y coordinates.
|
|
399
|
+
* @param $results The array to fill with height values.
|
|
400
|
+
* @param $resultXOffset The offset from the beginning of the array, along the X axis, at which to start filling in height values.
|
|
401
|
+
* @param $resultYOffset The offset from the beginning of the array, along the Y axis, at which to start filling in height values.
|
|
402
|
+
* @param $xBase The base x coordinate.
|
|
403
|
+
* @param $yBase The base y coordinate.
|
|
404
|
+
* @param $xCount The number of queries along the X axis.
|
|
405
|
+
* @param $yCount The number of queries along the Y axis.
|
|
406
|
+
* @param $xInterval The interval between each query along the X axis.
|
|
407
|
+
* @param $yInterval The interval between each query along the Y axis.
|
|
408
|
+
*/
|
|
409
|
+
public GetInterpolatedHeights ($results: System.Array$1<number>, $resultXOffset: number, $resultYOffset: number, $xBase: number, $yBase: number, $xCount: number, $yCount: number, $xInterval: number, $yInterval: number) : void
|
|
410
|
+
/** Gets an array of heightmap samples.
|
|
411
|
+
* @param $xBase First index of heightmap samples to retrieve along the Terrain's x axis.
|
|
412
|
+
* @param $yBase First index of heightmap samples to retrieve along the Terrain's z axis.
|
|
413
|
+
* @param $width Number of samples to retrieve along the Terrain's x axis.
|
|
414
|
+
* @param $height Number of samples to retrieve along the Terrain's z axis.
|
|
415
|
+
*/
|
|
416
|
+
public GetHeights ($xBase: number, $yBase: number, $width: number, $height: number) : System.Array$1<number>
|
|
417
|
+
/** Sets an array of heightmap samples.
|
|
418
|
+
* @param $xBase First x index of heightmap samples to set.
|
|
419
|
+
* @param $yBase First y index of heightmap samples to set.
|
|
420
|
+
* @param $heights Array of heightmap samples to set (values range from 0 to 1, array indexed as [y,x]).
|
|
421
|
+
*/
|
|
422
|
+
public SetHeights ($xBase: number, $yBase: number, $heights: System.Array$1<number>) : void
|
|
423
|
+
/** Returns an array of min max height values for all the renderable patches in a terrain. The returned array can be modified and then passed to OverrideMinMaxPatchHeights.
|
|
424
|
+
* @returns Minimum and maximum height values for each patch.
|
|
425
|
+
*/
|
|
426
|
+
public GetPatchMinMaxHeights () : System.Array$1<UnityEngine.PatchExtents>
|
|
427
|
+
/** Override the minimum and maximum patch heights for every renderable terrain patch. Note that the overriden values get reset when the terrain resolution is changed and stays unchanged when the terrain heightmap is painted or changed via script.
|
|
428
|
+
* @param $minMaxHeights Array of minimum and maximum terrain patch height values.
|
|
429
|
+
*/
|
|
430
|
+
public OverrideMinMaxPatchHeights ($minMaxHeights: System.Array$1<UnityEngine.PatchExtents>) : void
|
|
431
|
+
/** Returns an array of tesselation maximum height error values per renderable terrain patch. The returned array can be modified and passed to OverrideMaximumHeightError.
|
|
432
|
+
* @returns Float array of maximum height error values.
|
|
433
|
+
*/
|
|
434
|
+
public GetMaximumHeightError () : System.Array$1<number>
|
|
435
|
+
/** Override the maximum tessellation height error with user provided values. Note that the overriden values get reset when the terrain resolution is changed and stays unchanged when the terrain heightmap is painted or changed via script.
|
|
436
|
+
* @param $maxError Provided maximum height error values.
|
|
437
|
+
*/
|
|
438
|
+
public OverrideMaximumHeightError ($maxError: System.Array$1<number>) : void
|
|
439
|
+
/** Sets an array of heightmap samples.
|
|
440
|
+
* @param $xBase First x index of heightmap samples to set.
|
|
441
|
+
* @param $yBase First y index of heightmap samples to set.
|
|
442
|
+
* @param $heights Array of heightmap samples to set (values range from 0 to 1, array indexed as [y,x]).
|
|
443
|
+
*/
|
|
444
|
+
public SetHeightsDelayLOD ($xBase: number, $yBase: number, $heights: System.Array$1<number>) : void
|
|
445
|
+
/** Gets whether a certain point at x,y is a hole.
|
|
446
|
+
*/
|
|
447
|
+
public IsHole ($x: number, $y: number) : boolean
|
|
448
|
+
/** Gets an array of Terrain holes samples.
|
|
449
|
+
* @param $xBase First x index of Terrain holes samples to retrieve.
|
|
450
|
+
* @param $yBase First y index of Terrain holes samples to retrieve.
|
|
451
|
+
* @param $width Number of samples to retrieve along the Terrain holes x axis.
|
|
452
|
+
* @param $height Number of samples to retrieve along the Terrain holes y axis.
|
|
453
|
+
*/
|
|
454
|
+
public GetHoles ($xBase: number, $yBase: number, $width: number, $height: number) : System.Array$1<boolean>
|
|
455
|
+
/** Sets an array of Terrain holes samples.
|
|
456
|
+
* @param $xBase First x index of Terrain holes samples to set.
|
|
457
|
+
* @param $yBase First y index of Terrain holes samples to set.
|
|
458
|
+
* @param $holes Array of Terrain holes samples to set (array indexed as [y,x]).
|
|
459
|
+
*/
|
|
460
|
+
public SetHoles ($xBase: number, $yBase: number, $holes: System.Array$1<boolean>) : void
|
|
461
|
+
/** Sets an array of Terrain holes samples.
|
|
462
|
+
* @param $xBase First x index of Terrain holes samples to set.
|
|
463
|
+
* @param $yBase First y index of Terrain holes samples to set.
|
|
464
|
+
* @param $holes Array of Terrain holes samples to set (array indexed as [y,x]).
|
|
465
|
+
*/
|
|
466
|
+
public SetHolesDelayLOD ($xBase: number, $yBase: number, $holes: System.Array$1<boolean>) : void
|
|
467
|
+
/** Gets the gradient of the terrain at point (x,y).
|
|
468
|
+
*/
|
|
469
|
+
public GetSteepness ($x: number, $y: number) : number
|
|
470
|
+
/** Get an interpolated normal at a given location.
|
|
471
|
+
*/
|
|
472
|
+
public GetInterpolatedNormal ($x: number, $y: number) : UnityEngine.Vector3
|
|
473
|
+
/** Sets the resolution of the detail map.
|
|
474
|
+
* @param $detailResolution Specifies the number of pixels in the detail resolution map. A larger detailResolution, leads to more accurate detail object painting.
|
|
475
|
+
* @param $resolutionPerPatch Specifies the size in pixels of each individually rendered detail patch. A larger number reduces draw calls, but might increase triangle count since detail patches are culled on a per batch basis. A recommended value is 16. If you use a very large detail object distance and your grass is very sparse, it makes sense to increase the value.
|
|
476
|
+
*/
|
|
477
|
+
public SetDetailResolution ($detailResolution: number, $resolutionPerPatch: number) : void
|
|
478
|
+
/** Sets the DetailScatterMode.
|
|
479
|
+
* @param $detailScatterMode Sets the DetailScatterMode that specifies how to represent detail density at each sample of the detail resolution map.
|
|
480
|
+
*/
|
|
481
|
+
public SetDetailScatterMode ($scatterMode: UnityEngine.DetailScatterMode) : void
|
|
482
|
+
/** Reloads all the values of the available prototypes (ie, detail mesh assets) in the TerrainData Object.
|
|
483
|
+
*/
|
|
484
|
+
public RefreshPrototypes () : void
|
|
485
|
+
/** Returns an array of all supported detail layer indices in the area.
|
|
486
|
+
*/
|
|
487
|
+
public GetSupportedLayers ($xBase: number, $yBase: number, $totalWidth: number, $totalHeight: number) : System.Array$1<number>
|
|
488
|
+
public GetSupportedLayers ($positionBase: UnityEngine.Vector2Int, $size: UnityEngine.Vector2Int) : System.Array$1<number>
|
|
489
|
+
/** Returns a 2D array of the detail object density (i.e. the number of detail objects for this layer) in the specific location.
|
|
490
|
+
* @param $xBase First x index of detail object density data to retrieve.
|
|
491
|
+
* @param $yBase First y index of detail object density data to retrieve.
|
|
492
|
+
* @param $width The amount of detail object density data to retrieve along the Terrain's x axis.
|
|
493
|
+
* @param $height The amount of detail object density data to retrieve along the Terrain's z axis.
|
|
494
|
+
* @param $layer The index of the detail in the TerrainData.detailPrototypes array.
|
|
495
|
+
*/
|
|
496
|
+
public GetDetailLayer ($xBase: number, $yBase: number, $width: number, $height: number, $layer: number) : System.Array$1<number>
|
|
497
|
+
public GetDetailLayer ($positionBase: UnityEngine.Vector2Int, $size: UnityEngine.Vector2Int, $layer: number) : System.Array$1<number>
|
|
498
|
+
/** This function computes and returns an array of detail object transforms for the specified patch and the specified prototype. You can use this function to retrieve the exact same transform data the Unity engine uses for detail rendering.
|
|
499
|
+
* @param $patchX The x index of the patch.
|
|
500
|
+
* @param $patchY The y index of the patch.
|
|
501
|
+
* @param $layer The prototype index.
|
|
502
|
+
* @param $density The density setting of the detail.
|
|
503
|
+
* @param $bounds Returns the bounds of the detail objects.
|
|
504
|
+
*/
|
|
505
|
+
public ComputeDetailInstanceTransforms ($patchX: number, $patchY: number, $layer: number, $density: number, $bounds: $Ref<UnityEngine.Bounds>) : System.Array$1<UnityEngine.DetailInstanceTransform>
|
|
506
|
+
/** This function computes and returns the coverage (how many instances fit in a square unit) of a detail prototype, given its index.
|
|
507
|
+
*/
|
|
508
|
+
public ComputeDetailCoverage ($detailPrototypeIndex: number) : number
|
|
509
|
+
/** Sets the detail layer density map.
|
|
510
|
+
*/
|
|
511
|
+
public SetDetailLayer ($xBase: number, $yBase: number, $layer: number, $details: System.Array$1<number>) : void
|
|
512
|
+
public SetDetailLayer ($basePosition: UnityEngine.Vector2Int, $layer: number, $details: System.Array$1<number>) : void
|
|
513
|
+
/** Returns an array of detail patches, which are each identified by X-Z coordinates. Detail objects in the patches are clamped to the maximum count.
|
|
514
|
+
* @param $density The detail density value. See Terrain.detailObjectDensity.
|
|
515
|
+
*/
|
|
516
|
+
public GetClampedDetailPatches ($density: number) : System.Array$1<UnityEngine.Vector2Int>
|
|
517
|
+
/** Sets the Tree Instance array, and optionally snaps Trees onto the surface of the Terrain heightmap.
|
|
518
|
+
* @param $instances The array of TreeInstance objects.
|
|
519
|
+
* @param $snapToHeightmap Specifies whether to snap Trees to the Terrain heightmap.
|
|
520
|
+
*/
|
|
521
|
+
public SetTreeInstances ($instances: System.Array$1<UnityEngine.TreeInstance>, $snapToHeightmap: boolean) : void
|
|
522
|
+
/** Gets the tree instance at the specified index. It is used as a faster version of treeInstances[index] as this function doesn't create the entire tree instances array.
|
|
523
|
+
* @param $index The index of the tree instance.
|
|
524
|
+
*/
|
|
525
|
+
public GetTreeInstance ($index: number) : UnityEngine.TreeInstance
|
|
526
|
+
/** Sets the tree instance with new parameters at the specified index. However, you cannot change TreeInstance.prototypeIndex and TreeInstance.position. If you change them, the method throws an ArgumentException.
|
|
527
|
+
* @param $index The index of the tree instance.
|
|
528
|
+
* @param $instance The new TreeInstance value.
|
|
529
|
+
*/
|
|
530
|
+
public SetTreeInstance ($index: number, $instance: UnityEngine.TreeInstance) : void
|
|
531
|
+
/** Removes the detail prototype at the specified index.
|
|
532
|
+
* @param $index The index of the detail prototype.
|
|
533
|
+
*/
|
|
534
|
+
public RemoveDetailPrototype ($index: number) : void
|
|
535
|
+
/** Returns the alpha map at a position x, y given a width and height.
|
|
536
|
+
* @param $x The x offset to read from.
|
|
537
|
+
* @param $y The y offset to read from.
|
|
538
|
+
* @param $width The width of the alpha map area to read.
|
|
539
|
+
* @param $height The height of the alpha map area to read.
|
|
540
|
+
* @returns A 3D array of floats, where the 3rd dimension represents the mixing weight of each splatmap at each x,y coordinate.
|
|
541
|
+
*/
|
|
542
|
+
public GetAlphamaps ($x: number, $y: number, $width: number, $height: number) : System.Array$1<number>
|
|
543
|
+
/** Assign all splat values in the given map area.
|
|
544
|
+
*/
|
|
545
|
+
public SetAlphamaps ($x: number, $y: number, $map: System.Array$1<number>) : void
|
|
546
|
+
/** Marks the terrain data as dirty to trigger an update of the terrain basemap texture.
|
|
547
|
+
*/
|
|
548
|
+
public SetBaseMapDirty () : void
|
|
549
|
+
/** Returns the alphamap texture at the specified index.
|
|
550
|
+
* @param $index Index of the alphamap.
|
|
551
|
+
* @returns Alphamap texture at the specified index.
|
|
552
|
+
*/
|
|
553
|
+
public GetAlphamapTexture ($index: number) : UnityEngine.Texture2D
|
|
554
|
+
/** This function sets the terrainLayers property, and in addition, registers the action to the Editor's undo stack.
|
|
555
|
+
* @param $terrainLayers The Terrain Layer assets to set.
|
|
556
|
+
* @param $undoName The name of the Editor's undo action.
|
|
557
|
+
*/
|
|
558
|
+
public SetTerrainLayersRegisterUndo ($terrainLayers: System.Array$1<UnityEngine.TerrainLayer>, $undoName: string) : void
|
|
559
|
+
/** Performs synchronization queued by previous calls to CopyActiveRenderTextureToHeightmap and DirtyHeightmapRegion, which makes the height data and LOD data used for tessellation up to date.
|
|
560
|
+
*/
|
|
561
|
+
public SyncHeightmap () : void
|
|
562
|
+
/** Copies the specified part of the active RenderTexture to the Terrain heightmap texture.
|
|
563
|
+
* @param $sourceRect The part of the active Render Texture to copy.
|
|
564
|
+
* @param $dest The X and Y coordinates of the heightmap texture to copy into.
|
|
565
|
+
* @param $syncControl Controls how CPU synchronization is performed.
|
|
566
|
+
*/
|
|
567
|
+
public CopyActiveRenderTextureToHeightmap ($sourceRect: UnityEngine.RectInt, $dest: UnityEngine.Vector2Int, $syncControl: UnityEngine.TerrainHeightmapSyncControl) : void
|
|
568
|
+
/** Marks the specified part of the heightmap as dirty.
|
|
569
|
+
* @param $region The rectangular region to mark as dirty.
|
|
570
|
+
* @param $syncControl Controls how CPU synchronization is performed.
|
|
571
|
+
*/
|
|
572
|
+
public DirtyHeightmapRegion ($region: UnityEngine.RectInt, $syncControl: UnityEngine.TerrainHeightmapSyncControl) : void
|
|
573
|
+
/** Copies the specified part of the active RenderTexture to the Terrain texture.
|
|
574
|
+
* @param $textureName The name of the Terrain texture to copy into.
|
|
575
|
+
* @param $textureIndex The index of the Terrain texture to copy into.
|
|
576
|
+
* @param $sourceRect The part of the active Render Texture to copy.
|
|
577
|
+
* @param $dest The X and Y coordinates of the Terrain texture to copy into.
|
|
578
|
+
* @param $allowDelayedCPUSync Specifies whether to allow delayed CPU synchronization of the texture.
|
|
579
|
+
*/
|
|
580
|
+
public CopyActiveRenderTextureToTexture ($textureName: string, $textureIndex: number, $sourceRect: UnityEngine.RectInt, $dest: UnityEngine.Vector2Int, $allowDelayedCPUSync: boolean) : void
|
|
581
|
+
/** Marks the specified part of the Terrain texture as dirty.
|
|
582
|
+
* @param $textureName The name of the Terrain texture.
|
|
583
|
+
* @param $region The rectangular region to mark as dirty.
|
|
584
|
+
* @param $allowDelayedCPUSync Specifies whether to allow delayed CPU synchronization of the texture.
|
|
585
|
+
*/
|
|
586
|
+
public DirtyTextureRegion ($textureName: string, $region: UnityEngine.RectInt, $allowDelayedCPUSync: boolean) : void
|
|
587
|
+
/** Performs synchronization queued by previous calls to CopyActiveRenderTextureToTexture and DirtyTextureRegion, which makes CPU data of the Terrain textures up to date.
|
|
588
|
+
* @param $textureName The name of the Terrain texture to synchronize.
|
|
589
|
+
*/
|
|
590
|
+
public SyncTexture ($textureName: string) : void
|
|
591
|
+
public constructor ()
|
|
592
|
+
}
|
|
593
|
+
/** Contains information about a tree placed in the Terrain game object.
|
|
594
|
+
*/
|
|
595
|
+
class TreeInstance extends System.ValueType
|
|
596
|
+
{
|
|
597
|
+
protected [__keep_incompatibility]: never;
|
|
598
|
+
/** Position of the tree.
|
|
599
|
+
*/
|
|
600
|
+
public position : UnityEngine.Vector3
|
|
601
|
+
/** Width scale of this instance (compared to the prototype's size).
|
|
602
|
+
*/
|
|
603
|
+
public widthScale : number
|
|
604
|
+
/** Height scale of this instance (compared to the prototype's size).
|
|
605
|
+
*/
|
|
606
|
+
public heightScale : number
|
|
607
|
+
/** Read-only.
|
|
608
|
+
Rotation of the tree on X-Z plane (in radians).
|
|
609
|
+
*/
|
|
610
|
+
public rotation : number
|
|
611
|
+
/** Color of this instance.
|
|
612
|
+
*/
|
|
613
|
+
public color : UnityEngine.Color32
|
|
614
|
+
/** Lightmap color calculated for this instance.
|
|
615
|
+
*/
|
|
616
|
+
public lightmapColor : UnityEngine.Color32
|
|
617
|
+
/** Index of this instance in the TerrainData.treePrototypes array.
|
|
618
|
+
*/
|
|
619
|
+
public prototypeIndex : number
|
|
620
|
+
}
|
|
621
|
+
/** Options for motion vector rendering on the terrain.
|
|
622
|
+
*/
|
|
623
|
+
enum TreeMotionVectorModeOverride
|
|
624
|
+
{ CameraMotionOnly = 0, PerObjectMotion = 1, ForceNoMotion = 2, InheritFromPrototype = 3 }
|
|
625
|
+
/** Extension methods to the Terrain class, used only for the UpdateGIMaterials method used by the Global Illumination System.
|
|
626
|
+
*/
|
|
627
|
+
class TerrainExtensions extends System.Object
|
|
628
|
+
{
|
|
629
|
+
protected [__keep_incompatibility]: never;
|
|
630
|
+
/** Schedules an update of the albedo and emissive Textures of a system that contains the Terrain.
|
|
631
|
+
*/
|
|
632
|
+
public static UpdateGIMaterials ($terrain: UnityEngine.Terrain) : void
|
|
633
|
+
/** Schedules an update of the albedo and emissive Textures of a system that contains the Terrain.
|
|
634
|
+
*/
|
|
635
|
+
public static UpdateGIMaterials ($terrain: UnityEngine.Terrain, $x: number, $y: number, $width: number, $height: number) : void
|
|
636
|
+
}
|
|
637
|
+
/** Tree Component for the tree creator.
|
|
638
|
+
*/
|
|
639
|
+
class Tree extends UnityEngine.Component
|
|
640
|
+
{
|
|
641
|
+
protected [__keep_incompatibility]: never;
|
|
642
|
+
/** Data asociated to the Tree.
|
|
643
|
+
*/
|
|
644
|
+
public get data(): UnityEngine.ScriptableObject;
|
|
645
|
+
public set data(value: UnityEngine.ScriptableObject);
|
|
646
|
+
/** Tells if there is wind data exported from SpeedTree are saved on this component.
|
|
647
|
+
*/
|
|
648
|
+
public get hasSpeedTreeWind(): boolean;
|
|
649
|
+
public constructor ()
|
|
650
|
+
}
|
|
651
|
+
/** This static class provides events that Unity triggers when Terrain data changes.
|
|
652
|
+
*/
|
|
653
|
+
class TerrainCallbacks extends System.Object
|
|
654
|
+
{
|
|
655
|
+
protected [__keep_incompatibility]: never;
|
|
656
|
+
public static add_heightmapChanged ($value: UnityEngine.TerrainCallbacks.HeightmapChangedCallback) : void
|
|
657
|
+
public static remove_heightmapChanged ($value: UnityEngine.TerrainCallbacks.HeightmapChangedCallback) : void
|
|
658
|
+
public static add_textureChanged ($value: UnityEngine.TerrainCallbacks.TextureChangedCallback) : void
|
|
659
|
+
public static remove_textureChanged ($value: UnityEngine.TerrainCallbacks.TextureChangedCallback) : void
|
|
660
|
+
}
|
|
661
|
+
/** Simple class that contains a pointer to a tree prototype.
|
|
662
|
+
*/
|
|
663
|
+
class TreePrototype extends System.Object
|
|
664
|
+
{
|
|
665
|
+
protected [__keep_incompatibility]: never;
|
|
666
|
+
/** Retrieves the actual GameObject used by the tree.
|
|
667
|
+
*/
|
|
668
|
+
public get prefab(): UnityEngine.GameObject;
|
|
669
|
+
public set prefab(value: UnityEngine.GameObject);
|
|
670
|
+
/** Bend factor of the tree prototype.
|
|
671
|
+
*/
|
|
672
|
+
public get bendFactor(): number;
|
|
673
|
+
public set bendFactor(value: number);
|
|
674
|
+
/** The LOD index of a Tree LODGroup that Unity uses to generate a NavMesh. It uses this value only for Trees with a LODGroup, and ignores this value for regular Trees.
|
|
675
|
+
*/
|
|
676
|
+
public get navMeshLod(): number;
|
|
677
|
+
public set navMeshLod(value: number);
|
|
678
|
+
public constructor ()
|
|
679
|
+
public constructor ($other: UnityEngine.TreePrototype)
|
|
680
|
+
}
|
|
681
|
+
/** Render mode for detail prototypes.
|
|
682
|
+
*/
|
|
683
|
+
enum DetailRenderMode
|
|
684
|
+
{ GrassBillboard = 0, VertexLit = 1, Grass = 2 }
|
|
685
|
+
/** Provides options to specify how details are scattered on the terrain.
|
|
686
|
+
*/
|
|
687
|
+
enum DetailScatterMode
|
|
688
|
+
{ CoverageMode = 0, InstanceCountMode = 1 }
|
|
689
|
+
/** Detail prototype used by the Terrain GameObject.
|
|
690
|
+
*/
|
|
691
|
+
class DetailPrototype extends System.Object
|
|
692
|
+
{
|
|
693
|
+
protected [__keep_incompatibility]: never;
|
|
694
|
+
/** GameObject used by the DetailPrototype.
|
|
695
|
+
*/
|
|
696
|
+
public get prototype(): UnityEngine.GameObject;
|
|
697
|
+
public set prototype(value: UnityEngine.GameObject);
|
|
698
|
+
/** Texture used by the DetailPrototype.
|
|
699
|
+
*/
|
|
700
|
+
public get prototypeTexture(): UnityEngine.Texture2D;
|
|
701
|
+
public set prototypeTexture(value: UnityEngine.Texture2D);
|
|
702
|
+
/** Minimum width of the grass billboards (if render mode is GrassBillboard).
|
|
703
|
+
*/
|
|
704
|
+
public get minWidth(): number;
|
|
705
|
+
public set minWidth(value: number);
|
|
706
|
+
/** Maximum width of the grass billboards (if render mode is GrassBillboard).
|
|
707
|
+
*/
|
|
708
|
+
public get maxWidth(): number;
|
|
709
|
+
public set maxWidth(value: number);
|
|
710
|
+
/** Minimum height of the grass billboards (if render mode is GrassBillboard).
|
|
711
|
+
*/
|
|
712
|
+
public get minHeight(): number;
|
|
713
|
+
public set minHeight(value: number);
|
|
714
|
+
/** Maximum height of the grass billboards (if render mode is GrassBillboard).
|
|
715
|
+
*/
|
|
716
|
+
public get maxHeight(): number;
|
|
717
|
+
public set maxHeight(value: number);
|
|
718
|
+
/** Specifies the random seed value for detail object placement.
|
|
719
|
+
*/
|
|
720
|
+
public get noiseSeed(): number;
|
|
721
|
+
public set noiseSeed(value: number);
|
|
722
|
+
/** Controls the spatial frequency of the noise pattern used to vary the scale and color of the detail objects.
|
|
723
|
+
*/
|
|
724
|
+
public get noiseSpread(): number;
|
|
725
|
+
public set noiseSpread(value: number);
|
|
726
|
+
/** Controls detail density for this detail prototype, relative to it's size.
|
|
727
|
+
*/
|
|
728
|
+
public get density(): number;
|
|
729
|
+
public set density(value: number);
|
|
730
|
+
/** Controls how far away detail objects are from the edge of the hole area.
|
|
731
|
+
*/
|
|
732
|
+
public get holeEdgePadding(): number;
|
|
733
|
+
public set holeEdgePadding(value: number);
|
|
734
|
+
/** Color when the DetailPrototypes are "healthy".
|
|
735
|
+
*/
|
|
736
|
+
public get healthyColor(): UnityEngine.Color;
|
|
737
|
+
public set healthyColor(value: UnityEngine.Color);
|
|
738
|
+
/** Color when the DetailPrototypes are "dry".
|
|
739
|
+
*/
|
|
740
|
+
public get dryColor(): UnityEngine.Color;
|
|
741
|
+
public set dryColor(value: UnityEngine.Color);
|
|
742
|
+
/** Render mode for the DetailPrototype.
|
|
743
|
+
*/
|
|
744
|
+
public get renderMode(): UnityEngine.DetailRenderMode;
|
|
745
|
+
public set renderMode(value: UnityEngine.DetailRenderMode);
|
|
746
|
+
/** Indicates whether this detail prototype uses the Mesh object from the GameObject specified by prototype.
|
|
747
|
+
*/
|
|
748
|
+
public get usePrototypeMesh(): boolean;
|
|
749
|
+
public set usePrototypeMesh(value: boolean);
|
|
750
|
+
/** Indicates whether this detail prototype uses for rendering.
|
|
751
|
+
*/
|
|
752
|
+
public get useInstancing(): boolean;
|
|
753
|
+
public set useInstancing(value: boolean);
|
|
754
|
+
/** Controls the detail's target coverage.
|
|
755
|
+
*/
|
|
756
|
+
public get targetCoverage(): number;
|
|
757
|
+
public set targetCoverage(value: number);
|
|
758
|
+
/** Indicates the global density scale set in the terrain settings affects this detail prototype.
|
|
759
|
+
*/
|
|
760
|
+
public get useDensityScaling(): boolean;
|
|
761
|
+
public set useDensityScaling(value: boolean);
|
|
762
|
+
/** Rotate detail axis parallel to the ground's normal direction, so that the detail is perpendicular to the ground.
|
|
763
|
+
*/
|
|
764
|
+
public get alignToGround(): number;
|
|
765
|
+
public set alignToGround(value: number);
|
|
766
|
+
/** Controls how Unity generates the detail positions.
|
|
767
|
+
*/
|
|
768
|
+
public get positionJitter(): number;
|
|
769
|
+
public set positionJitter(value: number);
|
|
770
|
+
/** Returns true if the detail prototype is valid and the Terrain can accept it.
|
|
771
|
+
* @param $errorMessage Returns a message that indicates the cause of failed validation.
|
|
772
|
+
*/
|
|
773
|
+
public Validate () : boolean
|
|
774
|
+
/** Returns true if the detail prototype is valid and the Terrain can accept it.
|
|
775
|
+
* @param $errorMessage Returns a message that indicates the cause of failed validation.
|
|
776
|
+
*/
|
|
777
|
+
public Validate ($errorMessage: $Ref<string>) : boolean
|
|
778
|
+
public constructor ()
|
|
779
|
+
public constructor ($other: UnityEngine.DetailPrototype)
|
|
780
|
+
}
|
|
781
|
+
/** A Splat prototype is just a texture that is used by the TerrainData.
|
|
782
|
+
*/
|
|
783
|
+
class SplatPrototype extends System.Object
|
|
784
|
+
{
|
|
785
|
+
protected [__keep_incompatibility]: never;
|
|
786
|
+
/** Texture of the splat applied to the Terrain.
|
|
787
|
+
*/
|
|
788
|
+
public get texture(): UnityEngine.Texture2D;
|
|
789
|
+
public set texture(value: UnityEngine.Texture2D);
|
|
790
|
+
/** Normal map of the splat applied to the Terrain.
|
|
791
|
+
*/
|
|
792
|
+
public get normalMap(): UnityEngine.Texture2D;
|
|
793
|
+
public set normalMap(value: UnityEngine.Texture2D);
|
|
794
|
+
/** Size of the tile used in the texture of the SplatPrototype.
|
|
795
|
+
*/
|
|
796
|
+
public get tileSize(): UnityEngine.Vector2;
|
|
797
|
+
public set tileSize(value: UnityEngine.Vector2);
|
|
798
|
+
/** Offset of the tile texture of the SplatPrototype.
|
|
799
|
+
*/
|
|
800
|
+
public get tileOffset(): UnityEngine.Vector2;
|
|
801
|
+
public set tileOffset(value: UnityEngine.Vector2);
|
|
802
|
+
public get specular(): UnityEngine.Color;
|
|
803
|
+
public set specular(value: UnityEngine.Color);
|
|
804
|
+
/** The metallic value of the splat layer.
|
|
805
|
+
*/
|
|
806
|
+
public get metallic(): number;
|
|
807
|
+
public set metallic(value: number);
|
|
808
|
+
/** The smoothness value of the splat layer when the main texture has no alpha channel.
|
|
809
|
+
*/
|
|
810
|
+
public get smoothness(): number;
|
|
811
|
+
public set smoothness(value: number);
|
|
812
|
+
public constructor ()
|
|
813
|
+
}
|
|
814
|
+
/** Structure containing minimum and maximum terrain patch height values.
|
|
815
|
+
*/
|
|
816
|
+
class PatchExtents extends System.ValueType
|
|
817
|
+
{
|
|
818
|
+
protected [__keep_incompatibility]: never;
|
|
819
|
+
/** Minimum height of a terrain patch.
|
|
820
|
+
*/
|
|
821
|
+
public get min(): number;
|
|
822
|
+
public set min(value: number);
|
|
823
|
+
/** Maximum height of a terrain patch.
|
|
824
|
+
*/
|
|
825
|
+
public get max(): number;
|
|
826
|
+
public set max(value: number);
|
|
827
|
+
}
|
|
828
|
+
/** Controls what Terrain heightmap data to synchronize when there are changes to the heightmap texture.
|
|
829
|
+
*/
|
|
830
|
+
enum TerrainHeightmapSyncControl
|
|
831
|
+
{ None = 0, HeightOnly = 1, HeightAndLod = 2 }
|
|
832
|
+
/** Describes the transform of a Terrain detail object.
|
|
833
|
+
*/
|
|
834
|
+
class DetailInstanceTransform extends System.ValueType
|
|
835
|
+
{
|
|
836
|
+
protected [__keep_incompatibility]: never;
|
|
837
|
+
/** The X coordinate of the detail object in the Terrain's local space. To get the X in world space, add this value to position X of the Terrain.
|
|
838
|
+
*/
|
|
839
|
+
public posX : number
|
|
840
|
+
/** The Y coordinate of the detail object in the Terrain's local space. To get the Y in world space, add this value to position Y of the Terrain.
|
|
841
|
+
*/
|
|
842
|
+
public posY : number
|
|
843
|
+
/** The Z coordinate of the detail object in the Terrain's local space. To get the Z in world space, add this value to position Z of the Terrain.
|
|
844
|
+
*/
|
|
845
|
+
public posZ : number
|
|
846
|
+
/** The X and Z scale values of the detail object. These two values are always the same.
|
|
847
|
+
*/
|
|
848
|
+
public scaleXZ : number
|
|
849
|
+
/** The Y scale value of the detail object.
|
|
850
|
+
*/
|
|
851
|
+
public scaleY : number
|
|
852
|
+
/** The angle, in radians, at which the detail object rotates around the Y-axis.
|
|
853
|
+
*/
|
|
854
|
+
public rotationY : number
|
|
855
|
+
}
|
|
856
|
+
/** Description of a terrain layer.
|
|
857
|
+
*/
|
|
858
|
+
class TerrainLayer extends UnityEngine.Object
|
|
859
|
+
{
|
|
860
|
+
protected [__keep_incompatibility]: never;
|
|
861
|
+
/** The diffuse texture used by the terrain layer.
|
|
862
|
+
*/
|
|
863
|
+
public get diffuseTexture(): UnityEngine.Texture2D;
|
|
864
|
+
public set diffuseTexture(value: UnityEngine.Texture2D);
|
|
865
|
+
/** Normal map texture used by the terrain layer.
|
|
866
|
+
*/
|
|
867
|
+
public get normalMapTexture(): UnityEngine.Texture2D;
|
|
868
|
+
public set normalMapTexture(value: UnityEngine.Texture2D);
|
|
869
|
+
/** The mask map texture used by the terrain layer.
|
|
870
|
+
*/
|
|
871
|
+
public get maskMapTexture(): UnityEngine.Texture2D;
|
|
872
|
+
public set maskMapTexture(value: UnityEngine.Texture2D);
|
|
873
|
+
/** UV Tiling size.
|
|
874
|
+
*/
|
|
875
|
+
public get tileSize(): UnityEngine.Vector2;
|
|
876
|
+
public set tileSize(value: UnityEngine.Vector2);
|
|
877
|
+
/** UV tiling offset.
|
|
878
|
+
*/
|
|
879
|
+
public get tileOffset(): UnityEngine.Vector2;
|
|
880
|
+
public set tileOffset(value: UnityEngine.Vector2);
|
|
881
|
+
/** Specular color.
|
|
882
|
+
*/
|
|
883
|
+
public get specular(): UnityEngine.Color;
|
|
884
|
+
public set specular(value: UnityEngine.Color);
|
|
885
|
+
/** Metallic factor used by the terrain layer.
|
|
886
|
+
*/
|
|
887
|
+
public get metallic(): number;
|
|
888
|
+
public set metallic(value: number);
|
|
889
|
+
/** Smoothness of the specular reflection.
|
|
890
|
+
*/
|
|
891
|
+
public get smoothness(): number;
|
|
892
|
+
public set smoothness(value: number);
|
|
893
|
+
/** A float value that scales the normal vector. The minimum value is 0, the maximum value is 1.
|
|
894
|
+
*/
|
|
895
|
+
public get normalScale(): number;
|
|
896
|
+
public set normalScale(value: number);
|
|
897
|
+
/** A Vector4 value specifying the minimum RGBA value that the diffuse texture maps to when the value of the channel is 0.
|
|
898
|
+
*/
|
|
899
|
+
public get diffuseRemapMin(): UnityEngine.Vector4;
|
|
900
|
+
public set diffuseRemapMin(value: UnityEngine.Vector4);
|
|
901
|
+
/** A Vector4 value specifying the maximum RGBA value that the diffuse texture maps to when the value of the channel is 1.
|
|
902
|
+
*/
|
|
903
|
+
public get diffuseRemapMax(): UnityEngine.Vector4;
|
|
904
|
+
public set diffuseRemapMax(value: UnityEngine.Vector4);
|
|
905
|
+
/** A Vector4 value specifying the minimum RGBA value that the mask map texture maps to when the value of the channel is 0.
|
|
906
|
+
*/
|
|
907
|
+
public get maskMapRemapMin(): UnityEngine.Vector4;
|
|
908
|
+
public set maskMapRemapMin(value: UnityEngine.Vector4);
|
|
909
|
+
/** A Vector4 value specifying the maximum RGBA value that the mask map texture maps to when the value of the channel is 1.
|
|
910
|
+
*/
|
|
911
|
+
public get maskMapRemapMax(): UnityEngine.Vector4;
|
|
912
|
+
public set maskMapRemapMax(value: UnityEngine.Vector4);
|
|
913
|
+
/** Choose the source for smoothness value.
|
|
914
|
+
*/
|
|
915
|
+
public get smoothnessSource(): UnityEngine.TerrainLayerSmoothnessSource;
|
|
916
|
+
public set smoothnessSource(value: UnityEngine.TerrainLayerSmoothnessSource);
|
|
917
|
+
public constructor ()
|
|
918
|
+
}
|
|
919
|
+
/** Source of smoothness value used in the underlying splat material of a TerrainLayer when TerrainLayer.diffuseTexture has an alpha channel.
|
|
920
|
+
*/
|
|
921
|
+
enum TerrainLayerSmoothnessSource
|
|
922
|
+
{ Constant = 0, DiffuseAlphaChannel = 1 }
|
|
923
|
+
}
|
|
924
|
+
namespace UnityEngine.Terrain {
|
|
925
|
+
enum MaterialType
|
|
926
|
+
{ BuiltInStandard = 0, BuiltInLegacyDiffuse = 1, BuiltInLegacySpecular = 2, Custom = 3 }
|
|
927
|
+
}
|
|
928
|
+
namespace UnityEngine.TerrainCallbacks {
|
|
929
|
+
interface HeightmapChangedCallback
|
|
930
|
+
{
|
|
931
|
+
(terrain: UnityEngine.Terrain, heightRegion: UnityEngine.RectInt, synched: boolean) : void;
|
|
932
|
+
Invoke?: (terrain: UnityEngine.Terrain, heightRegion: UnityEngine.RectInt, synched: boolean) => void;
|
|
933
|
+
}
|
|
934
|
+
var HeightmapChangedCallback: { new (func: (terrain: UnityEngine.Terrain, heightRegion: UnityEngine.RectInt, synched: boolean) => void): HeightmapChangedCallback; }
|
|
935
|
+
interface TextureChangedCallback
|
|
936
|
+
{
|
|
937
|
+
(terrain: UnityEngine.Terrain, textureName: string, texelRegion: UnityEngine.RectInt, synched: boolean) : void;
|
|
938
|
+
Invoke?: (terrain: UnityEngine.Terrain, textureName: string, texelRegion: UnityEngine.RectInt, synched: boolean) => void;
|
|
939
|
+
}
|
|
940
|
+
var TextureChangedCallback: { new (func: (terrain: UnityEngine.Terrain, textureName: string, texelRegion: UnityEngine.RectInt, synched: boolean) => void): TextureChangedCallback; }
|
|
941
|
+
}
|
|
942
|
+
namespace UnityEngine.TerrainUtils {
|
|
943
|
+
/** Specifies a set of 2D tile coordinates.
|
|
944
|
+
*/
|
|
945
|
+
class TerrainTileCoord extends System.ValueType
|
|
946
|
+
{
|
|
947
|
+
protected [__keep_incompatibility]: never;
|
|
948
|
+
/** Tile X coordinate.
|
|
949
|
+
*/
|
|
950
|
+
public tileX : number
|
|
951
|
+
/** Tile Z coordinate.
|
|
952
|
+
*/
|
|
953
|
+
public tileZ : number
|
|
954
|
+
public constructor ($tileX: number, $tileZ: number)
|
|
955
|
+
}
|
|
956
|
+
/** Type for mapping 2D (X,Z) tile coordinates to a Terrain object.
|
|
957
|
+
*/
|
|
958
|
+
class TerrainMap extends System.Object
|
|
959
|
+
{
|
|
960
|
+
protected [__keep_incompatibility]: never;
|
|
961
|
+
/** Mapping from TileCoord to Terrain.
|
|
962
|
+
*/
|
|
963
|
+
public get terrainTiles(): System.Collections.Generic.Dictionary$2<UnityEngine.TerrainUtils.TerrainTileCoord, UnityEngine.Terrain>;
|
|
964
|
+
/** Retrieves the Terrain object corresponding to the tile coordinates (tileX,tileZ).
|
|
965
|
+
* @param $tileX Tile X coordinate.
|
|
966
|
+
* @param $tileZ Tile Z coordinate.
|
|
967
|
+
* @returns Returns a valid Terrain object if successful, null otherwise.
|
|
968
|
+
*/
|
|
969
|
+
public GetTerrain ($tileX: number, $tileZ: number) : UnityEngine.Terrain
|
|
970
|
+
public static CreateFromConnectedNeighbors ($originTerrain: UnityEngine.Terrain, $filter?: System.Predicate$1<UnityEngine.Terrain>, $fullValidation?: boolean) : UnityEngine.TerrainUtils.TerrainMap
|
|
971
|
+
public static CreateFromPlacement ($originTerrain: UnityEngine.Terrain, $filter?: System.Predicate$1<UnityEngine.Terrain>, $fullValidation?: boolean) : UnityEngine.TerrainUtils.TerrainMap
|
|
972
|
+
public static CreateFromPlacement ($gridOrigin: UnityEngine.Vector2, $gridSize: UnityEngine.Vector2, $filter?: System.Predicate$1<UnityEngine.Terrain>, $fullValidation?: boolean) : UnityEngine.TerrainUtils.TerrainMap
|
|
973
|
+
public constructor ()
|
|
974
|
+
}
|
|
975
|
+
/** Provides a set of utility functions that are used by the terrain tools.
|
|
976
|
+
*/
|
|
977
|
+
class TerrainUtility extends System.Object
|
|
978
|
+
{
|
|
979
|
+
protected [__keep_incompatibility]: never;
|
|
980
|
+
/** Automatically connects neighboring terrains.
|
|
981
|
+
*/
|
|
982
|
+
public static AutoConnect () : void
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
namespace UnityEngine.TerrainTools {
|
|
986
|
+
/** Represents a linear 2D transformation between brush UV space and a target XY space (typically this is a Terrain-local object space.)
|
|
987
|
+
*/
|
|
988
|
+
class BrushTransform extends System.ValueType
|
|
989
|
+
{
|
|
990
|
+
protected [__keep_incompatibility]: never;
|
|
991
|
+
/** (Read Only) Brush UV origin, in XY space.
|
|
992
|
+
*/
|
|
993
|
+
public get brushOrigin(): UnityEngine.Vector2;
|
|
994
|
+
/** (Read Only) Brush U vector, in XY space.
|
|
995
|
+
*/
|
|
996
|
+
public get brushU(): UnityEngine.Vector2;
|
|
997
|
+
/** (Read Only) Brush V vector, in XY space.
|
|
998
|
+
*/
|
|
999
|
+
public get brushV(): UnityEngine.Vector2;
|
|
1000
|
+
/** (Read Only) Target XY origin, in Brush UV space.
|
|
1001
|
+
*/
|
|
1002
|
+
public get targetOrigin(): UnityEngine.Vector2;
|
|
1003
|
+
/** (Read Only) Target X vector, in Brush UV space.
|
|
1004
|
+
*/
|
|
1005
|
+
public get targetX(): UnityEngine.Vector2;
|
|
1006
|
+
/** (Read Only) Target Y vector, in Brush UV space.
|
|
1007
|
+
*/
|
|
1008
|
+
public get targetY(): UnityEngine.Vector2;
|
|
1009
|
+
/** Get the axis-aligned bounding rectangle of the brush, in target XY space.
|
|
1010
|
+
* @returns Bounding rectangle in target XY space.
|
|
1011
|
+
*/
|
|
1012
|
+
public GetBrushXYBounds () : UnityEngine.Rect
|
|
1013
|
+
/** Creates an axis-aligned BrushTransform from a rectangle.
|
|
1014
|
+
* @param $brushRect Brush rectangle, in target XY coordinates.
|
|
1015
|
+
* @returns BrushTransform describing the brush.
|
|
1016
|
+
*/
|
|
1017
|
+
public static FromRect ($brushRect: UnityEngine.Rect) : UnityEngine.TerrainTools.BrushTransform
|
|
1018
|
+
/** Applies the transform to convert a target XY coordinate to Brush UV space.
|
|
1019
|
+
* @param $targetXY Point in target XY space.
|
|
1020
|
+
* @returns Point transformed to Brush UV space.
|
|
1021
|
+
*/
|
|
1022
|
+
public ToBrushUV ($targetXY: UnityEngine.Vector2) : UnityEngine.Vector2
|
|
1023
|
+
/** Applies the transform to convert a Brush UV coordinate to the target XY space.
|
|
1024
|
+
* @param $brushUV Brush UV coordinate to transform.
|
|
1025
|
+
* @returns Target XY coordinate.
|
|
1026
|
+
*/
|
|
1027
|
+
public FromBrushUV ($brushUV: UnityEngine.Vector2) : UnityEngine.Vector2
|
|
1028
|
+
public constructor ($brushOrigin: UnityEngine.Vector2, $brushU: UnityEngine.Vector2, $brushV: UnityEngine.Vector2)
|
|
1029
|
+
}
|
|
1030
|
+
/** The context for a paint operation that may span multiple connected Terrain tiles.
|
|
1031
|
+
*/
|
|
1032
|
+
class PaintContext extends System.Object
|
|
1033
|
+
{
|
|
1034
|
+
protected [__keep_incompatibility]: never;
|
|
1035
|
+
/** (Read Only) The Terrain used to build the PaintContext.
|
|
1036
|
+
*/
|
|
1037
|
+
public get originTerrain(): UnityEngine.Terrain;
|
|
1038
|
+
/** (Read Only) The pixel rectangle that this PaintContext represents.
|
|
1039
|
+
*/
|
|
1040
|
+
public get pixelRect(): UnityEngine.RectInt;
|
|
1041
|
+
/** (Read Only) The width of the target terrain texture. This is the resolution for a single Terrain.
|
|
1042
|
+
*/
|
|
1043
|
+
public get targetTextureWidth(): number;
|
|
1044
|
+
/** (Read Only) The height of the target terrain texture. This is the resolution for a single Terrain.
|
|
1045
|
+
*/
|
|
1046
|
+
public get targetTextureHeight(): number;
|
|
1047
|
+
/** (Read Only) The size of a PaintContext pixel in terrain units (as defined by originTerrain.)
|
|
1048
|
+
*/
|
|
1049
|
+
public get pixelSize(): UnityEngine.Vector2;
|
|
1050
|
+
/** (Read Only) Render target that stores the original data from the Terrain tiles.
|
|
1051
|
+
*/
|
|
1052
|
+
public get sourceRenderTexture(): UnityEngine.RenderTexture;
|
|
1053
|
+
/** (Read Only) RenderTexture that an edit operation writes to modify the data.
|
|
1054
|
+
*/
|
|
1055
|
+
public get destinationRenderTexture(): UnityEngine.RenderTexture;
|
|
1056
|
+
/** (Read Only) The value of RenderTexture.active at the time CreateRenderTargets is called.
|
|
1057
|
+
*/
|
|
1058
|
+
public get oldRenderTexture(): UnityEngine.RenderTexture;
|
|
1059
|
+
/** (Read Only) The number of Terrain tiles in this PaintContext.
|
|
1060
|
+
*/
|
|
1061
|
+
public get terrainCount(): number;
|
|
1062
|
+
/** The minimum height of all Terrain tiles that this PaintContext touches in world space.
|
|
1063
|
+
*/
|
|
1064
|
+
public get heightWorldSpaceMin(): number;
|
|
1065
|
+
/** The height range (from Min to Max) of all Terrain tiles that this PaintContext touches in world space.
|
|
1066
|
+
*/
|
|
1067
|
+
public get heightWorldSpaceSize(): number;
|
|
1068
|
+
/** Unity uses this value internally to transform a [0, 1] height value to a texel value, which is stored in TerrainData.heightmapTexture.
|
|
1069
|
+
*/
|
|
1070
|
+
public static get kNormalizedHeightScale(): number;
|
|
1071
|
+
/** Retrieves a Terrain from the PaintContext.
|
|
1072
|
+
* @param $terrainIndex Index of the terrain.
|
|
1073
|
+
* @returns Returns the Terrain object.
|
|
1074
|
+
*/
|
|
1075
|
+
public GetTerrain ($terrainIndex: number) : UnityEngine.Terrain
|
|
1076
|
+
/** Retrieves the clipped pixel rectangle for a Terrain.
|
|
1077
|
+
* @param $terrainIndex Index of the Terrain.
|
|
1078
|
+
* @returns Returns the clipped pixel rectangle.
|
|
1079
|
+
*/
|
|
1080
|
+
public GetClippedPixelRectInTerrainPixels ($terrainIndex: number) : UnityEngine.RectInt
|
|
1081
|
+
/** Retrieves the clipped pixel rectangle for a Terrain, relative to the PaintContext render textures.
|
|
1082
|
+
* @param $terrainIndex Index of the Terrain.
|
|
1083
|
+
* @returns Returns the clipped pixel rectangle.
|
|
1084
|
+
*/
|
|
1085
|
+
public GetClippedPixelRectInRenderTexturePixels ($terrainIndex: number) : UnityEngine.RectInt
|
|
1086
|
+
/** Constructs a PaintContext that you can use to edit a texture on a Terrain, in the region defined by boundsInTerrainSpace and extraBorderPixels.
|
|
1087
|
+
* @param $terrain Terrain that defines terrain space for this PaintContext.
|
|
1088
|
+
* @param $boundsInTerrainSpace Terrain space bounds to edit in the target terrain texture.
|
|
1089
|
+
* @param $inputTextureWidth Width of the input Terrain Texture for all connected Terrains.
|
|
1090
|
+
* @param $inputTextureHeight Height of the input Terrain Texture for all connected Terrains.
|
|
1091
|
+
* @param $extraBorderPixels Number of extra border pixels required. The default value is 0.
|
|
1092
|
+
* @param $sharedBoundaryTexel Whether to stretch the Textures so that edge texels lie on the Terrain boundary, and are shared with connected Terrains.
|
|
1093
|
+
* @param $fillOutsideTerrain Whether to fill empty space outside of the Terrain tiles with data from the nearest tile.
|
|
1094
|
+
*/
|
|
1095
|
+
public static CreateFromBounds ($terrain: UnityEngine.Terrain, $boundsInTerrainSpace: UnityEngine.Rect, $inputTextureWidth: number, $inputTextureHeight: number, $extraBorderPixels?: number, $sharedBoundaryTexel?: boolean, $fillOutsideTerrain?: boolean) : UnityEngine.TerrainTools.PaintContext
|
|
1096
|
+
/** Creates the sourceRenderTexture and destinationRenderTexture.
|
|
1097
|
+
* @param $colorFormat Render Texture format.
|
|
1098
|
+
*/
|
|
1099
|
+
public CreateRenderTargets ($colorFormat: UnityEngine.RenderTextureFormat) : void
|
|
1100
|
+
/** Releases the allocated resources of this PaintContext.
|
|
1101
|
+
* @param $restoreRenderTexture When true, indicates that this function restores RenderTexture.active
|
|
1102
|
+
*/
|
|
1103
|
+
public Cleanup ($restoreRenderTexture?: boolean) : void
|
|
1104
|
+
public Gather ($terrainSource: System.Func$2<UnityEngine.TerrainTools.PaintContext.ITerrainInfo, UnityEngine.Texture>, $defaultColor: UnityEngine.Color, $blitMaterial?: UnityEngine.Material, $blitPass?: number, $beforeBlit?: System.Action$1<UnityEngine.TerrainTools.PaintContext.ITerrainInfo>, $afterBlit?: System.Action$1<UnityEngine.TerrainTools.PaintContext.ITerrainInfo>) : void
|
|
1105
|
+
public Scatter ($terrainDest: System.Func$2<UnityEngine.TerrainTools.PaintContext.ITerrainInfo, UnityEngine.RenderTexture>, $blitMaterial?: UnityEngine.Material, $blitPass?: number, $beforeBlit?: System.Action$1<UnityEngine.TerrainTools.PaintContext.ITerrainInfo>, $afterBlit?: System.Action$1<UnityEngine.TerrainTools.PaintContext.ITerrainInfo>) : void
|
|
1106
|
+
/** Gathers the heightmap information into sourceRenderTexture.
|
|
1107
|
+
*/
|
|
1108
|
+
public GatherHeightmap () : void
|
|
1109
|
+
/** Applies an edited heightmap PaintContext by copying modifications back to the source Terrain tiles.
|
|
1110
|
+
* @param $editorUndoName Unique name used for the undo stack.
|
|
1111
|
+
*/
|
|
1112
|
+
public ScatterHeightmap ($editorUndoName: string) : void
|
|
1113
|
+
/** Gathers the Terrain holes information into sourceRenderTexture.
|
|
1114
|
+
*/
|
|
1115
|
+
public GatherHoles () : void
|
|
1116
|
+
/** Applies an edited Terrain holes PaintContext by copying modifications back to the source Terrain tiles.
|
|
1117
|
+
* @param $editorUndoName Unique name used for the undo stack.
|
|
1118
|
+
*/
|
|
1119
|
+
public ScatterHoles ($editorUndoName: string) : void
|
|
1120
|
+
/** Gathers the normal information into sourceRenderTexture.
|
|
1121
|
+
*/
|
|
1122
|
+
public GatherNormals () : void
|
|
1123
|
+
/** Gathers the alphamap information into sourceRenderTexture.
|
|
1124
|
+
* @param $inputLayer TerrainLayer used for painting.
|
|
1125
|
+
* @param $addLayerIfDoesntExist Set to true to specify that the inputLayer is added to the terrain if it does not already exist. Set to false to specify that terrain layers are not added to the terrain.
|
|
1126
|
+
*/
|
|
1127
|
+
public GatherAlphamap ($inputLayer: UnityEngine.TerrainLayer, $addLayerIfDoesntExist?: boolean) : void
|
|
1128
|
+
/** Applies an edited alphamap PaintContext by copying modifications back to the source Terrain tiles.
|
|
1129
|
+
* @param $editorUndoName Unique name used for the undo stack.
|
|
1130
|
+
*/
|
|
1131
|
+
public ScatterAlphamap ($editorUndoName: string) : void
|
|
1132
|
+
/** Flushes the delayed actions created by PaintContext heightmap and alphamap modifications.
|
|
1133
|
+
*/
|
|
1134
|
+
public static ApplyDelayedActions () : void
|
|
1135
|
+
public constructor ($terrain: UnityEngine.Terrain, $pixelRect: UnityEngine.RectInt, $targetTextureWidth: number, $targetTextureHeight: number, $sharedBoundaryTexel?: boolean, $fillOutsideTerrain?: boolean)
|
|
1136
|
+
}
|
|
1137
|
+
/** Built-in render passes for paint material.
|
|
1138
|
+
*/
|
|
1139
|
+
enum TerrainBuiltinPaintMaterialPasses
|
|
1140
|
+
{ RaiseLowerHeight = 0, StampHeight = 1, SetHeights = 2, SmoothHeights = 3, PaintTexture = 4, PaintHoles = 5 }
|
|
1141
|
+
/** A set of utility functions for custom terrain paint tools.
|
|
1142
|
+
*/
|
|
1143
|
+
class TerrainPaintUtility extends System.Object
|
|
1144
|
+
{
|
|
1145
|
+
protected [__keep_incompatibility]: never;
|
|
1146
|
+
/** Returns the built-in in paint material used by the built-in tools.
|
|
1147
|
+
* @returns Built-in terrain paint material.
|
|
1148
|
+
*/
|
|
1149
|
+
public static GetBuiltinPaintMaterial () : UnityEngine.Material
|
|
1150
|
+
/** Calculates the minimum and maximum Brush size limits, in world space.
|
|
1151
|
+
* @param $minBrushWorldSize Returns the minimum Brush size, in world space units.
|
|
1152
|
+
* @param $maxBrushWorldSize Returns the maximum Brush size, in world space units.
|
|
1153
|
+
* @param $terrainTileWorldSize The size of a Terrain tile, in world space units.
|
|
1154
|
+
* @param $terrainTileTextureResolutionPixels The resolution of the Terrain tile texture the Brush edits, in pixels.
|
|
1155
|
+
* @param $minBrushResolutionPixels The minimum Brush resolution, in pixels. Default is 1 pixel.
|
|
1156
|
+
* @param $maxBrushResolutionPixels The maximum Brush resolution, in pixels. Default is 8192 pixels.
|
|
1157
|
+
*/
|
|
1158
|
+
public static GetBrushWorldSizeLimits ($minBrushWorldSize: $Ref<number>, $maxBrushWorldSize: $Ref<number>, $terrainTileWorldSize: number, $terrainTileTextureResolutionPixels: number, $minBrushResolutionPixels?: number, $maxBrushResolutionPixels?: number) : void
|
|
1159
|
+
/** Creates a BrushTransform from the input parameters.
|
|
1160
|
+
* @param $terrain Reference terrain, defines terrain UV and object space.
|
|
1161
|
+
* @param $brushCenterTerrainUV Center point of the brush, in terrain UV space (0-1 across the terrain tile).
|
|
1162
|
+
* @param $brushSize Size of the brush, in terrain space.
|
|
1163
|
+
* @param $brushRotationDegrees Brush rotation in degrees (clockwise).
|
|
1164
|
+
* @returns Transform from terrain space to Brush UVs.
|
|
1165
|
+
*/
|
|
1166
|
+
public static CalculateBrushTransform ($terrain: UnityEngine.Terrain, $brushCenterTerrainUV: UnityEngine.Vector2, $brushSize: number, $brushRotationDegrees: number) : UnityEngine.TerrainTools.BrushTransform
|
|
1167
|
+
/** Builds a Scale & Offset transform to convert between one PaintContext's UV space and another PaintContext's UV space.
|
|
1168
|
+
* @param $src Source PaintContext.
|
|
1169
|
+
* @param $dst Destination PaintContext.
|
|
1170
|
+
* @param $scaleOffset ScaleOffset transform.
|
|
1171
|
+
*/
|
|
1172
|
+
public static BuildTransformPaintContextUVToPaintContextUV ($src: UnityEngine.TerrainTools.PaintContext, $dst: UnityEngine.TerrainTools.PaintContext, $scaleOffset: $Ref<UnityEngine.Vector4>) : void
|
|
1173
|
+
/** Sets up all of the material properties used by functions in TerrainTool.cginc.
|
|
1174
|
+
* @param $paintContext PaintContext describing the area we are editing, and the terrain space.
|
|
1175
|
+
* @param $brushXform BrushTransform from terrain space to Brush UVs.
|
|
1176
|
+
* @param $material Material to populate with transform properties.
|
|
1177
|
+
*/
|
|
1178
|
+
public static SetupTerrainToolMaterialProperties ($paintContext: UnityEngine.TerrainTools.PaintContext, $brushXform: $Ref<UnityEngine.TerrainTools.BrushTransform>, $material: UnityEngine.Material) : void
|
|
1179
|
+
/** Releases the allocated resources of the specified PaintContext.
|
|
1180
|
+
* @param $ctx The PaintContext containing the resources to release.
|
|
1181
|
+
*/
|
|
1182
|
+
public static ReleaseContextResources ($ctx: UnityEngine.TerrainTools.PaintContext) : void
|
|
1183
|
+
/** Helper function to set up a PaintContext for modifying the heightmap of one or more Terrain tiles.
|
|
1184
|
+
* @param $terrain Reference Terrain tile.
|
|
1185
|
+
* @param $boundsInTerrainSpace The region in terrain space to edit.
|
|
1186
|
+
* @param $extraBorderPixels Number of extra border pixels required.
|
|
1187
|
+
* @param $fillOutsideTerrain Whether to fill empty space outside of Terrain tiles with data from the nearest tile.
|
|
1188
|
+
* @returns PaintContext containing the combined heightmap data for the specified region.
|
|
1189
|
+
*/
|
|
1190
|
+
public static BeginPaintHeightmap ($terrain: UnityEngine.Terrain, $boundsInTerrainSpace: UnityEngine.Rect, $extraBorderPixels?: number, $fillOutsideTerrain?: boolean) : UnityEngine.TerrainTools.PaintContext
|
|
1191
|
+
/** Helper function to complete a heightmap modification.
|
|
1192
|
+
* @param $ctx The heightmap paint context to complete.
|
|
1193
|
+
* @param $editorUndoName Unique name used for the undo stack.
|
|
1194
|
+
*/
|
|
1195
|
+
public static EndPaintHeightmap ($ctx: UnityEngine.TerrainTools.PaintContext, $editorUndoName: string) : void
|
|
1196
|
+
/** Helper function to set up a PaintContext for modifying the Terrain holes of one or more Terrain tiles.
|
|
1197
|
+
* @param $terrain Reference Terrain tile.
|
|
1198
|
+
* @param $boundsInTerrainSpace The region in Terrain space to edit.
|
|
1199
|
+
* @param $extraBorderPixels Number of extra border pixels required.
|
|
1200
|
+
* @param $fillOutsideTerrain Whether to fill empty space outside of Terrain tiles with data from the nearest tile.
|
|
1201
|
+
* @returns PaintContext that contains the combined Terrain holes data for the specified region.
|
|
1202
|
+
*/
|
|
1203
|
+
public static BeginPaintHoles ($terrain: UnityEngine.Terrain, $boundsInTerrainSpace: UnityEngine.Rect, $extraBorderPixels?: number, $fillOutsideTerrain?: boolean) : UnityEngine.TerrainTools.PaintContext
|
|
1204
|
+
/** Helper function to complete a Terrain holes modification.
|
|
1205
|
+
* @param $ctx The Terrain holes PaintContext to complete.
|
|
1206
|
+
* @param $editorUndoName Unique name used for the undo stack.
|
|
1207
|
+
*/
|
|
1208
|
+
public static EndPaintHoles ($ctx: UnityEngine.TerrainTools.PaintContext, $editorUndoName: string) : void
|
|
1209
|
+
/** Helper function to set up a PaintContext that collects mesh normal data from one or more Terrain tiles.
|
|
1210
|
+
* @param $terrain Reference Terrain tile.
|
|
1211
|
+
* @param $boundsInTerrainSpace The region in terrain space from which to collect normals.
|
|
1212
|
+
* @param $extraBorderPixels Number of extra border pixels required.
|
|
1213
|
+
* @param $fillOutsideTerrain Whether to fill empty space outside of Terrain tiles with data from the nearest tile.
|
|
1214
|
+
* @returns PaintContext containing the combined normalmap data for the specified region.
|
|
1215
|
+
*/
|
|
1216
|
+
public static CollectNormals ($terrain: UnityEngine.Terrain, $boundsInTerrainSpace: UnityEngine.Rect, $extraBorderPixels?: number, $fillOutsideTerrain?: boolean) : UnityEngine.TerrainTools.PaintContext
|
|
1217
|
+
/** Helper function to set up a PaintContext for modifying the alphamap of one or more Terrain tiles.
|
|
1218
|
+
* @param $terrain Reference Terrain tile.
|
|
1219
|
+
* @param $inputLayer Selects the alphamap to paint.
|
|
1220
|
+
* @param $boundsInTerrainSpace The region in terrain space to edit.
|
|
1221
|
+
* @param $extraBorderPixels Number of extra border pixels required.
|
|
1222
|
+
* @param $fillOutsideTerrain Whether to fill empty space outside of Terrain tiles with data from the nearest tile.
|
|
1223
|
+
* @returns PaintContext containing the combined alphamap data for the specified region.
|
|
1224
|
+
*/
|
|
1225
|
+
public static BeginPaintTexture ($terrain: UnityEngine.Terrain, $boundsInTerrainSpace: UnityEngine.Rect, $inputLayer: UnityEngine.TerrainLayer, $extraBorderPixels?: number, $fillOutsideTerrain?: boolean) : UnityEngine.TerrainTools.PaintContext
|
|
1226
|
+
/** Helper function to complete a texture alphamap modification.
|
|
1227
|
+
* @param $ctx The texture paint context to complete.
|
|
1228
|
+
* @param $editorUndoName Unique name used for the undo stack.
|
|
1229
|
+
*/
|
|
1230
|
+
public static EndPaintTexture ($ctx: UnityEngine.TerrainTools.PaintContext, $editorUndoName: string) : void
|
|
1231
|
+
/** Returns the default material for blitting operations.
|
|
1232
|
+
* @returns Built in "Hidden/BlitCopy" material.
|
|
1233
|
+
*/
|
|
1234
|
+
public static GetBlitMaterial () : UnityEngine.Material
|
|
1235
|
+
/** Returns the Material to use when copying the Terrain heightmap.
|
|
1236
|
+
* @returns Built in "HiddenTerrainEngineHeightBlitCopy" material.
|
|
1237
|
+
*/
|
|
1238
|
+
public static GetHeightBlitMaterial () : UnityEngine.Material
|
|
1239
|
+
/** Returns the default copy terrain layer material.
|
|
1240
|
+
* @returns Built in "HiddenTerrainTerrainLayerUtils" material.
|
|
1241
|
+
*/
|
|
1242
|
+
public static GetCopyTerrainLayerMaterial () : UnityEngine.Material
|
|
1243
|
+
/** Returns the alphamap texture at mapIndex.
|
|
1244
|
+
* @param $terrain Terrain tile.
|
|
1245
|
+
* @param $mapIndex Index to retrieve.
|
|
1246
|
+
* @returns Alphamap texture at mapIndex.
|
|
1247
|
+
*/
|
|
1248
|
+
public static GetTerrainAlphaMapChecked ($terrain: UnityEngine.Terrain, $mapIndex: number) : UnityEngine.Texture2D
|
|
1249
|
+
/** Finds the index of a TerrainLayer in a Terrain tile.
|
|
1250
|
+
* @param $terrain Terrain tile.
|
|
1251
|
+
* @param $inputLayer Terrain layer to search for.
|
|
1252
|
+
* @returns Returns the index of the terrain layer if it exists or -1 if it doesn't exist.
|
|
1253
|
+
*/
|
|
1254
|
+
public static FindTerrainLayerIndex ($terrain: UnityEngine.Terrain, $inputLayer: UnityEngine.TerrainLayer) : number
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
namespace UnityEngine.TerrainTools.PaintContext {
|
|
1258
|
+
interface ITerrainInfo
|
|
1259
|
+
{
|
|
1260
|
+
terrain : UnityEngine.Terrain
|
|
1261
|
+
clippedTerrainPixels : UnityEngine.RectInt
|
|
1262
|
+
clippedPCPixels : UnityEngine.RectInt
|
|
1263
|
+
paddedTerrainPixels : UnityEngine.RectInt
|
|
1264
|
+
paddedPCPixels : UnityEngine.RectInt
|
|
1265
|
+
gatherEnable : boolean
|
|
1266
|
+
scatterEnable : boolean
|
|
1267
|
+
userData : any
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
}
|