示例#1
0
    public void RegisterBubble(UISpeechBubble uiSpeechBubble)
    {
        foreach (var activeBubble in ActiveBubbles)
        {
            activeBubble.Index++;
        }
        ActiveBubbles.Add(uiSpeechBubble);

    }
 private void Awake()
 {
     if (_instance == null)
     {
         //if not, set instance to this
         _instance = this;
     }
     //If instance already exists and it's not this:
     else if (_instance != this)
     {
         //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager.
         Destroy(gameObject);
         return;
     }
 }