C# Класс LostPolygon.DynamicWaterSystem.DynamicWater

Наследование: FluidVolume, IDynamicWaterSettings, IDynamicWaterMeshSettings
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
UpdateWhenNotVisible bool
UsePlaneCollider bool

Открытые методы

Метод Описание
CreateSplash ( Vector3 start, Vector3 end, float radius, float force ) : void

Creates a circular drop splashes on the fluid surface across the line.

CreateSplash ( Vector3 center, float radius, float force ) : void

Creates a circular drop splash on the fluid surface (if available).

ErodeObstructionField ( int iterations, byte field ) : byte[]
GetObstructionInfoArray ( GameObject gameObjects ) : ObstructionInfo[]

Gets the info required for obstruction mask generation for an array of GameObject.

GetWaterLevel ( Vector3 position ) : float

Returns water level at the given position in world space.

GetWaterLevel ( float x, float z ) : float

Returns water level at the given position in world space.

GetWaterLevel ( float x, float y, float z ) : float

Returns water level at the given position in world space.

MaxResolution ( ) : int

Returns maximum resolution (along largest side) possible for this water plane dimensions.

MaxSpeed ( ) : float

Returns maximum wave propagation speed possible for this quality level.

RecalculateObstructions ( ) : void

Recalculate the static obstructions.

Защищенные методы

Метод Описание
CreatePlaneCollider ( ) : void

Create the child gameObject for interacting with water plane.

GetGameObjectsWithTagInBounds ( string searchTag, Bounds bounds ) : UnityEngine.GameObject[]

Returns GameObjects with tag within Bounds .

Initialize ( ) : void

Initializes the required components and creates initial Mesh.

PropertyChanged ( ) : void

Called when any property connected with the mesh is changed.

UpdateCollider ( ) : void

Update the collider boundaries.

Приватные методы

Метод Описание
ClearMeshes ( ) : void

Removes the meshes from the memory.

CreateSplashLine ( Vector2Int start, Vector2Int end, float radius, float force ) : void
CreateSplashNormalized ( Vector2 center, float radius, float force ) : void

Creates a circular drop splash on the fluid surface (if available).

FixedUpdate ( ) : void
OnDestroy ( ) : void
OnDrawGizmos ( ) : void
SizeToGridResolution ( Vector2 size, int resolution ) : Vector2Int

The size to grid resolution.

Start ( ) : void
StepSimulation ( ) : void
UpdateComponents ( ) : void
UpdateProperties ( ) : void

Called when any property that defines the water simulation, changes.

Описание методов

CreatePlaneCollider() защищенный Метод

Create the child gameObject for interacting with water plane.
protected CreatePlaneCollider ( ) : void
Результат void

CreateSplash() публичный Метод

Creates a circular drop splashes on the fluid surface across the line.
public CreateSplash ( Vector3 start, Vector3 end, float radius, float force ) : void
start Vector3 /// The start point in world space coordinates. ///
end Vector3 /// The end point in world space coordinates. ///
radius float /// The radius of the splash in world space units. ///
force float /// The amount of force applied to create the splash. ///
Результат void

CreateSplash() публичный Метод

Creates a circular drop splash on the fluid surface (if available).
public CreateSplash ( Vector3 center, float radius, float force ) : void
center Vector3 /// The center of the splash in world space coordinates. ///
radius float /// The radius of the splash in world space units. ///
force float /// The amount of force applied to create the splash. ///
Результат void

ErodeObstructionField() публичный Метод

public ErodeObstructionField ( int iterations, byte field ) : byte[]
iterations int
field byte
Результат byte[]

GetGameObjectsWithTagInBounds() защищенный Метод

Returns GameObjects with tag within Bounds .
protected GetGameObjectsWithTagInBounds ( string searchTag, Bounds bounds ) : UnityEngine.GameObject[]
searchTag string /// The tag to find GameObjects with. ///
bounds UnityEngine.Bounds /// The bounds to search within. ///
Результат UnityEngine.GameObject[]

GetObstructionInfoArray() публичный Метод

Gets the info required for obstruction mask generation for an array of GameObject.
public GetObstructionInfoArray ( GameObject gameObjects ) : ObstructionInfo[]
gameObjects UnityEngine.GameObject /// The array of . ///
Результат ObstructionInfo[]

GetWaterLevel() публичный Метод

Returns water level at the given position in world space.
public GetWaterLevel ( Vector3 position ) : float
position Vector3 /// The position at which to query the water level. ///
Результат float

GetWaterLevel() публичный Метод

Returns water level at the given position in world space.
public GetWaterLevel ( float x, float z ) : float
x float /// The x coordinate. ///
z float /// The z coordinate. ///
Результат float

GetWaterLevel() публичный Метод

Returns water level at the given position in world space.
public GetWaterLevel ( float x, float y, float z ) : float
x float /// The x coordinate. ///
y float /// The y coordinate. ///
z float /// The z coordinate. ///
Результат float

Initialize() защищенный Метод

Initializes the required components and creates initial Mesh.
protected Initialize ( ) : void
Результат void

MaxResolution() публичный Метод

Returns maximum resolution (along largest side) possible for this water plane dimensions.
public MaxResolution ( ) : int
Результат int

MaxSpeed() публичный Метод

Returns maximum wave propagation speed possible for this quality level.
public MaxSpeed ( ) : float
Результат float

PropertyChanged() защищенный Метод

Called when any property connected with the mesh is changed.
protected PropertyChanged ( ) : void
Результат void

RecalculateObstructions() публичный Метод

Recalculate the static obstructions.
public RecalculateObstructions ( ) : void
Результат void

UpdateCollider() защищенный Метод

Update the collider boundaries.
protected UpdateCollider ( ) : void
Результат void

Описание свойств

UpdateWhenNotVisible публичное свойство

Value indicating whether to update the simulation when the mesh is not visible.
public bool UpdateWhenNotVisible
Результат bool

UsePlaneCollider публичное свойство

Value indicating whether to generate the static plane collider on initialization.
public bool UsePlaneCollider
Результат bool