C# Класс PlayerAction, tf_client

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

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

Свойство Тип Описание
allowPerformance bool
controlsAreaHeight float
cost int
dialogConfirmButtonDo GUIContent
dialogLongDescription string
effectPrefab GameObject
hasServerAPIPoint bool
icon UnityEngine.Texture2D
inputMode InputMode
notificationMessage string
tooltip string

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

Свойство Тип Описание
downloadTilesCoroutine DownloadTilesInRegionCoroutine
m_actionProgress float
m_tileModifications ResourceTileModification

Private Properties

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

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

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

Configure the dialog

DoAction ( GUIButtonBase, button ) : void
DoIt ( object selection ) : void

Perform the action.

IsPermittedOnResourceTile ( ResourceTile, tile ) : bool

Determines whether this action is permitted on the specified tile.

OnEnable ( ) : void

Raises the enable event.

OnGUI ( ) : void

Display loading icon as needed

Start ( ) : void
UpdateMask ( ) : void

Updates the mask.

UpdateSelectionHighlighter ( ) : void

Updates the selection highlighter.

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

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

Begins the GUI area.

CalculateCost ( ResourceTileLite, tiles ) : int

Calculates the cost of performing this action on the given tiles

ConcludeActionOnResourceTiles ( ResourceTileSelection, selection ) : void

Concludes the action on resource tiles.

DisplayControlsContents ( ) : void

Displays the controls contents.

DisplayPaintSelectionControlGroup ( ) : void

Displays the paint selection control group.

DoItButton ( ) : void

The button to perform the action.

DoResourceCalculations ( ResourceTileSelection, selection ) : bool
EndGUIArea ( ) : void

Ends the GUI area.

GetActionJson ( ) : string

Gets JSON representation for the action.

Creates a JSON object for use with god mode.

GetActionJson ( object mods ) : string
GetDoItWWW ( ResourceTileSelection, selection ) : WWW

Gets the do it WWW.

GetEffectSpawnLocationsFromResourceTiles ( ResourceTileSelection, selection ) : Vector3[]

Gets the effect spawn locations from resource tiles.

Put ( ResourceTileSelection, selection ) : IEnumerator

Forces a put of resource tile modifications using god mode.

This is a temporary solution for implementing actions with no server API point, and can eventually be removed.

Refresh ( ) : IEnumerator
RefreshAfterActionFailed ( string errorMessage ) : IEnumerator

Refreshs after the action failed.

SendActionMessage ( ResourceTile, modifiedTiles ) : void

Sends out a message stating that an action was performed

SpawnEffectsAtLocations ( Vector3 spawnLocations ) : void

Spawns the effects at locations.

SubmitResourceTileSelection ( ResourceTileSelection, selection ) : void

Submits the resource tile selection.

NOTE: This may need a more sophisticated implementation if e.g., player action changes before server responds.

SubmitResourceTileSelectionToServerAPI ( ResourceTileSelection, selection ) : IEnumerator

Submits the resource tile selection to server API.

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

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

Begins the GUI area.
protected BeginGUIArea ( ) : void
Результат void

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

Calculates the cost of performing this action on the given tiles
protected CalculateCost ( ResourceTileLite, tiles ) : int
tiles ResourceTileLite, /// Tiles. ///
Результат int

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

Concludes the action on resource tiles.
protected ConcludeActionOnResourceTiles ( ResourceTileSelection, selection ) : void
selection ResourceTileSelection, /// Tiles. ///
Результат void

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

Configure the dialog
public DisplayControls ( ) : void
Результат void

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

Displays the controls contents.
protected DisplayControlsContents ( ) : void
Результат void

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

Displays the paint selection control group.
protected DisplayPaintSelectionControlGroup ( ) : void
Результат void

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

public DoAction ( GUIButtonBase, button ) : void
button GUIButtonBase,
Результат void

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

Perform the action.
public DoIt ( object selection ) : void
selection object /// The selection to which the action should be applied. ///
Результат void

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

The button to perform the action.
protected DoItButton ( ) : void
Результат void

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

protected DoResourceCalculations ( ResourceTileSelection, selection ) : bool
selection ResourceTileSelection,
Результат bool

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

Ends the GUI area.
protected EndGUIArea ( ) : void
Результат void

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

Gets JSON representation for the action.
Creates a JSON object for use with god mode.
protected GetActionJson ( ) : string
Результат string

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

protected GetActionJson ( object mods ) : string
mods object
Результат string

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

Gets the do it WWW.
protected GetDoItWWW ( ResourceTileSelection, selection ) : WWW
selection ResourceTileSelection, /// The selection. ///
Результат WWW

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

Gets the effect spawn locations from resource tiles.
protected GetEffectSpawnLocationsFromResourceTiles ( ResourceTileSelection, selection ) : Vector3[]
selection ResourceTileSelection, /// Tiles. ///
Результат Vector3[]

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

Determines whether this action is permitted on the specified tile.
public abstract IsPermittedOnResourceTile ( ResourceTile, tile ) : bool
tile ResourceTile, /// The resource tile in question. ///
Результат bool

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

Raises the enable event.
public OnEnable ( ) : void
Результат void

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

Display loading icon as needed
public OnGUI ( ) : void
Результат void

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

Forces a put of resource tile modifications using god mode.
This is a temporary solution for implementing actions with no server API point, and can eventually be removed.
protected Put ( ResourceTileSelection, selection ) : IEnumerator
selection ResourceTileSelection, /// The selection. ///
Результат IEnumerator

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

protected Refresh ( ) : IEnumerator
Результат IEnumerator

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

Refreshs after the action failed.
protected RefreshAfterActionFailed ( string errorMessage ) : IEnumerator
errorMessage string /// Error message. ///
Результат IEnumerator

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

Sends out a message stating that an action was performed
protected SendActionMessage ( ResourceTile, modifiedTiles ) : void
modifiedTiles ResourceTile,
Результат void

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

Spawns the effects at locations.
protected SpawnEffectsAtLocations ( Vector3 spawnLocations ) : void
spawnLocations Vector3 /// Spawn locations. ///
Результат void

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

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

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

Submits the resource tile selection.
NOTE: This may need a more sophisticated implementation if e.g., player action changes before server responds.
protected SubmitResourceTileSelection ( ResourceTileSelection, selection ) : void
selection ResourceTileSelection, /// The resource tile selection. ///
Результат void

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

Submits the resource tile selection to server API.
protected SubmitResourceTileSelectionToServerAPI ( ResourceTileSelection, selection ) : IEnumerator
selection ResourceTileSelection, /// The resource tile selection. ///
Результат IEnumerator

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

Updates the mask.
public UpdateMask ( ) : void
Результат void

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

Updates the selection highlighter.
public UpdateSelectionHighlighter ( ) : void
Результат void

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

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

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

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

The height of the controls area.
public float controlsAreaHeight
Результат float

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

the base cost to perform the action; modify in GatherData if it is variable
public int cost
Результат int

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

Labels to appear on the submission button.
public GUIContent dialogConfirmButtonDo
Результат GUIContent

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

long description to appear under the question in the dialog
public string dialogLongDescription
Результат string

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

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

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

Prefab for the special effect to spawn, if any
public GameObject effectPrefab
Результат GameObject

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

Flag specifying whether or not the action has a server API point.
When this is false, the action uses a god mode implementation. It will eventually be removed once every action has an API point.
public bool hasServerAPIPoint
Результат bool

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

the icon associated with this action
public Texture2D,UnityEngine icon
Результат UnityEngine.Texture2D

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

The input mode.
public InputMode inputMode
Результат InputMode

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

The action progress.
protected float m_actionProgress
Результат float

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

The tile modifications wrapper.
protected ResourceTileModification m_tileModifications
Результат ResourceTileModification

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

public string notificationMessage
Результат string

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

description of what the action does
public string tooltip
Результат string