⮞ Go to NeoFPS.com

    Show / Hide Table of Contents

    Class ToggleOrHold

    A simple class for tracking on/off inputs in either toggle mode or hold down. Also allows for simple reference counted blockers that can interrupt and toggle the output, though care must be taken to make sure each blocker is removed when appropriate. For a safer but less optimal implementation that allows tracking of specific blockers, use the SafeToggleOrHold base class.

    Inheritance
    Object
    ToggleOrHold
    ToggleOrHoldEvent
    ToggleOrHoldUnityEvent
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: NeoFPS
    Assembly: NeoFPS.dll
    Syntax
    [Serializable]
    public class ToggleOrHold

    Constructors

    ToggleOrHold(Func<Boolean>)

    Declaration
    protected ToggleOrHold(Func<bool> isBlockedCallback)
    Parameters
    Type Name Description
    System.Func<System.Boolean> isBlockedCallback

    Properties

    isBlocked

    Declaration
    public bool isBlocked { get; }
    Property Value
    Type Description
    System.Boolean

    on

    Declaration
    public bool on { get; set; }
    Property Value
    Type Description
    System.Boolean

    Methods

    Hold(Boolean)

    Declaration
    public void Hold(bool hold = true)
    Parameters
    Type Name Description
    System.Boolean hold

    OnActivate()

    Declaration
    protected virtual void OnActivate()

    OnDeactivate()

    Declaration
    protected virtual void OnDeactivate()

    ReadProperties(INeoDeserializer, Int32)

    Declaration
    public void ReadProperties(INeoDeserializer reader, int hash)
    Parameters
    Type Name Description
    INeoDeserializer reader
    System.Int32 hash

    ReadProperties(INeoDeserializer, String)

    Declaration
    public void ReadProperties(INeoDeserializer reader, string key)
    Parameters
    Type Name Description
    INeoDeserializer reader
    System.String key

    SetInput(Boolean, Boolean)

    Declaration
    public void SetInput(bool toggle, bool hold)
    Parameters
    Type Name Description
    System.Boolean toggle
    System.Boolean hold

    Toggle()

    Declaration
    public void Toggle()

    WriteProperties(INeoSerializer, Int32, Boolean)

    Declaration
    public void WriteProperties(INeoSerializer writer, int hash, bool writeBlockers)
    Parameters
    Type Name Description
    INeoSerializer writer
    System.Int32 hash
    System.Boolean writeBlockers

    WriteProperties(INeoSerializer, String, Boolean)

    Declaration
    public void WriteProperties(INeoSerializer writer, string key, bool writeBlockers)
    Parameters
    Type Name Description
    INeoSerializer writer
    System.String key
    System.Boolean writeBlockers
    Back to top Copyright © 2019 Yondernauts Game Studios Ltd
    Generated with DocFX