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
hazard
EnvironmentalHazardThe 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
type
HazardTypeThe 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
room
RoomRoom.
Returns
Get(EnvironmentalHazard)
Gets the Hazard by Hazards.EnvironmentalHazard.
public static Hazard Get(EnvironmentalHazard environmentalHazard)
Parameters
environmentalHazard
EnvironmentalHazardThe 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
obj
GameObjectGame object.
Returns
Get<T>(EnvironmentalHazard)
Gets the Hazard by Hazards.EnvironmentalHazard.
public static T Get<T>(EnvironmentalHazard environmentalHazard) where T : Hazard
Parameters
environmentalHazard
EnvironmentalHazardThe 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
player
PlayerPlayer to check.