Beispiel #1
0
 private void Awake()
 {
     if (!instance)
     {
         instance = this;
     }
     else if (this != instance)
     {
         Destroy(gameObject); return;
     }
 }
Beispiel #2
0
 static OnlineClient()
 {
     Battle.onStart += () =>
     {
         var config = Config.instance;
         if (config.playMode != Config.PlayMode.ONLINE)
         {
             return;
         }
         instance               = Instantiate(R.asset.prefab.onlineClient);
         instance.battle        = Battle.instance;
         instance.battle.player = instance;
     };
 }