示例#1
0
 private void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
         return;
     }
     else
     {
         instance = this;
     }
 }
示例#2
0
    void Awake()
    {
        if (instance != null && instance != this)
        {
            Destroy(this.gameObject);
            return;
        }
        else
        {
            instance = this;
        }


        mySpawnPositions = new List <Transform> (this.gameObject.GetComponentsInChildren <Transform> ());
        mySpawnPositions.Remove(this.transform);
    }