Class NGO_GameCharacter
Game character that can move and battle with other characters. This character is designed for multiplayer mode.
Namespace: AutoBattleFramework.Multiplayer.BattleBehaviour.GameActors
Assembly: cs.temp.dll.dll
Syntax
public class NGO_GameCharacter : GameCharacter
Fields
currentEnergy
Current amount of energy of the character.
Declaration
public NetworkVariable<ulong> currentEnergy
Field Value
Type | Description |
---|---|
NetworkVariable<UInt64> |
currentHealth
Amount of current life of the character.
Declaration
public NetworkVariable<ulong> currentHealth
Field Value
Type | Description |
---|---|
NetworkVariable<UInt64> |
fusionItemsIndexes
Indexes of the items, separated by commas, that the previous characters had. When this character is instantiated, the items are equipped.
Declaration
public NetworkVariable<Unity.Collections.FixedString128Bytes> fusionItemsIndexes
Field Value
Type | Description |
---|---|
NetworkVariable<Unity.Collections.FixedString128Bytes> |
targetID
Identifier of the character's target.
Declaration
public NetworkVariable<ulong> targetID
Field Value
Type | Description |
---|---|
NetworkVariable<UInt64> |
Properties
DamageVisualOnly
Only the host can damage characters.
Declaration
public override bool DamageVisualOnly { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
Attack()
If not the host, set the target so that the Animator is synchronized. The attack does no damage. If the host, perform a normal Attack.
Declaration
public override void Attack()
Buy(GameActor)
Ask the server to instantiate the purchased character.
Declaration
public override GameActor Buy(GameActor shopItem)
Parameters
Type | Name | Description |
---|---|---|
GameActor | shopItem | GameCharacter to buy. |
Returns
Type | Description |
---|---|
GameActor | null |
CreateDamagePopup(String, Color)
Creates a text that shows the damage infringed to another character.
Declaration
public override DamagePopup CreateDamagePopup(string text, Color color)
Parameters
Type | Name | Description |
---|---|---|
String | text | Number of the damage infringed. |
Color | color | Color of the text. |
Returns
Type | Description |
---|---|
DamagePopup | Damage text |
GetStatsStruct(CharacterStats)
Get the stats struct of a character stats.
Declaration
public StatsStruct GetStatsStruct(CharacterStats stats)
Parameters
Type | Name | Description |
---|---|---|
CharacterStats | stats | Stats of a character |
Returns
Type | Description |
---|---|
StatsStruct | Stats struct. |
GetTeamIndex()
Get the index of the team to which the character belongs.
Declaration
protected override int GetTeamIndex()
Returns
Type | Description |
---|---|
Int32 | Index of the team to which the character belongs. |
MoveCharacterTo(GridCell)
Move the character and ask the server for update.
Declaration
protected override void MoveCharacterTo(GridCell cell)
Parameters
Type | Name | Description |
---|---|---|
GridCell | cell | The cell where the character will be moved. |
OnNetworkDespawn()
On character despawn, check the traits for changes.
Declaration
public override void OnNetworkDespawn()
OnNetworkSpawn()
When spawned, apply traits, set state, and rotation.
Declaration
public override void OnNetworkSpawn()
Sell()
Sell the characters. Ask the server for despawn the character.
Declaration
public override void Sell()
SetStatsByStruct(CharacterStats, StatsStruct)
Get the stats struct of a character stats.
Declaration
public void SetStatsByStruct(CharacterStats stats, StatsStruct statsStruct)
Parameters
Type | Name | Description |
---|---|---|
CharacterStats | stats | Stats to set |
StatsStruct | statsStruct | Stats struct |
SetVariablesOnSpawn(GameCharacter, IPlayer)
When spawned, apply traits, set state, and rotation.
Declaration
protected override void SetVariablesOnSpawn(GameCharacter character, IPlayer player = null)
Parameters
Type | Name | Description |
---|---|---|
GameCharacter | character | Character spawned. |
IPlayer | player | The owner player instance. |
SpecialAttack()
If not the host, set the target so that the Animator is synchronized. The special attack does no damage. If the host, perform a normal Special Attack.
Declaration
public override void SpecialAttack()
UnequipItemModificator(Int32)
Unequip the character item, and ask the server to instantiate the item and update the stats in the other clients.
Declaration
public override void UnequipItemModificator(int itemModificatorIndex)
Parameters
Type | Name | Description |
---|---|---|
Int32 | itemModificatorIndex |
Update()
Declaration
protected override void Update()