> For the complete documentation index, see [llms.txt](https://giantgrey.gitbook.io/pulse-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://giantgrey.gitbook.io/pulse-documentation/documentation/quickstart.md).

# Quickstart

### Installation

Simply install Pulse from the package manager inside of Unity. You can find the package manager at: <mark style="color:$info;">**Window / Package Management / Package Manager**</mark>. Go to My Assets and search for Pulse.

After installation you can start using Pulse right away. No setup is required.

#### Namespace

```csharp
using GiantGrey.Pulse;
```

### Quickstart

{% stepper %}
{% step %}

### First Event

Lets start with creating your first event. Each event must be a struct and implement the IPulseSignal interface.

```c#
using GiantGrey.Pulse;

// Your first event
public struct OnFirstEvent : IPulseSignal
{
    // Additional parameters
    public string message;
    public int value;
 
    // Constructor   
    public OnFirstEvent(string _message, int _value)
    {
        message = _message;
        value = _value;
    }
}
```

{% endstep %}

{% step %}

### Subscribe and Unsubscribe to Event

Next we can subscribe and unsubscribe to our first event using following code.

```csharp
public void OnEnable()
{
    Pulse.Subscribe<OnFirstEvent>(FirstEventCalled);
}

public void OnDisable()
{
    Pulse.Unsubscribe<OnFirstEvent>(FirstEventCalled);
}

void FirstEventCalled(OnFirstEvent _evt)
{
    // Get parameters from event
     Debug.Log(_evt.message + " " + _evt.value);
}
```

{% endstep %}

{% step %}

### Emit Event

To emit our first event, simply use following code and pass the parameters to our event constructor.

```csharp
public void EmitEvent()
{
    Pulse.Emit(new OnFirstEvent("Hello World", 666));
}
```

{% endstep %}
{% endstepper %}
