Class Hazard
A wrapper for Hazards.EnvironmentalHazard.
Implements
Inherited Members
Namespace: Exiled.API.Features.Hazards
Assembly: Exiled.API.dll
Syntax
public class Hazard : TypeCastObject<Hazard>, IWrapper<EnvironmentalHazard>
Constructors
| Improve this Doc View SourceHazard(EnvironmentalHazard)
Initializes a new instance of the Hazard class.
Declaration
public Hazard(EnvironmentalHazard hazard)
Parameters
Type | Name | Description |
---|---|---|
Hazards.EnvironmentalHazard | hazard | The Hazards.EnvironmentalHazard instance. |
Properties
| Improve this Doc View SourceAffectedPlayers
Gets or sets the list with all affected by this hazard players.
Declaration
public IEnumerable<Player> AffectedPlayers { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<Player> |
Base
Gets the Hazards.EnvironmentalHazard.
Declaration
public EnvironmentalHazard Base { get; }
Property Value
Type | Description |
---|---|
Hazards.EnvironmentalHazard |
IsActive
Gets a value indicating whether or not hazard is active.
Declaration
public bool IsActive { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
List
Gets the list of all hazards.
Declaration
public static IReadOnlyCollection<Hazard> List { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyCollection<Hazard> |
MaxDistance
Gets or sets max hazard distance.
Declaration
public float MaxDistance { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
MaxHeightDistance
Gets or sets max hazard height.
Declaration
public float MaxHeightDistance { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Position
Gets or sets the position.
Declaration
public Vector3 Position { get; set; }
Property Value
Type | Description |
---|---|
UnityEngine.Vector3 |
PositionOffset
Gets or sets offset for position.
Declaration
public Vector3 PositionOffset { get; set; }
Property Value
Type | Description |
---|---|
UnityEngine.Vector3 |
Room
Gets the room where this hazard is located.
Declaration
public Room Room { get; }
Property Value
Type | Description |
---|---|
Room |
Methods
| Improve this Doc View SourceGet(Room)
Gets the hazard by the room where it's located.
Declaration
public static Hazard Get(Room room)
Parameters
Type | Name | Description |
---|---|---|
Room | room | Room. |
Returns
Type | Description |
---|---|
Hazard |
Get(EnvironmentalHazard)
Gets the Hazard by Hazards.EnvironmentalHazard.
Declaration
public static Hazard Get(EnvironmentalHazard environmentalHazard)
Parameters
Type | Name | Description |
---|---|---|
Hazards.EnvironmentalHazard | environmentalHazard | The Hazards.EnvironmentalHazard instance. |
Returns
Type | Description |
---|---|
Hazard | Hazard for Hazards.EnvironmentalHazard. |
Get(Func<Hazard, Boolean>)
Gets the System.Collections.Generic.IEnumerable<T> of Hazard based on predicate.
Declaration
public static IEnumerable<Hazard> Get(Func<Hazard, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
System.Func<Hazard, System.Boolean> | predicate | Condition to satisfy. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<Hazard> | System.Collections.Generic.IEnumerable<T> of Hazard based on predicate. |
Get(GameObject)
Gets the hazard by it's UnityEngine.GameObject.
Declaration
public static Hazard Get(GameObject obj)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.GameObject | obj | Game object. |
Returns
Type | Description |
---|---|
Hazard |
IsInArea(Player)
Checks if player is in hazard zone.
Declaration
public bool IsInArea(Player player)
Parameters
Type | Name | Description |
---|---|---|
Player | player | Player to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if player is in hazard zone. Otherwise, false. |