C# Class CBaseEntity, astrochimps

Basic class for monkeys and drones
Inheritance: MonoBehaviour
Show file Open project: arcoelho01/astrochimps Class Usage Examples

Public Properties

Property Type Description
Movable bool
Name string
Selectable bool
Team eObjTeam
Type eObjType
canBeCaptured bool
costMetal float
costTime float
isCaptured bool
mainRendererObject Transform
mainScript MainScript,
materialDisabled Material
progressBarPrefab Transform
selectorObject Transform

Protected Properties

Property Type Description
captureRaySpot Transform
captureSpot Transform
capturedEntity CBaseEntity,
capturer Transform
meshObject Transform
selectorRadius float
sweetSpot Vector3
sweetSpotObj Transform

Public Methods

Method Description
Attacked ( ) : void

What to do when this entity is attacked

BuildIt ( ) : void

Declaration of the build function

CapturedBy ( Transform capturer, Transform captureSpot, Transform captureRaySpot ) : void

Somebody captured this entity!

CheckIfHaveSomethingCaptured ( ) : bool

Check if this unit is carrying something or someone

CreateSelector ( ) : void

Instantiate the selector object, showing the user what object he selected

Deselect ( ) : void

Deselect the current object, if possible

IWasSetToVisible ( ) : void

The VisibilityControl script set me to visible. If this object is a resource, we should inform the Quest Manager

ReleaseMe ( ) : void

Release the captured object

Select ( ) : Transform

Runs whenever this object is selected in the game. Different objects have different behaviours. Monkeys and drones, when selected, have a cursor added to themselves.

Start ( ) : void
Work ( ) : void

Do whatever this building is supposed to do

Protected Methods

Method Description
GetCaptureRaySpot ( ) : Transform

Get the Capture Ray Spot object from the hierarchy, which is the spot from where the capture ray is shoot. Useful only for the cientist monkey and the hunter drones

GetCaptureSpot ( ) : Transform

Get the Capture Spot object from the hierarchy. Useful only for the cientist monkey and the hunter drones

GetMeshObject ( ) : Transform

Get the mesh object in the hierarchy, as this: Object -> collider | - Icon | - SweetSpot | - Mesh | - Imported FBX -> animation

GetSweetSpotAndMeshObject ( ) : void

Get the mesh object, the renderer and the sweet spot for this object

GetSweetSpotPosition ( ) : Vector3

Get the sweet spot position, if this object is defined. Otherwise, will return this object position

Method Details

Attacked() public method

What to do when this entity is attacked
public Attacked ( ) : void
return void

BuildIt() public method

Declaration of the build function
public BuildIt ( ) : void
return void

CapturedBy() public method

Somebody captured this entity!
public CapturedBy ( Transform capturer, Transform captureSpot, Transform captureRaySpot ) : void
capturer Transform Transform for who is capturing this object
captureSpot Transform Transform of the capture spot (inside the hierarchy of the capturer)
captureRaySpot Transform Transform of the spot from where the capture ray is shoot
return void

CheckIfHaveSomethingCaptured() public method

Check if this unit is carrying something or someone
public CheckIfHaveSomethingCaptured ( ) : bool
return bool

CreateSelector() public method

Instantiate the selector object, showing the user what object he selected
public CreateSelector ( ) : void
return void

Deselect() public method

Deselect the current object, if possible
public Deselect ( ) : void
return void

GetCaptureRaySpot() protected method

Get the Capture Ray Spot object from the hierarchy, which is the spot from where the capture ray is shoot. Useful only for the cientist monkey and the hunter drones
protected GetCaptureRaySpot ( ) : Transform
return Transform

GetCaptureSpot() protected method

Get the Capture Spot object from the hierarchy. Useful only for the cientist monkey and the hunter drones
protected GetCaptureSpot ( ) : Transform
return Transform

GetMeshObject() protected method

Get the mesh object in the hierarchy, as this: Object -> collider | - Icon | - SweetSpot | - Mesh | - Imported FBX -> animation
protected GetMeshObject ( ) : Transform
return Transform

GetSweetSpotAndMeshObject() protected method

Get the mesh object, the renderer and the sweet spot for this object
protected GetSweetSpotAndMeshObject ( ) : void
return void

GetSweetSpotPosition() protected method

Get the sweet spot position, if this object is defined. Otherwise, will return this object position
protected GetSweetSpotPosition ( ) : Vector3
return Vector3

IWasSetToVisible() public method

The VisibilityControl script set me to visible. If this object is a resource, we should inform the Quest Manager
public IWasSetToVisible ( ) : void
return void

ReleaseMe() public method

Release the captured object
public ReleaseMe ( ) : void
return void

Select() public method

Runs whenever this object is selected in the game. Different objects have different behaviours. Monkeys and drones, when selected, have a cursor added to themselves.
public Select ( ) : Transform
return Transform

Start() public method

public Start ( ) : void
return void

Work() public method

Do whatever this building is supposed to do
public Work ( ) : void
return void

Property Details

Movable public property

public bool Movable
return bool

Name public property

public string Name
return string

Selectable public property

public bool Selectable
return bool

Team public property

public eObjTeam Team
return eObjTeam

Type public property

public eObjType Type
return eObjType

canBeCaptured public property

public bool canBeCaptured
return bool

captureRaySpot protected property

protected Transform captureRaySpot
return Transform

captureSpot protected property

protected Transform captureSpot
return Transform

capturedEntity protected property

protected CBaseEntity, capturedEntity
return CBaseEntity,

capturer protected property

protected Transform capturer
return Transform

costMetal public property

public float costMetal
return float

costTime public property

public float costTime
return float

isCaptured public property

public bool isCaptured
return bool

mainRendererObject public property

public Transform mainRendererObject
return Transform

mainScript public property

public MainScript, mainScript
return MainScript,

materialDisabled public property

public Material materialDisabled
return Material

meshObject protected property

protected Transform meshObject
return Transform

progressBarPrefab public property

public Transform progressBarPrefab
return Transform

selectorObject public property

public Transform selectorObject
return Transform

selectorRadius protected property

protected float selectorRadius
return float

sweetSpot protected property

protected Vector3 sweetSpot
return Vector3

sweetSpotObj protected property

protected Transform sweetSpotObj
return Transform