Beispiel #1
0
 void Awake()
 {
     if (_instance == null)
     {
         _instance = this;
     }
     else if (_instance != this)
     {
         Destroy(this.gameObject);
     }
 }
Beispiel #2
0
        public static void Spawn()
        {
            _instance = FindObjectOfType <MouseControls>();
            if (_instance == null)
            {
                return;
            }

            var GO = new GameObject("Mouse Trail");

            GO.transform.SetParent(Tower.Player.transform.parent);
            _instance = GO.AddComponent <MouseControls>();
        }