Search Results for

    Show / Hide Table of Contents

    Class Trooper

    Troopers who aim to capture the enemy flag and defend their own. They have a Health value and have a blaster to battle the other team with. Walking into either the flag, a HealthPickup or an AmmoPickup will automatically interact with them.

    Inheritance
    System.Object
    KaijuBehaviour
    KaijuController
    Trooper
    Inherited Members
    KaijuController.Agent
    KaijuController.OnAgentPreSetPosition()
    KaijuController.OnAgentSetPosition()
    KaijuController.OnAgentPreSetOrientation()
    KaijuController.OnAgentSetOrientation()
    KaijuController.OnAgentPreSetScale()
    KaijuController.OnAgentSetScale()
    KaijuController.OnMoveSpeed()
    KaijuController.OnMoveAcceleration()
    KaijuController.OnLookSpeed()
    KaijuController.OnAutoRotate()
    KaijuController.OnLookTarget()
    KaijuController.OnMove()
    KaijuController.OnEnabled()
    KaijuController.OnDisabled()
    KaijuController.OnDestroyed()
    KaijuController.OnMovementStarted(KaijuMovement)
    KaijuController.OnMovementStopped(KaijuMovement)
    KaijuController.OnMovementPerformed(KaijuMovement)
    KaijuController.OnAutomaticSense()
    KaijuController.OnSense(KaijuSensor)
    KaijuController.OnSensorEnabled(KaijuSensor)
    KaijuController.OnSensorDisabled(KaijuSensor)
    KaijuController.OnActuatorDisabled(KaijuActuator)
    KaijuController.OnActuatorStarted(KaijuActuator)
    KaijuController.OnActuatorExecuting(KaijuActuator)
    KaijuController.OnActuatorDone(KaijuActuator)
    KaijuController.OnActuatorInterrupted(KaijuActuator)
    KaijuController.OnActuatorFailed(KaijuActuator)
    KaijuBehaviour.OnPreSetPosition
    KaijuBehaviour.OnPreSetPositionGlobal
    KaijuBehaviour.OnSetPosition
    KaijuBehaviour.OnSetPositionGlobal
    KaijuBehaviour.OnPreSetOrientation
    KaijuBehaviour.OnPreSetOrientationGlobal
    KaijuBehaviour.OnSetOrientation
    KaijuBehaviour.OnSetOrientationGlobal
    KaijuBehaviour.OnPreSetScale
    KaijuBehaviour.OnPreSetScaleGlobal
    KaijuBehaviour.OnSetScale
    KaijuBehaviour.OnSetScaleGlobal
    KaijuBehaviour.Position
    KaijuBehaviour.Position3
    KaijuBehaviour.LocalPosition
    KaijuBehaviour.LocalPosition3
    KaijuBehaviour.X
    KaijuBehaviour.LocalX
    KaijuBehaviour.Y
    KaijuBehaviour.LocalY
    KaijuBehaviour.Z
    KaijuBehaviour.LocalZ
    KaijuBehaviour.Orientation
    KaijuBehaviour.LocalOrientation
    KaijuBehaviour.OrientationAngles
    KaijuBehaviour.LocalOrientationAngles
    KaijuBehaviour.OrientationQuaternion
    KaijuBehaviour.LocalOrientationQuaternion
    KaijuBehaviour.OrientationX
    KaijuBehaviour.LocalOrientationX
    KaijuBehaviour.OrientationY
    KaijuBehaviour.LocalOrientationY
    KaijuBehaviour.OrientationZ
    KaijuBehaviour.LocalOrientationZ
    KaijuBehaviour.OrientationQuaternionX
    KaijuBehaviour.LocalOrientationQuaternionX
    KaijuBehaviour.OrientationQuaternionY
    KaijuBehaviour.LocalOrientationQuaternionY
    KaijuBehaviour.OrientationQuaternionZ
    KaijuBehaviour.LocalOrientationQuaternionZ
    KaijuBehaviour.OrientationQuaternionW
    KaijuBehaviour.LocalOrientationQuaternionW
    KaijuBehaviour.LocalScale
    KaijuBehaviour.LocalScaleX
    KaijuBehaviour.LocalScaleY
    KaijuBehaviour.LocalScaleZ
    KaijuBehaviour.GlobalScale
    KaijuBehaviour.GlobalScaleX
    KaijuBehaviour.GlobalScaleY
    KaijuBehaviour.GlobalScaleZ
    KaijuBehaviour.LocalToWorld
    KaijuBehaviour.WorldToLocal
    KaijuBehaviour.Forward
    KaijuBehaviour.Forward3
    KaijuBehaviour.Backwards
    KaijuBehaviour.Up
    KaijuBehaviour.Down
    KaijuBehaviour.Right
    KaijuBehaviour.Left
    KaijuBehaviour.Parent
    KaijuBehaviour.Root
    KaijuBehaviour.ChildCount
    KaijuBehaviour.HasChanged
    KaijuBehaviour.HierarchyCount
    KaijuBehaviour.HierarchyCapacity
    KaijuBehaviour.Layer
    KaijuBehaviour.ComponentCount
    KaijuBehaviour.ActiveInHierarchy
    KaijuBehaviour.ActiveSelf
    KaijuBehaviour.IsStatic
    KaijuBehaviour.Scene
    Namespace: KaijuSolutions.Agents.Exercises.CTF
    Syntax
    public class Trooper : KaijuController

    Fields

    OnTrooperHitGlobal

    Global callback for one agent hitting another.

    Declaration
    public static MultiTrooperAction OnTrooperHitGlobal
    Field Value
    Type Description
    MultiTrooperAction

    Properties

    All

    All troopers currently active.

    Declaration
    public static IReadOnlyCollection<Trooper> All { get; }
    Property Value
    Type Description
    System.Collections.Generic.IReadOnlyCollection<Trooper>

    AllOne

    All troopers currently active for team one.

    Declaration
    public static IReadOnlyCollection<Trooper> AllOne { get; }
    Property Value
    Type Description
    System.Collections.Generic.IReadOnlyCollection<Trooper>

    AllTwo

    All troopers currently active for team two.

    Declaration
    public static IReadOnlyCollection<Trooper> AllTwo { get; }
    Property Value
    Type Description
    System.Collections.Generic.IReadOnlyCollection<Trooper>

    Ammo

    The ammo for this Trooper's BlasterActuator.

    Declaration
    public int Ammo { get; }
    Property Value
    Type Description
    System.Int32

    CanAttack

    If the BlasterActuator has any ammo and is not .

    Declaration
    public bool CanAttack { get; }
    Property Value
    Type Description
    System.Boolean

    EnemyBase

    Get the location of the other team's base.

    Declaration
    public Vector2 EnemyBase { get; }
    Property Value
    Type Description
    Vector2

    EnemyBase3

    Get the location of the other team's base.

    Declaration
    public Vector3 EnemyBase3 { get; }
    Property Value
    Type Description
    Vector3

    FlagPosition

    Where to store the flag when picking it up.

    Declaration
    public Transform FlagPosition { get; }
    Property Value
    Type Description
    Transform

    HasAmmo

    If the BlasterActuator has any ammo.

    Declaration
    public bool HasAmmo { get; }
    Property Value
    Type Description
    System.Boolean

    Health

    The current health of this trooper.

    Declaration
    public int Health { get; }
    Property Value
    Type Description
    System.Int32

    OwnBase

    Get the location of this trooper's own base.

    Declaration
    public Vector2 OwnBase { get; }
    Property Value
    Type Description
    Vector2

    OwnBase3

    Get the location of this trooper's own base.

    Declaration
    public Vector3 OwnBase3 { get; }
    Property Value
    Type Description
    Vector3

    TeamOne

    What team this trooper is on.

    Declaration
    public bool TeamOne { get; }
    Property Value
    Type Description
    System.Boolean

    Methods

    Attack()

    Fire the BlasterActuator.

    Declaration
    public void Attack()

    OnActuatorEnabled(KaijuActuator)

    Callback for when an has been enabled.

    Declaration
    protected override void OnActuatorEnabled(KaijuActuator actuator)
    Parameters
    Type Name Description
    KaijuActuator actuator

    The .

    Overrides
    KaijuController.OnActuatorEnabled(KaijuActuator)

    Spawn(KaijuAgent, SpawnPoint)

    Spawn a trooper.

    Declaration
    public static Trooper Spawn(KaijuAgent trooperPrefab, SpawnPoint spawnPoint)
    Parameters
    Type Name Description
    KaijuAgent trooperPrefab

    The trooper prefab to spawn.

    SpawnPoint spawnPoint

    The SpawnPoint to spawn the trooper at.

    Returns
    Type Description
    Trooper

    The spawned trooper.

    StopAttacking()

    Cancel trying to fire the BlasterActuator.

    Declaration
    public void StopAttacking()

    TakeDamage(Trooper)

    Take damage from another trooper.

    Declaration
    public void TakeDamage(Trooper attacker)
    Parameters
    Type Name Description
    Trooper attacker

    The trooper that dealt the damage.

    Events

    OnAmmo

    Callback for picking up a AmmoPickup.

    Declaration
    public event AmmoAction OnAmmo
    Event Type
    Type Description
    AmmoAction

    OnAmmoGlobal

    Global callback for picking up a AmmoPickup.

    Declaration
    public event TrooperAmmoAction OnAmmoGlobal
    Event Type
    Type Description
    TrooperAmmoAction

    OnEliminatedByTrooper

    Callback for getting eliminated by another trooper.

    Declaration
    public event TrooperAction OnEliminatedByTrooper
    Event Type
    Type Description
    TrooperAction

    OnEliminatedTrooper

    Callback for eliminated another trooper.

    Declaration
    public event TrooperAction OnEliminatedTrooper
    Event Type
    Type Description
    TrooperAction

    OnFlagCaptured

    Callback for when this agent captured the Flag.

    Declaration
    public event FlagAction OnFlagCaptured
    Event Type
    Type Description
    FlagAction

    OnFlagCapturedGlobal

    Global callback for when this agent captured the Flag.

    Declaration
    public event TrooperFlagAction OnFlagCapturedGlobal
    Event Type
    Type Description
    TrooperFlagAction

    OnFlagDropped

    Callback for when this agent dropped the Flag.

    Declaration
    public event FlagAction OnFlagDropped
    Event Type
    Type Description
    FlagAction

    OnFlagDroppedGlobal

    Global callback for when this agent dropped the Flag.

    Declaration
    public event TrooperFlagAction OnFlagDroppedGlobal
    Event Type
    Type Description
    TrooperFlagAction

    OnFlagPickedUp

    Callback for when this agent picking up the Flag.

    Declaration
    public event FlagAction OnFlagPickedUp
    Event Type
    Type Description
    FlagAction

    OnFlagPickedUpGlobal

    Global callback for when this agent picking up the Flag.

    Declaration
    public event TrooperFlagAction OnFlagPickedUpGlobal
    Event Type
    Type Description
    TrooperFlagAction

    OnFlagReturned

    Callback for when this agent returned the Flag.

    Declaration
    public event FlagAction OnFlagReturned
    Event Type
    Type Description
    FlagAction

    OnFlagReturnedGlobal

    Global callback for when this agent returned the Flag.

    Declaration
    public event TrooperFlagAction OnFlagReturnedGlobal
    Event Type
    Type Description
    TrooperFlagAction

    OnHealth

    Callback for picking up a HealthPickup.

    Declaration
    public event HealthAction OnHealth
    Event Type
    Type Description
    HealthAction

    OnHealthGlobal

    Global callback for picking up a HealthPickup.

    Declaration
    public event TrooperHealthAction OnHealthGlobal
    Event Type
    Type Description
    TrooperHealthAction

    OnHitByTrooper

    Callback for getting hit by another trooper.

    Declaration
    public event TrooperAction OnHitByTrooper
    Event Type
    Type Description
    TrooperAction

    OnHitTrooper

    Callback for hitting another trooper.

    Declaration
    public event TrooperAction OnHitTrooper
    Event Type
    Type Description
    TrooperAction

    OnTrooperEliminatedGlobal

    Global callback for one trooper eliminating another.

    Declaration
    public static event MultiTrooperAction OnTrooperEliminatedGlobal
    Event Type
    Type Description
    MultiTrooperAction
    In This Article
    Back to top MIT License © 2026 Kaiju Solutions Inc.