// 리모트 플레이어를 만든다.. public void createNetPlayers() { Debug.Log("Create Remote players"); for (int i = 0; i < NetConfig.PLAYER_MAX; i++) { // 로컬 플레이어는 스킵. if (i == GlobalParam.get().global_account_id) { continue; } Debug.Log("Create Remote players[" + i + "] " + this.isConnected(i)); if (!this.isConnected(i)) { continue; } if (this.network != null) { PartyControl.get().createNetPlayer(i); } else { PartyControl.get().createFakeNetPlayer(i); } } if (this.network == null) { for (int i = 0; i < PartyControl.get().getFriendCount(); i++) { chrBehaviorFakeNet friend = PartyControl.get().getFriend(i) as chrBehaviorFakeNet; if (friend == null) { continue; } friend.in_formation = true; } } }
// 페이크 네트 플레이어 만들기. public void createFakeNetPlayer(int account_global_index) { chrBehaviorLocal local_player = this.players[0].GetComponent <chrBehaviorLocal>(); chrBehaviorFakeNet net_player = null; int local_index = this.players.Count; AccountData account_data = AccountManager.get().getAccountData(account_global_index); string avator_name = "Player_" + account_data.avator_id; net_player = CharacterRoot.getInstance().createPlayerAsFakeNet(avator_name).GetComponent <chrBehaviorFakeNet>(); net_player.control.local_index = local_index; net_player.control.global_index = account_global_index; net_player.local_player = local_player; net_player.position_in_formation = this.getInFormationOffset(account_global_index); net_player.transform.Translate(this.getLocalPlayer().control.getPosition() + net_player.position_in_formation); this.players.Add(net_player); }
// ================================================================ // protected void create_debug_window() { var window = dbwin.root().createWindow("party"); window.createButton("다음 사람") .setOnPress(() => { GlobalParam.getInstance().global_account_id = (GlobalParam.getInstance().global_account_id + 1) % 4; GlobalParam.getInstance().fadein_start = false; GameRoot.get().restartGameScane(); }); window.createButton("도와줘요~") .setOnPress(() => { int friend_count = PartyControl.get().getFriendCount(); if (friend_count < 3) { int friend_global_index = (GlobalParam.getInstance().global_account_id + friend_count + 1) % 4; this.createFakeNetPlayer(friend_global_index); } }); window.createButton("바이바~이") .setOnPress(() => { int friend_count = PartyControl.get().getFriendCount(); if (friend_count >= 1) { chrBehaviorPlayer player = this.getFriend(0); int friend_global_index = player.control.global_index; this.deleteNetPlayer(friend_global_index); } }); window.createButton("집합!") .setOnPress(() => { int friend_count = this.getFriendCount(); for (int i = 0; i < friend_count; i++) { chrBehaviorFakeNet friend = this.getFriend(i) as chrBehaviorFakeNet; if (friend == null) { continue; } friend.in_formation = true; } }); window.createButton("해산!") .setOnPress(() => { int friend_count = this.getFriendCount(); for (int i = 0; i < friend_count; i++) { chrBehaviorFakeNet friend = this.getFriend(i) as chrBehaviorFakeNet; if (friend == null) { continue; } friend.in_formation = false; } }); window.createButton("아저씨개!") .setOnPress(() => { notifySummonBeast(Character.BEAST_TYPE.DOG); //this.request_summon_beast = Character.BEAST_TYPE.DOG; }); window.createButton("아줌마냥!") .setOnPress(() => { notifySummonBeast(Character.BEAST_TYPE.NEKO); //this.request_summon_beast = Character.BEAST_TYPE.NEKO; }); window.createButton("소환해제") .setOnPress(() => { unsummonBeast(); }); }