private void Awake() { if (!instance) { instance = this; } else if (this != instance) { Destroy(gameObject); return; } }
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; }; }