-
Notifications
You must be signed in to change notification settings - Fork 8
Eco.EM.Framework.Helpers
Here you will find the documentation on the features in the Helpers part of the framework.
Documentation may be incomplete and might need additions, we will update this when we can.
Usage:
using Eco.EM.Framework.Helpers;
Our Helpers have a couple of little features included, some like Sensors, Player Sensor and Daylight Sensor (this may need to be changed a little to work properly)
ie:
IsLike(Input, Value) - This returns a bool ( true | false )
String 1 and string 2 are converted to lower to ensure proper matching.
Returns true or false if its daylight good for items that need to know if its daylight or not,
IsDaylight(int DayTime = 7, int NightTime = 19)
Anyone Near sensor - Detects if anyone is near the sensory object (distance can be set)
Authorized Player Sensor - Detects if the person near is authorized and should function if they are
Anyone in the same room sensor - Checks if anyone is in the same room as the sensor
Usage:
All 3 are bools, so they only return true or false.
AnyoneNear(WorldObject obj, int MaxSensorDistance = 20) - Default is 20 blocks but you can change it too what you like
AuthorizedPersonnelNear(WorldObject obj, int MaxSensorDistance = 20) - Default is 20 blocks but you can change it too what you like
AnyoneInSameRoom(WorldObject obj, int MaxSensorDistance = 20) - Default is 20 blocks but you can change it too what you like
Motion Sensor: Detections for motion in the room Used on lights or Misc ( In unity uses Animated States: IsOff and IsOn )
Proximity Sensor: Detects if someone is near the sensor, used on lights or misc ( In unity uses Animated States: IsOff and IsOn )
Authorized Sensor: Detects if the user is Authorized and then operates based on that ( In unity uses Animated States: IsOff and IsOn )
Usage:
Sensors.MotionSensor(WorldObject object | this, float range)
Sensors.ProximitySensor(WorldObject object | this, float range)
Sensors.AuthorizedSensor(WorldObject object | this, float range)
Ways to use:
public float Range = 10f; // this is done in blocks
public override void Tick()
{
Sensors.Sensor( this, Range );
}