Class Hazard
A wrapper for Hazards.EnvironmentalHazard.
public class Hazard : TypeCastObject<Hazard>, IWrapper<EnvironmentalHazard>- Inheritance
- 
      
      
      Hazard
- Implements
- 
      IWrapper<EnvironmentalHazard>
- Derived
- Inherited Members
- Extension Methods
Constructors
Hazard(EnvironmentalHazard)
Initializes a new instance of the Hazard class.
public Hazard(EnvironmentalHazard hazard)Parameters
- hazardEnvironmentalHazard
- The Hazards.EnvironmentalHazard instance. 
Properties
AffectedPlayers
Gets or sets the list with all affected by this hazard players.
public IEnumerable<Player> AffectedPlayers { get; set; }Property Value
Base
Gets the Hazards.EnvironmentalHazard.
public EnvironmentalHazard Base { get; }Property Value
- EnvironmentalHazard
IsActive
Gets a value indicating whether hazard is active.
public bool IsActive { get; }Property Value
List
Gets the list of all hazards.
public static IReadOnlyCollection<Hazard> List { get; }Property Value
MaxDistance
Gets or sets max hazard distance.
public float MaxDistance { get; set; }Property Value
MaxHeightDistance
Gets or sets max hazard height.
public float MaxHeightDistance { get; set; }Property Value
Position
Gets or sets the position.
public Vector3 Position { get; set; }Property Value
- Vector3
PositionOffset
Gets or sets offset for position.
public Vector3 PositionOffset { get; set; }Property Value
- Vector3
Room
Gets the room where this hazard is located.
public Room Room { get; }Property Value
Type
Gets the HazardType associated with the current Hazard.
public virtual HazardType Type { get; }Property Value
Methods
Get(HazardType)
Gets an IEnumerable<T> of Hazard.
public static IEnumerable<Hazard> Get(HazardType type)Parameters
- typeHazardType
- The HazardType to get. 
Returns
- IEnumerable<Hazard>
- IEnumerable<T> of Hazard based on type. 
Get(Room)
Gets the hazard by the room where it's located.
public static Hazard Get(Room room)Parameters
- roomRoom
- Room. 
Returns
Get(EnvironmentalHazard)
Gets the Hazard by Hazards.EnvironmentalHazard.
public static Hazard Get(EnvironmentalHazard environmentalHazard)Parameters
- environmentalHazardEnvironmentalHazard
- The Hazards.EnvironmentalHazard instance. 
Returns
Get(Func<Hazard, bool>)
Gets the IEnumerable<T> of Hazard based on predicate.
public static IEnumerable<Hazard> Get(Func<Hazard, bool> predicate)Parameters
Returns
- IEnumerable<Hazard>
- IEnumerable<T> of Hazard based on predicate. 
Get(GameObject)
Gets the hazard by it's UnityEngine.GameObject.
public static Hazard Get(GameObject obj)Parameters
- objGameObject
- Game object. 
Returns
Get<T>(EnvironmentalHazard)
Gets the Hazard by Hazards.EnvironmentalHazard.
public static T Get<T>(EnvironmentalHazard environmentalHazard) where T : HazardParameters
- environmentalHazardEnvironmentalHazard
- The Hazards.EnvironmentalHazard to convert into an hazard. 
Returns
- T
- The hazard wrapper for the given Hazards.EnvironmentalHazard. 
Type Parameters
- T
- The specified Hazard type. 
IsInArea(Player)
Checks if player is in hazard zone.
public bool IsInArea(Player player)Parameters
- playerPlayer
- Player to check.