コード例 #1
0
 private void OnDestroy()
 {
     if (singleton == this)
     {
         singleton = null;
     }
 }
コード例 #2
0
 protected virtual void Awake()
 {
     if (singleton == null)
     {
         singleton       = this;
         playedThisRound = new HashSet <PTPlayer>();
         StartCoroutine(Rule());
     }
     else if (singleton != this)
     {
         Destroy(this);
     }
 }