C# Class TerrainManager, tf_client

Inheritance: MonoBehaviour
Mostrar archivo Open project: wids-eria/tf_client Class Usage Examples

Public Properties

Property Type Description
buildHousingAction PlayerActionBuildHousing
forceTileUpdate bool
lastUpdateTime System.DateTime
worldRegion Region

Protected Properties

Property Type Description
cameraWaitTime float
downloadTilesCoroutine DownloadTilesInRegionCoroutine
updateRegion bool

Private Properties

Property Type Description
ClearAllTerrainObjects void
ClearBuildingsInRegion void
ClearTerrain void
ClearTreesInRegion void
CreatePaddingMeshes void
InitializeResourceTileCache void
InitializeTerrain void
UpdatePaddingMeshGridOffset void

Public Methods

Method Description
Awake ( ) : void

Initialize singleton

GetResourceTileCacheAtWorldPosition ( Vector3 position, ResourceTileLite, &tile ) : bool

Gets the resource tile cache at world position.

GetResourceTileCacheGroup ( Status, &status ) : ResourceTileLite[],
GetResourceTileCacheRegion ( Region, region ) : ].ResourceTileLite[
GetResourceTileCacheUnderMouseCursor ( ResourceTileLite, &tile ) : bool

Gets the resource tile cache under mouse cursor.

GetResourceTileCacheWithId ( int id, Status, &status ) : ResourceTileLite,

Gets the resource tile cache with identifier.

GetWorldCoordinateAtMousePosition ( ) : Vector3

Gets the world coordinate at mouse position.

MoveTerrainToCenterOfView ( ) : void

Moves the terrain to center of view.

OnGUI ( ) : void

Debug GUI

RefreshFromIds ( ) : void
SetPermissions ( ResourceTile, tiles ) : void

Sets the permissions.

SetTerrainFromResourceTiles ( ResourceTile, resourceTiles, SetTerrainMode mode ) : void

Sets the terrain from resourceTiles.

Start ( ) : void

Initialize terrain etc

Update ( ) : void
_CameraMoved ( MessageCameraMoved msg ) : void

Respond to camera moving

_CameraStopped ( MessageCameraStopped msg ) : void

Load the terrain when the camera stops

_LoadedNewTiles ( MessageLoadedNewTiles msg ) : void
_WorldLoaded ( MessageWorldLoaded msg ) : void

Mark the world loaded

Private Methods

Method Description
ClearAllTerrainObjects ( SetTerrainMode mode ) : void

Clears all terrain objects (buildings and trees).

ClearBuildingsInRegion ( Region, region ) : void

Clears the buildings in region.

ClearTerrain ( SetTerrainMode mode ) : void

Clears the terrain of all data.

ClearTreesInRegion ( Region, region, SetTerrainMode mode ) : void

Clears the trees in region.

CreatePaddingMeshes ( ) : void

Create the padding meshes to surround the terrain

InitializeResourceTileCache ( ) : void

Initializes the resource tile cache.

InitializeTerrain ( ) : void

Initialize the terrain and collider

UpdatePaddingMeshGridOffset ( ) : void

Updates the padding mesh grid offset.

Method Details

Awake() public method

Initialize singleton
public Awake ( ) : void
return void

GetResourceTileCacheAtWorldPosition() public static method

Gets the resource tile cache at world position.
public static GetResourceTileCacheAtWorldPosition ( Vector3 position, ResourceTileLite, &tile ) : bool
position Vector3
tile ResourceTileLite, /// The cache at the specified position. ///
return bool

GetResourceTileCacheGroup() public static method

public static GetResourceTileCacheGroup ( Status, &status ) : ResourceTileLite[],
status Status,
return ResourceTileLite[],

GetResourceTileCacheRegion() public static method

public static GetResourceTileCacheRegion ( Region, region ) : ].ResourceTileLite[
region Region,
return ].ResourceTileLite[

GetResourceTileCacheUnderMouseCursor() public static method

Gets the resource tile cache under mouse cursor.
public static GetResourceTileCacheUnderMouseCursor ( ResourceTileLite, &tile ) : bool
tile ResourceTileLite, /// The cache under the mouse cursor. ///
return bool

GetResourceTileCacheWithId() public static method

Gets the resource tile cache with identifier.
public static GetResourceTileCacheWithId ( int id, Status, &status ) : ResourceTileLite,
id int /// Identifier. ///
status Status, /// Status indicating whether the returned value is valid or not. ///
return ResourceTileLite,

GetWorldCoordinateAtMousePosition() public static method

Gets the world coordinate at mouse position.
public static GetWorldCoordinateAtMousePosition ( ) : Vector3
return Vector3

MoveTerrainToCenterOfView() public method

Moves the terrain to center of view.
public MoveTerrainToCenterOfView ( ) : void
return void

OnGUI() public method

Debug GUI
public OnGUI ( ) : void
return void

RefreshFromIds() public method

public RefreshFromIds ( ) : void
return void

SetPermissions() public method

Sets the permissions.
public SetPermissions ( ResourceTile, tiles ) : void
tiles ResourceTile, /// Tiles from which to read permissions. ///
return void

SetTerrainFromResourceTiles() public method

Sets the terrain from resourceTiles.
public SetTerrainFromResourceTiles ( ResourceTile, resourceTiles, SetTerrainMode mode ) : void
resourceTiles ResourceTile, /// Microtiles. ///
mode SetTerrainMode /// Mode. ///
return void

Start() public method

Initialize terrain etc
public Start ( ) : void
return void

Update() public method

public Update ( ) : void
return void

_CameraMoved() public method

Respond to camera moving
public _CameraMoved ( MessageCameraMoved msg ) : void
msg MessageCameraMoved /// A ///
return void

_CameraStopped() public method

Load the terrain when the camera stops
public _CameraStopped ( MessageCameraStopped msg ) : void
msg MessageCameraStopped /// A ///
return void

_LoadedNewTiles() public method

public _LoadedNewTiles ( MessageLoadedNewTiles msg ) : void
msg MessageLoadedNewTiles
return void

_WorldLoaded() public method

Mark the world loaded
public _WorldLoaded ( MessageWorldLoaded msg ) : void
msg MessageWorldLoaded /// A ///
return void

Property Details

buildHousingAction public_oe property

The build housing action.
public PlayerActionBuildHousing buildHousingAction
return PlayerActionBuildHousing

cameraWaitTime protected_oe property

protected float cameraWaitTime
return float

downloadTilesCoroutine protected_oe property

protected DownloadTilesInRegionCoroutine downloadTilesCoroutine
return DownloadTilesInRegionCoroutine

forceTileUpdate public_oe property

public bool forceTileUpdate
return bool

lastUpdateTime public_oe property

Raises the loaded new tiles event and resets the refresh timer
public System.DateTime lastUpdateTime
return System.DateTime

updateRegion protected_oe property

protected bool updateRegion
return bool

worldRegion public_oe static_oe property

The world region.
public static Region worldRegion
return Region