C# Класс TerrainManager, tf_client

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

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

Свойство Тип Описание
buildHousingAction PlayerActionBuildHousing
forceTileUpdate bool
lastUpdateTime System.DateTime
worldRegion Region

Защищенные свойства (Protected)

Свойство Тип Описание
cameraWaitTime float
downloadTilesCoroutine DownloadTilesInRegionCoroutine
updateRegion bool

Private Properties

Свойство Тип Описание
ClearAllTerrainObjects void
ClearBuildingsInRegion void
ClearTerrain void
ClearTreesInRegion void
CreatePaddingMeshes void
InitializeResourceTileCache void
InitializeTerrain void
UpdatePaddingMeshGridOffset void

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

Метод Описание
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

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

Метод Описание
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.

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

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

Initialize singleton
public Awake ( ) : void
Результат void

GetResourceTileCacheAtWorldPosition() публичный статический Метод

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. ///
Результат bool

GetResourceTileCacheGroup() публичный статический Метод

public static GetResourceTileCacheGroup ( Status, &status ) : ResourceTileLite[],
status Status,
Результат ResourceTileLite[],

GetResourceTileCacheRegion() публичный статический Метод

public static GetResourceTileCacheRegion ( Region, region ) : ].ResourceTileLite[
region Region,
Результат ].ResourceTileLite[

GetResourceTileCacheUnderMouseCursor() публичный статический Метод

Gets the resource tile cache under mouse cursor.
public static GetResourceTileCacheUnderMouseCursor ( ResourceTileLite, &tile ) : bool
tile ResourceTileLite, /// The cache under the mouse cursor. ///
Результат bool

GetResourceTileCacheWithId() публичный статический Метод

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. ///
Результат ResourceTileLite,

GetWorldCoordinateAtMousePosition() публичный статический Метод

Gets the world coordinate at mouse position.
public static GetWorldCoordinateAtMousePosition ( ) : Vector3
Результат Vector3

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

Moves the terrain to center of view.
public MoveTerrainToCenterOfView ( ) : void
Результат void

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

Debug GUI
public OnGUI ( ) : void
Результат void

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

public RefreshFromIds ( ) : void
Результат void

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

Sets the permissions.
public SetPermissions ( ResourceTile, tiles ) : void
tiles ResourceTile, /// Tiles from which to read permissions. ///
Результат void

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

Sets the terrain from resourceTiles.
public SetTerrainFromResourceTiles ( ResourceTile, resourceTiles, SetTerrainMode mode ) : void
resourceTiles ResourceTile, /// Microtiles. ///
mode SetTerrainMode /// Mode. ///
Результат void

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

Initialize terrain etc
public Start ( ) : void
Результат void

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

public Update ( ) : void
Результат void

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

Respond to camera moving
public _CameraMoved ( MessageCameraMoved msg ) : void
msg MessageCameraMoved /// A ///
Результат void

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

Load the terrain when the camera stops
public _CameraStopped ( MessageCameraStopped msg ) : void
msg MessageCameraStopped /// A ///
Результат void

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

public _LoadedNewTiles ( MessageLoadedNewTiles msg ) : void
msg MessageLoadedNewTiles
Результат void

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

Mark the world loaded
public _WorldLoaded ( MessageWorldLoaded msg ) : void
msg MessageWorldLoaded /// A ///
Результат void

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

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

The build housing action.
public PlayerActionBuildHousing buildHousingAction
Результат PlayerActionBuildHousing

cameraWaitTime защищенное свойство

protected float cameraWaitTime
Результат float

downloadTilesCoroutine защищенное свойство

protected DownloadTilesInRegionCoroutine downloadTilesCoroutine
Результат DownloadTilesInRegionCoroutine

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

public bool forceTileUpdate
Результат bool

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

Raises the loaded new tiles event and resets the refresh timer
public System.DateTime lastUpdateTime
Результат System.DateTime

updateRegion защищенное свойство

protected bool updateRegion
Результат bool

worldRegion публичное статическое свойство

The world region.
public static Region worldRegion
Результат Region