AirstrikeOnInterval

Updated a year ago

AirstrikeOnInterval

This documentation provides an explanation of the code for the AirstrikeOnInterval class.

Class Structure

The AirstrikeOnInterval class is a MonoBehaviour that inherits from the Unity class MonoBehaviour. It is defined within the AndrewFTW namespace.

Public Fields

The class has the following public fields:

  • Projectiles (ProjectileDataList[]): An array of ProjectileDataList objects representing the projectiles to be used in the airstrike.
  • ListRepetitionNum (int): The number of times the list of projectiles will be repeated in the airstrike.
  • SpawnAltitude (float): The altitude at which the projectiles will be spawned.
  • CalledByPlayer (bool): A flag indicating whether the airstrike is called by the player.

Serializable Class

The AirstrikeOnInterval class contains a nested serializable class ProjectileDataList.

ProjectileDataList

  • Projectile (GameObject): The projectile GameObject to be fired.
  • InitVel (float): The initial velocity of the projectile.
  • WaitBeforFire (float): The wait time before firing the projectile.
  • ConeLerpAccuracy (float): The cone lerp accuracy for projectile direction.

Public Methods

  • Start(): Called when the script instance is being loaded. It initializes the Position and starts the airstrike coroutine.
  • IDKWhatToCallIt(): A coroutine that performs the airstrike by iterating through the Projectiles array and spawning the projectiles at regular intervals. Each projectile is instantiated and fired in the specified direction. The airstrike continues until the specified number of repetitions is reached.