Esempio n. 1
0
 public virtual void RotateOffsetRotation(float offsetRotation)
 {
     if ((int)activator.GetHealthState() >= (int)HealthState.Fibrillating)
     {
         transform.Rotate(0, 0, offsetRotation);
     }
 }
Esempio n. 2
0
    public static bool Activate(IActivator activator, IActivatable activatable, Dictionary <object, object> argumentDictionary = null)
    {
        bool capable = (int)activator.GetHealthState() >= (int)HealthState.Capable;

        if (capable && activatable != null)
        {
            activatable.BecomeActivated(activator, argumentDictionary);
        }
        return(capable);
    }
Esempio n. 3
0
    /**
     * Checks whether the user is still functional and whether the cooldown period has ended.
     */
    public virtual bool BecomeActivated(IActivator activator, Dictionary <object, object> argumentDictionary = null)
    {
        bool isCapable = (int)activator.GetHealthState() >= (int)HealthState.Capable;
        bool isReady   = nextReadyTime <= Time.time;

        bool didActivate = false;

        if (isCapable && isReady)
        {
            Actuate(activator, argumentDictionary);
            nextReadyTime = Time.time + cooldownTimeout;
            didActivate   = true;
        }
        return(didActivate);
    }
Esempio n. 4
0
 public HealthState GetHealthState()
 {
     return(activator.GetHealthState());
 }