// 쿼리 - 이사를 마쳐도 되는가?. public QueryHouseMoveEnd queryHouseMoveEnd(bool local = true) { QueryHouseMoveEnd query = null; do { query = new QueryHouseMoveEnd(); this.queries.Add(query); } while(false); // 이사 종료 요청을 보냅니다. GameObject netObj = GameObject.Find("Network"); if (netObj && local) { // Network 클래스의 컴포넌트를 획득합니다. Network network = netObj.GetComponent <Network>(); // 이사 종료 요청을 보냅니다. MovingData moving = new MovingData(); moving.characterId = GameRoot.getInstance().account_name_local; moving.houseId = ""; moving.moving = false; MovingPacket packet = new MovingPacket(moving); network.SendReliable <MovingData>(packet); } return(query); }
// ================================================================ // // 비헤이비어용 커맨드. // 쿼리 계통. // 쿼리-말하기(말풍선). public QueryTalk queryTalk(string words, bool local = true) { QueryTalk query = null; do { query = new QueryTalk(words); this.queries.Add(query); } while(false); GameObject netObj = GameObject.Find("Network"); if (netObj && local) { // Network 클래스의 컴포넌트 획득합니다. Network network = netObj.GetComponent <Network>(); // 말풍선 요청을 보냅니다. ChatMessage chat = new ChatMessage(); chat.characterId = GameRoot.getInstance().account_name_local; chat.message = words; ChatPacket packet = new ChatPacket(chat); network.SendReliable <ChatMessage>(packet); } return(query); }
// ================================================================ // // MonoBehaviour에서 상속. void Start() { GameRoot game_root = GameRoot.getInstance(); this.texture_main = game_root.texture_main; this.texture_belo = game_root.texture_belo; this.texture_kado_lu = game_root.texture_kado_lu; this.texture_kado_ru = game_root.texture_kado_ru; this.texture_kado_ld = game_root.texture_kado_ld; this.texture_kado_rd = game_root.texture_kado_rd; }
// 쿼리-이사 시작해도 되는가?. public QueryHouseMoveStart queryHouseMoveStart(string house_name, bool local = true) { QueryHouseMoveStart query = null; do { chrBehaviorNPC_House house = CharacterRoot.getInstance().findCharacter <chrBehaviorNPC_House>(house_name); if (house == null) { break; } query = new QueryHouseMoveStart(house_name); this.queries.Add(query); } while(false); // 이사 시작 요청을 보냅니다. GameObject netObj = GameObject.Find("Network"); if (netObj && local) { // Network 클래스의 컴포넌트 획득합니다. Network network = netObj.GetComponent <Network>(); // 이사 시작 요청을 보냅니다. MovingData moving = new MovingData(); moving.characterId = GameRoot.getInstance().account_name_local; moving.houseId = house_name; moving.moving = true; MovingPacket packet = new MovingPacket(moving); network.SendReliable <MovingData>(packet); // 이사 정보 보존. GlobalParam.get().local_moving = moving; } return(query); }
protected void create_debug_window() { var window = dbwin.root().createWindow("query"); window.createButton("줍는다") .setOnPress(() => { chrBehaviorLocal player = CharacterRoot.get().findCharacter <chrBehaviorLocal>(GameRoot.getInstance().account_name_local); player.controll.cmdItemQueryPick("Tarai"); }); window.createButton("버린다") .setOnPress(() => { chrBehaviorLocal player = CharacterRoot.get().findCharacter <chrBehaviorLocal>(GameRoot.getInstance().account_name_local); player.controll.cmdItemQueryDrop(); }); window.createButton("말풍선") .setOnPress(() => { //chrBehaviorLocal player = CharacterRoot.get().findCharacter<chrBehaviorLocal>(GameRoot.getInstance().account_name_local); chrBehaviorNet player = CharacterRoot.get().findCharacter <chrBehaviorNet>("Daizuya"); player.controll.cmdQueryTalk("멀리 있는 사람과 Talk한다", true); }); window.createButton("이사 시작") .setOnPress(() => { chrBehaviorLocal player = CharacterRoot.get().findCharacter <chrBehaviorLocal>(GameRoot.getInstance().account_name_local); //chrBehaviorNet player = CharacterRoot.get().findCharacter<chrBehaviorNet>(GameRoot.getInstance().account_name_net); player.controll.cmdQueryHouseMoveStart("House1"); }); window.createButton("이사 끝") .setOnPress(() => { chrBehaviorLocal player = CharacterRoot.get().findCharacter <chrBehaviorLocal>(GameRoot.getInstance().account_name_local); //chrBehaviorNet player = CharacterRoot.get().findCharacter<chrBehaviorNet>(GameRoot.getInstance().account_name_net); player.controll.cmdQueryHouseMoveEnd(); }); }
public static GameRoot get() { return(GameRoot.getInstance()); }
// ================================================================ // // STEP.MOVE ?ㅽ뻾. // ?대룞. protected void exec_step_move() { GameInput gi = GameInput.getInstance(); // ---------------------------------------------------------------- // //?대룞 紐⑺몴 ?꾩튂瑜?媛깆떊?쒕떎. if (gi.pointing.current) { switch (gi.pointing.pointee) { case GameInput.POINTEE.CHARACTOR: case GameInput.POINTEE.NONE: { } break; default: { if (GameRoot.getInstance().controlable[this.control.local_index]) { this.move_target = gi.pointing.position_3d; } } break; } // 洹쇱젒 怨듦꺽. this.melee_attack.setHasInput(true); } else { this.move_target = this.control.getPosition(); } if (gi.shot.current) { if (gi.shot.pointee != GameInput.POINTEE.NONE) { this.heading_target = gi.shot.position_3d; } } else if (gi.pointing.current) { if (gi.pointing.pointee != GameInput.POINTEE.NONE) { this.heading_target = gi.pointing.position_3d; } } // ---------------------------------------------------------------- // // ?대룞(?꾩튂 醫뚰몴 蹂닿컙). Vector3 position = this.control.getPosition(); Vector3 dist = this.move_target - position; dist.y = 0.0f; float speed = 5.0f; float speed_per_frame = speed * Time.deltaTime; if (dist.magnitude < speed_per_frame) { // 硫덉텣?? this.control.cmdSetMotion("m002_idle", 0); dist = Vector3.zero; } else { // 嫄룸뒗?? this.control.cmdSetMotion("m001_walk", 0); dist *= (speed_per_frame) / dist.magnitude; } position += dist; position.y = this.control.getPosition().y; this.control.cmdSetPosition(position); // 諛⑺뼢 蹂닿컙. float turn_rate = 0.1f; if (!gi.pointing.current && gi.shot.trigger_on) { turn_rate = 1.0f; } this.control.cmdSmoothHeadingTo(this.heading_target, turn_rate); }
protected void create_debug_window() { var window = dbwin.root().createWindow("query"); window.createButton("select.done") .setOnPress(() => { for (int i = 0; i < NetConfig.PLAYER_MAX; i++) { var query = new QuerySelectDone(AccountManager.get().getAccountData(i).account_id); QueryManager.get().registerQuery(query); } }); window.createButton("select.finish") .setOnPress(() => { var query = new QuerySelectFinish("Daizuya"); QueryManager.get().registerQuery(query); }); window.createButton("summon dog") .setOnPress(() => { QuerySummonBeast query_summon = new QuerySummonBeast("Daizuya", "Dog"); QueryManager.get().registerQuery(query_summon); }); window.createButton("summon neko") .setOnPress(() => { QuerySummonBeast query_summon = new QuerySummonBeast("Daizuya", "Neko"); QueryManager.get().registerQuery(query_summon); }); window.createButton("cake count") .setOnPress(() => { for (int i = 0; i < PartyControl.get().getFriendCount(); i++) { chrBehaviorPlayer friend = PartyControl.get().getFriend(i); QueryCakeCount query_cake = new QueryCakeCount(friend.getAcountID(), (i + 1) * 10); QueryManager.get().registerQuery(query_cake); } }); #if false window.createButton("버린다") .setOnPress(() => { chrBehaviorLocal player = CharacterRoot.get().findCharacter <chrBehaviorLocal>(GameRoot.getInstance().account_name_local); player.controll.cmdItemQueryDrop(); }); window.createButton("말풍선") .setOnPress(() => { //chrBehaviorLocal player = CharacterRoot.get().findCharacter<chrBehaviorLocal>(GameRoot.getInstance().account_name_local); chrBehaviorNet player = CharacterRoot.get().findCharacter <chrBehaviorNet>("Daizuya"); player.controll.cmdQueryTalk("멀리 있는 사람과 Talk한다", true); }); #endif }