// ================================================================ // public void OnReceiveGoingOutPacket(PacketId id, byte[] data) { GoingOutPacket packet = new GoingOutPacket(data); GoingOutData go = packet.GetPacket(); Debug.Log("OnReceiveGoingOutPacket"); if (GlobalParam.get().account_name == go.characterId) { // 자신은 이미 행동이 끝났으므로 처리하지 않습니다. return; } if (GlobalParam.get().is_in_my_home) { // 자신의 정원에 있습니다.. if (go.goingOut) { // 친구가 찾아왔습니다. this.step.set_next(STEP.WELCOME); GlobalParam.get().is_remote_in_my_home = true; } else { // 친구가 돌아갑니다. this.step.set_next(STEP.BYEBYE); GlobalParam.get().is_remote_in_my_home = false; } } else { // 친구 정원에 있습니다. if (go.goingOut) { // 친구가 갑니다. this.step.set_next(STEP.BYEBYE); GlobalParam.get().is_remote_in_my_home = true; } else { // 친구가 돌아옵니다. this.step.set_next(STEP.WELCOME); GlobalParam.get().is_remote_in_my_home = false; } } }
public void NotifyFieldMoving() { GameObject go = GameObject.Find("Network"); if (go != null) { Network network = go.GetComponent <Network>(); if (network != null) { GoingOutData data = new GoingOutData(); data.characterId = GlobalParam.get().account_name; data.goingOut = GlobalParam.get().is_in_my_home; GoingOutPacket packet = new GoingOutPacket(data); network.SendReliable <GoingOutData>(packet); } } }
public void NotifyFieldMoving() { GameObject go = GameObject.Find("Network"); if (go != null) { Network network = go.GetComponent<Network>(); if (network != null) { GoingOutData data = new GoingOutData(); data.characterId = GlobalParam.get().account_name; data.goingOut = GlobalParam.get().is_in_my_home; GoingOutPacket packet = new GoingOutPacket(data); network.SendReliable<GoingOutData>(packet); } } }