Property | Type | Description | |
---|---|---|---|
baseMoveSpeed | float | ||
cost | int | ||
objectIconAttack | Sprite | ||
objectIconAttackRange | Sprite | ||
objectIconDefense | Sprite | ||
objectIconResource | Sprite | ||
objectIconSprite | Sprite | ||
objectName | string | ||
owner | Player, | ||
target | RTSObject, |
Property | Type | Description | |
---|---|---|---|
aiming | bool | ||
anim | Animator | ||
attacking | bool | ||
audio | |||
baseAttackRange | int | ||
baseAttackSpeed | float | ||
baseAttackStrength | int | ||
baseBuildFactor | float | ||
baseDefense | int? | ||
creationSound | |||
currentlySelected | bool | ||
dieSound | |||
dying | bool | ||
ent | LOSEntity, | ||
fightSound | |||
healthPercentage | float | ||
nearbyObjects | List |
||
programmedAttackPosition | Vector3 | ||
remainingTimeToAttack | float | ||
remainingTimeToDead | float | ||
rigbody |
Property | Type | Description | |
---|---|---|---|
BeginDead | void | ||
EndAttack | void | ||
OnMouseExit | void | ||
OnMouseOver | void | ||
PerformAttack | void | ||
UpdateDeadObject | bool | ||
updateSelection | void |
Method | Description | |
---|---|---|
AssignBuildingProject ( Building, newProject ) : void |
Assigns a new building project to this object.
|
|
AttackObject ( RTSObject, target ) : void |
Begins an attack on the given target object. To stop the current attack sequence, pass null to this method.
|
|
BeginAttack ( RTSObject, newTarget ) : void |
Begins an attack sequence on the given target.
|
|
CanAttack ( ) : bool |
Tells if the object can attack.
|
|
CanBeAttacked ( ) : bool |
Tell if the object can be attacked by military units.
|
|
CanBeBuilt ( ) : bool | ||
CanBuild ( ) : bool | ||
CanMove ( ) : bool |
Tells if the object can change its position.
|
|
GetActions ( ) : Action[], |
Get the list of actions available for this object.
|
|
GetAttackRange ( ) : float |
Gets the distance at which the unit can attack, if it is a range unit (e.g. an archer). Otherwise, returns zero if the unit is not a range unit.
|
|
GetAttackSpeed ( ) : float |
Gets the attack strengh that the unit has when it is attacking, in attack/second.
|
|
GetAttackStrength ( ) : int |
Gets the attack strengh that the unit has when it is attacking.
|
|
GetDefense ( ) : int |
Gets the defense points that the unit has when it is being attacked.
|
|
GetHarvestAmount ( ) : float |
Get the current amount of resource that the unit has harvested.
|
|
GetHarvestType ( ) : ResourceType, |
Get the current type of resource that the unit is harvesting.
|
|
GetMovementSpeed ( ) : float |
Gets the movement speed of a object.
|
|
IsBuilding ( ) : bool |
Checks if the object is currently building another object.
|
|
IsHarvesting ( ) : bool |
Check if the unit is currently harvesting.
|
|
IsOwnedBy ( Player, owner ) : bool | ||
MouseClick ( GameObject hitObject, Vector3 hitPoint, Player, controller ) : void | ||
MoveTo ( Vector3 target, bool isRunning ) : void |
Tells the object to start a free (non-attack) movement to the given position.
|
|
OnDestroy ( ) : void |
This method is called when the object is destroyed. In this case, we need to update the paths for A* to no longer consider our destroyed object.
|
|
PerformAction ( string actionToPerform ) : void | ||
ReplaceChildWithChildFromGameObjectTemplate ( GameObject newGameObjectTemplate ) : void |
Replaces all the child nodes of the GameObject associated with this object, with the child nodes of the given GameObject template. This can be used, for instance, to exchange the model that is used to display the different versions (on construction, semidemolished, complete, ...) of a building.
|
|
SetSelection ( bool selected ) : void | ||
TakeDamage ( int damage ) : void |
Substract health points from this object.
|
|
makeCreationSound ( ) : void |
Method | Description | |
---|---|---|
AimAtTarget ( ) : void | ||
Animating ( ) : void | ||
Awake ( ) : void | ||
CalculateCurrentHealth ( ) : void | ||
CancelPath ( ) : void |
Tell the object to cancel the movement path to the given position.
|
|
ExtendBounds ( Transform t, Bounds &b ) : void | ||
HasPath ( ) : bool |
Returns true if the unit has programmed a movement path to a given position.
|
|
OnGUI ( ) : void | ||
SetNewPath ( Vector3 target, bool isRunning ) : void |
Tells the object to move to the given position, by generating and following a route to the desired position.
|
|
Start ( ) : void | ||
Update ( ) : void | ||
UseWeapon ( ) : void | ||
chargeSounds ( string objectName ) : void |
Method | Description | |
---|---|---|
BeginDead ( ) : void |
Begins the dead transition.
|
|
EndAttack ( ) : void |
Cancels an attack sequence on the given target.
|
|
OnMouseExit ( ) : void | ||
OnMouseOver ( ) : void | ||
PerformAttack ( ) : void |
If the object is performing an attack, inflicts damage to the target according to the attack speed, strength and target defense, or moves closer to the target in order to perform the attack.
|
|
UpdateDeadObject ( ) : bool |
Checks if the required time between the unit having zero health points and the unit disappearing has elapsed.
|
|
updateSelection ( ) : void |
public AssignBuildingProject ( Building, newProject ) : void | ||
newProject | Building, | The new project to assign, or null to deassign the current project. |
return | void |
public AttackObject ( RTSObject, target ) : void | ||
target | RTSObject, | The target of the attack. If null is given, the attack will stop. |
return | void |
public BeginAttack ( RTSObject, newTarget ) : void | ||
newTarget | RTSObject, | The target of the attack. |
return | void |
protected ExtendBounds ( Transform t, Bounds &b ) : void | ||
t | Transform | |
b | Bounds | |
return | void |
public MouseClick ( GameObject hitObject, Vector3 hitPoint, Player, controller ) : void | ||
hitObject | GameObject | |
hitPoint | Vector3 | |
controller | Player, | |
return | void |
public MoveTo ( Vector3 target, bool isRunning ) : void | ||
target | Vector3 | The position we want the object to move to. |
isRunning | bool | |
return | void |
public PerformAction ( string actionToPerform ) : void | ||
actionToPerform | string | |
return | void |
public ReplaceChildWithChildFromGameObjectTemplate ( GameObject newGameObjectTemplate ) : void | ||
newGameObjectTemplate | GameObject | The object to use as a template for the new child nodes. |
return | void |
protected SetNewPath ( Vector3 target, bool isRunning ) : void | ||
target | Vector3 | The position we want the object to move to. |
isRunning | bool | |
return | void |
public TakeDamage ( int damage ) : void | ||
damage | int | The number of health points to substract to this object. |
return | void |
protected chargeSounds ( string objectName ) : void | ||
objectName | string | |
return | void |
protected AudioClip,UnityEngine creationSound | ||
return |
protected AudioClip,UnityEngine dieSound | ||
return |
protected AudioClip,UnityEngine fightSound | ||
return |
protected Vector3 programmedAttackPosition | ||
return | Vector3 |