ItemShooter
A class in Root.Township, the global namespace.
Debug component that fires the pickup in a dock through a Shooter, once or on a timer. Clients ask the server to shoot.
- Listed in Global namespace: I to L
- Inherits or implements
NetworkEntityBehaviour
Constructors
| Member | What it is |
|---|---|
ItemShooter() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
12 private and internal fields
| Member | What it is |
|---|---|
private AltaCoroutine coroutine | The running AutoShoot coroutine. |
private float interval | Seconds between auto shots. |
private bool isAutoshooting | Whether auto shooting is on. |
private PickupDock itemDock | Dock holding the pickup to fire. |
private static Logger logger | Logger for this component. |
private float maxVelocity | Shot speed passed to the shooter. |
private Pickup pickup | Parent pickup that shot items ignore. |
private bool shoot | Editor button field: shoots once. |
private Shooter shooter | The Shooter that launches the item. |
private Vector3 shootingDirection | Local direction to shoot in. |
private MethodSync syncShoot | Sync message clients use to ask the server to shoot. |
private bool toggleAutoshoot | Editor button field: toggles auto shoot. |
Methods
| Member | What it is |
|---|---|
override void Initialize() | Sets up the shoot sync message. |
void ShootOne() | Fires the docked pickup along shootingDirection at maxVelocity. A client sends a request to the server instead. |
8 private and internal methods
| Member | What it is |
|---|---|
private IEnumerator AutoShoot() (iterator) | Coroutine that shoots once every interval seconds. |
private void Awake() | Finds the parent pickup and, if there is one, stops shot items from hitting it. |
private void IgnoreArrowCollisions(Shooter arg1, Pickup arg2) | Called before each shot. Makes the shot item ignore the parent pickup's colliders for a while. |
private void OnValidate() | Editor buttons: shoots once or toggles auto shoot. |
private void StartAutoshoot() | Starts the AutoShoot coroutine. |
private void StopAutoshoot() | Stops the AutoShoot coroutine. |
private void SyncShoot(IPlayer player, Stream stream) | Server: shoots when it gets the request. It does not check who sent it. |
private void ToggleAutoShoot() | Turns auto shooting on or off. |