Beispiel #1
0
 /// <summary>
 /// Try comply target value
 /// </summary>
 public void CheckCompliance()
 {
     if (IsComplied())
     {
         Reached?.Invoke(this, EventArgs.Empty);
     }
 }
Beispiel #2
0
 public void Happen()
 {
     //NOTE check null here in case of no listener's situation...
     //NOTE every arg should extend from EventArgs
     Reached?.Invoke(this, null !);
     var ms = Reached.GetType().GetMembers();
 }
    private void OnTriggerEnter(Collider col)
    {
        if (!col.gameObject.CompareTag("Throwable"))
        {
            return;
        }

        if (Reached != null)
        {
            Reached.Invoke();
        }
    }
Beispiel #4
0
    private void Activate()
    {
        if (Time.time - _lastActivated < minimumTimeBetweenLandings)
        {
            return;
        }

        _particle.Play();
        _audioSource.Play();
        _activated = true;
        Reached.Invoke(this);
    }
Beispiel #5
0
 /// <summary>
 /// Trigger the reached event.
 /// </summary>
 void OnReached()
 {
     Reached?.Invoke(this);
 }