Exemplo n.º 1
0
 private void OnDestroy()
 {
     if (Instance == this)
     {
         Instance = null;
     }
 }
Exemplo n.º 2
0
    private void Awake()
    {
        if (Instance != null)
        {
            Destroy(this);
            return;
        }

        Instance = this;
        OnValidate();
    }