Game.Prefabs.RocketPrefab
Assembly: Assembly-CSharp
Namespace: Game.Prefabs
Type: class
Base: HelicopterPrefab
Summary:
RocketPrefab is a simple prefab class used to represent the rocket helicopter vehicle type. It derives from HelicopterPrefab and only overrides the helicopter type identifier so that systems working with helicopter prefabs can treat this prefab as the "Rocket" helicopter. The class is annotated with the Unity-style ComponentMenu attribute to place it under the "Vehicles/" menu in the editor.
Fields
- (none declared)
No private or public fields are declared in this class. All state and behavior are inherited from HelicopterPrefab or its bases.
Properties
- (none declared)
This class does not declare any properties; it relies on inherited properties from HelicopterPrefab.
Constructors
- (implicit)
public RocketPrefab()
No explicit constructor is declared. The default parameterless constructor is provided by the runtime and will invoke base constructors from HelicopterPrefab.
Methods
protected override HelicopterType GetHelicopterType()
Returns the HelicopterType that identifies this prefab. This override returns HelicopterType.Rocket so the prefab is recognized as the Rocket helicopter type by vehicle/vehicle-spawning systems.
Implementation (from source):
protected override HelicopterType GetHelicopterType()
{
return HelicopterType.Rocket;
}
Usage Example
// The prefab itself requires no additional setup beyond being part of the game's prefab set.
// Example: checking type at runtime from a HelicopterPrefab reference
HelicopterPrefab prefab = /* obtain prefab reference */;
if (prefab is Game.Prefabs.RocketPrefab || prefab.GetHelicopterType() == HelicopterType.Rocket)
{
// treat as rocket helicopter
}
Additional notes: - The class is attributed with [ComponentMenu("Vehicles/", new Type[] { })], which places it in the editor component menu under "Vehicles/". - Because the class is minimal, extend or customize by subclassing HelicopterPrefab or by providing additional components on the prefab in the editor if you need custom behavior.