title: How can I safely use action delegate when delegate's target removed
body: <p>I usually use delegate for callback. For example I declare Action delegate in manager in unity script and I register delegate when  OnEnable called and unsubscribe when OnDisable called in my Monobehaviuor derived script. But I knew maybe it can be dangerous if I resister and unresister at wrong time. For example if object deleted by someone. delegate target will be null. Then unwanted delegate callback can be. 
  So I want to check delegate's target is null when delegate excute and I want to remove it and I want to resister delegate uniquely when same delegate called in same script. How can I use it safely? here is my source example. </p>
  
  <p>manager class </p>
  
  <pre><code>    public class TestManager : MonoBehaviour
  {
      public Action TestDelegate;
      // Use this for initialization
      void Update ()
      {
          if (Input.GetKeyDown("space"))
          {
              if(null != TestDelegate)
              {  
                  TestDelegate();
              }
          }
      }
  }
  </code></pre>
  
  <p>object class </p>
  
  <pre><code>public class WindosTest : MonoBehaviour {
  
      [SerializeField]
      TestManager _manager;   
  
      private void Awake()
      {   
          _manager.TestDelegate += Test;
      }
  
      // Update is called once per frame
      void Update ()
      {
          if (Input.GetKeyDown("d"))
          {
              GameObject.DestroyImmediate(this.gameObject);
          }
      }
  
      void Test()
      {
          UnityEngine.Debug.LogError("test");
      }
  }
  </code></pre>