Large Water Area Manager¶
Creating Large Water Area Manager¶
We create a large water area manager object from the Hierarchy's Create menu:
2D Object → Game2D Water Kit → Large Water Area Manager Object
A new large water area manager object is added in the Hierarchy, with a child water object.
Large Water Area Manager Component Properties¶
The Main Camera property sets the scene main camera that will be used to determine the visibility of each spawned water object. So when a water object is no longer visible to this camera, it gets properly repositioned.
The Water Object property sets the base object from which to instantiate the other water objects. It is assigned by default to the child water object.
The water object should have a width that is at least half of the Main Camera view frustum width.
The water object doesn't necessarily have to be a child of the large water area manager object.
Water Object Count¶
The Water Object Count property sets the number of water objects to spawn when the game starts.
1 2 3
We can get the water object that is located at a specific position using the function GetWaterObjectLocatedAt(float xWorldSpacePosition). This function returns null if there's currently no water object in that position