C# 클래스 RTSObject, ES2015C

상속: MonoBehaviour
파일 보기 프로젝트 열기: jgirald/ES2015C 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
baseMoveSpeed float
cost int
objectIconAttack Sprite
objectIconAttackRange Sprite
objectIconDefense Sprite
objectIconResource Sprite
objectIconSprite Sprite
objectName string
owner Player,
target RTSObject,

보호된 프로퍼티들

프로퍼티 타입 설명
aiming bool
anim Animator
attacking bool
audio UnityEngine.AudioSource
baseAttackRange int
baseAttackSpeed float
baseAttackStrength int
baseBuildFactor float
baseDefense int?
creationSound UnityEngine.AudioClip
currentlySelected bool
dieSound UnityEngine.AudioClip
dying bool
ent LOSEntity,
fightSound UnityEngine.AudioClip
healthPercentage float
nearbyObjects List
programmedAttackPosition Vector3
remainingTimeToAttack float
remainingTimeToDead float
rigbody UnityEngine.Rigidbody

Private Properties

프로퍼티 타입 설명
BeginDead void
EndAttack void
OnMouseExit void
OnMouseOver void
PerformAttack void
UpdateDeadObject bool
updateSelection void

공개 메소드들

메소드 설명
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

보호된 메소드들

메소드 설명
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

비공개 메소드들

메소드 설명
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

메소드 상세

AimAtTarget() 보호된 메소드

protected AimAtTarget ( ) : void
리턴 void

Animating() 보호된 메소드

protected Animating ( ) : void
리턴 void

AssignBuildingProject() 공개 메소드

Assigns a new building project to this object.
public AssignBuildingProject ( Building, newProject ) : void
newProject Building, The new project to assign, or null to deassign the current project.
리턴 void

AttackObject() 공개 메소드

Begins an attack on the given target object. To stop the current attack sequence, pass null to this method.
public AttackObject ( RTSObject, target ) : void
target RTSObject, The target of the attack. If null is given, the attack will stop.
리턴 void

Awake() 보호된 메소드

protected Awake ( ) : void
리턴 void

BeginAttack() 공개 메소드

Begins an attack sequence on the given target.
public BeginAttack ( RTSObject, newTarget ) : void
newTarget RTSObject, The target of the attack.
리턴 void

CalculateCurrentHealth() 보호된 메소드

protected CalculateCurrentHealth ( ) : void
리턴 void

CanAttack() 공개 메소드

Tells if the object can attack.
public CanAttack ( ) : bool
리턴 bool

CanBeAttacked() 공개 메소드

Tell if the object can be attacked by military units.
public CanBeAttacked ( ) : bool
리턴 bool

CanBeBuilt() 공개 메소드

public CanBeBuilt ( ) : bool
리턴 bool

CanBuild() 공개 메소드

public CanBuild ( ) : bool
리턴 bool

CanMove() 공개 메소드

Tells if the object can change its position.
public CanMove ( ) : bool
리턴 bool

CancelPath() 보호된 메소드

Tell the object to cancel the movement path to the given position.
protected CancelPath ( ) : void
리턴 void

ExtendBounds() 보호된 메소드

protected ExtendBounds ( Transform t, Bounds &b ) : void
t Transform
b Bounds
리턴 void

GetActions() 공개 메소드

Get the list of actions available for this object.
public GetActions ( ) : Action[],
리턴 Action[],

GetAttackRange() 공개 메소드

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.
public GetAttackRange ( ) : float
리턴 float

GetAttackSpeed() 공개 메소드

Gets the attack strengh that the unit has when it is attacking, in attack/second.
public GetAttackSpeed ( ) : float
리턴 float

GetAttackStrength() 공개 메소드

Gets the attack strengh that the unit has when it is attacking.
public GetAttackStrength ( ) : int
리턴 int

GetDefense() 공개 메소드

Gets the defense points that the unit has when it is being attacked.
public GetDefense ( ) : int
리턴 int

GetHarvestAmount() 공개 메소드

Get the current amount of resource that the unit has harvested.
public GetHarvestAmount ( ) : float
리턴 float

GetHarvestType() 공개 메소드

Get the current type of resource that the unit is harvesting.
public GetHarvestType ( ) : ResourceType,
리턴 ResourceType,

GetMovementSpeed() 공개 메소드

Gets the movement speed of a object.
public GetMovementSpeed ( ) : float
리턴 float

HasPath() 보호된 메소드

Returns true if the unit has programmed a movement path to a given position.
protected HasPath ( ) : bool
리턴 bool

IsBuilding() 공개 메소드

Checks if the object is currently building another object.
public IsBuilding ( ) : bool
리턴 bool

IsHarvesting() 공개 메소드

Check if the unit is currently harvesting.
public IsHarvesting ( ) : bool
리턴 bool

IsOwnedBy() 공개 메소드

public IsOwnedBy ( Player, owner ) : bool
owner Player,
리턴 bool

MouseClick() 공개 메소드

public MouseClick ( GameObject hitObject, Vector3 hitPoint, Player, controller ) : void
hitObject GameObject
hitPoint Vector3
controller Player,
리턴 void

MoveTo() 공개 메소드

Tells the object to start a free (non-attack) movement to the given position.
public MoveTo ( Vector3 target, bool isRunning ) : void
target Vector3 The position we want the object to move to.
isRunning bool
리턴 void

OnDestroy() 공개 메소드

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.
public OnDestroy ( ) : void
리턴 void

OnGUI() 보호된 메소드

protected OnGUI ( ) : void
리턴 void

PerformAction() 공개 메소드

public PerformAction ( string actionToPerform ) : void
actionToPerform string
리턴 void

ReplaceChildWithChildFromGameObjectTemplate() 공개 메소드

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.
public ReplaceChildWithChildFromGameObjectTemplate ( GameObject newGameObjectTemplate ) : void
newGameObjectTemplate GameObject The object to use as a template for the new child nodes.
리턴 void

SetNewPath() 보호된 메소드

Tells the object to move to the given position, by generating and following a route to the desired position.
protected SetNewPath ( Vector3 target, bool isRunning ) : void
target Vector3 The position we want the object to move to.
isRunning bool
리턴 void

SetSelection() 공개 메소드

public SetSelection ( bool selected ) : void
selected bool
리턴 void

Start() 보호된 메소드

protected Start ( ) : void
리턴 void

TakeDamage() 공개 메소드

Substract health points from this object.
public TakeDamage ( int damage ) : void
damage int The number of health points to substract to this object.
리턴 void

Update() 보호된 메소드

protected Update ( ) : void
리턴 void

UseWeapon() 보호된 메소드

protected UseWeapon ( ) : void
리턴 void

chargeSounds() 보호된 메소드

protected chargeSounds ( string objectName ) : void
objectName string
리턴 void

makeCreationSound() 공개 메소드

public makeCreationSound ( ) : void
리턴 void

프로퍼티 상세

aiming 보호되어 있는 프로퍼티

protected bool aiming
리턴 bool

anim 보호되어 있는 프로퍼티

protected Animator anim
리턴 Animator

attacking 보호되어 있는 프로퍼티

true if the unit is attacking or moving into position to attack another unit.
protected bool attacking
리턴 bool

audio 보호되어 있는 프로퍼티

protected AudioSource,UnityEngine audio
리턴 UnityEngine.AudioSource

baseAttackRange 보호되어 있는 프로퍼티

Default attack strength. Leave at zero if the object isn't a range unit.
protected int baseAttackRange
리턴 int

baseAttackSpeed 보호되어 있는 프로퍼티

Default number of hits per second of the object. Leave at zero if the object can't attack.
protected float baseAttackSpeed
리턴 float

baseAttackStrength 보호되어 있는 프로퍼티

Default attack strength. Leave at zero if the object can't attack.
protected int baseAttackStrength
리턴 int

baseBuildFactor 보호되어 있는 프로퍼티

Default speed factor of building (x1 = default building time, x2 = half building time, etc). Leave at zero if the unit can't build.
protected float baseBuildFactor
리턴 float

baseDefense 보호되어 있는 프로퍼티

Default attack defense. Leave at null if the object can't defend.
protected int? baseDefense
리턴 int?

baseMoveSpeed 공개적으로 프로퍼티

Default movement speed. Leave at zero if the object can't move.
public float baseMoveSpeed
리턴 float

cost 공개적으로 프로퍼티

public int cost
리턴 int

creationSound 보호되어 있는 프로퍼티

protected AudioClip,UnityEngine creationSound
리턴 UnityEngine.AudioClip

currentlySelected 보호되어 있는 프로퍼티

protected bool currentlySelected
리턴 bool

dieSound 보호되어 있는 프로퍼티

protected AudioClip,UnityEngine dieSound
리턴 UnityEngine.AudioClip

dying 보호되어 있는 프로퍼티

true if the unit is dying (it has zero hit points and it playing the dead animation).
protected bool dying
리턴 bool

ent 보호되어 있는 프로퍼티

protected LOSEntity, ent
리턴 LOSEntity,

fightSound 보호되어 있는 프로퍼티

protected AudioClip,UnityEngine fightSound
리턴 UnityEngine.AudioClip

healthPercentage 보호되어 있는 프로퍼티

protected float healthPercentage
리턴 float

nearbyObjects 보호되어 있는 프로퍼티

protected List nearbyObjects
리턴 List

objectIconAttack 공개적으로 프로퍼티

public Sprite objectIconAttack
리턴 Sprite

objectIconAttackRange 공개적으로 프로퍼티

public Sprite objectIconAttackRange
리턴 Sprite

objectIconDefense 공개적으로 프로퍼티

public Sprite objectIconDefense
리턴 Sprite

objectIconResource 공개적으로 프로퍼티

public Sprite objectIconResource
리턴 Sprite

objectIconSprite 공개적으로 프로퍼티

public Sprite objectIconSprite
리턴 Sprite

objectName 공개적으로 프로퍼티

public string objectName
리턴 string

owner 공개적으로 프로퍼티

public Player, owner
리턴 Player,

programmedAttackPosition 보호되어 있는 프로퍼티

If attacking, position where the unit is programmed to move in order to attack another unit.
protected Vector3 programmedAttackPosition
리턴 Vector3

remainingTimeToAttack 보호되어 있는 프로퍼티

If attacking, number of seconds remaining until the unit takes another hit to the target.
protected float remainingTimeToAttack
리턴 float

remainingTimeToDead 보호되어 있는 프로퍼티

Number of seconds until the unit is considered dead and it disappears from the map.
protected float remainingTimeToDead
리턴 float

rigbody 보호되어 있는 프로퍼티

protected Rigidbody,UnityEngine rigbody
리턴 UnityEngine.Rigidbody

target 공개적으로 프로퍼티

public RTSObject, target
리턴 RTSObject,