IWeaponParams

IWeaponParams interface is implemented by ScriptableObject WeaponParamsSO and class WeaponParams. These classes act as containers for variables that change the behaviour of a weapon. The main difference between these two classes is that the WeaponParams is not persistent, meaning that its data is deleted after leaving play mode, while the WeaponParamsSO is persistent (because it’s a ScriptableObject).

classDiagram
IWeaponParams <|.. WeaponParams : Implements
IWeaponParams <|.. WeaponParamsSO : Implements

Table of contents

  1. IWeaponParams properties
    1. Weapon
    2. Coordinate System
    3. Projectile
    4. Neural Network Pattern
    5. Initial Flight
    6. Reflection

IWeaponParams properties

Weapon

Property Type Description
FireRate float Time in seconds between each burst or multiShot
ProjectilesInOneShot int Number of projectiles in each burst or multiShot
WeaponMode enum Select between MultiShot, Burst
BurstMode enum Select between Clockwise, CounterClockwise, Alternate, Straight, MaxMinAngle, Random
BurstRate float Time in seconds between each shot in a burst

Coordinate System

Property Type Description
RotationSpeed float Rotation of coordinate systems in degrees per second on launch. If negative, rotation will be in opposite direction
MoveSpeed float Speed of coordinate systems in units per second on launch

The pattern is likely to become unstable when coordinate systems are launched with a rotation.

Projectile

Property Type Description
NetworkControlMode enum Select between ForceSum, VelocitySum
ReadMode enum Select between Default, Rotator
Size Vector2 Size of the projectile
HasLifespan bool Does projectile have a lifespan
Lifespan float Time in seconds after which the projectile will self-destruct
HasTrail bool Does projectile have a trail
HueRange Vector2 The range of possible values for the hue component of projectile’s color. The exact value depends on the output of the NN
Saturation float Saturation component of projectile’s color
Brightness float Brightness component of projectile’s color

Neural Network Pattern

Property Type Description
SpeedRange Vector2 The range of possible values for the maximum speed of the projectile. The exact value depends on the output of the NN
ForceRange Vector2 The range of possible values for the force applied on the projectile. The exact value depends on the output of the NN
NNControlDistance float Defines the area where projectiles are controlled by the neural network
SignX float The multiplier of the x output of the NN. If it’s zero, the output will be ignored
SignY float The multiplier of the y output of the NN. If it’s zero, the output will be ignored
ForwardForce bool Apply forward force on the projectile. Forward force is equal to the force output of the NN

Initial Flight

Property Type Description
InitialFlightRadius float Defines the area where projectiles are at InitialFlightState. At this state, projectiles aren’t controlled by the NN, and instead they move with a constant velocity.
InitialSpeed float The magnitude of the initial velocity
Angle float The maximum angle between the projectile’s initial velocity and the y axis of a ProjectileSpawnPoint gameobject

Reflection

Property Type Description
FlipXOnReflect bool On reflection, change the SignX value to the opposite
FlipYOnReflect bool On reflection, change the SignY value to the opposite
Mode enum Select between CircleReflection, RectangleReflection, Polar
ReflectiveCircleRadius float Defines the distance after which the projectile will be reflected
RectDimensions Vector2 Defines the boundaries after which the projectile will be reflected
MaxPolarAngleDeg float Defines the boundaries after which the projectile will be reflected

Back to top

Page last modified: Jun 24 2024 at 07:40 PM.