public void connect() { if (!so.connecting && !name.GetComponent <Text> ().text.Equals("")) { so.name = name.GetComponent <Text> ().text; so.Connect(); } else if (so.connecting && !name.GetComponent <Text> ().text.Equals("")) { so.name = name.GetComponent <Text> ().text; } else if (so.connecting && name.GetComponent <Text> ().text.Equals("")) { so.Disconnection(); } }
public void connect(string s) { if (!so.connecting && !s.Equals("")) { so.name = s; so.Connect(); } else if (so.connecting && !s.Equals("")) { so.name = s; } else if (so.connecting && s.Equals("")) { so.Disconnection(); } }
// Update is called once per frame void Update() { Debug.Log(GameManager.Instance._GameState.Value); if (GameManager.Instance._GameState.Value == GameState.StartCount) { AnimatorStateInfo anim = startCount.GetCurrentAnimatorStateInfo(0); if (anim.fullPathHash == Animator.StringToHash("Base Layer.StartUI_ON") && anim.normalizedTime > 0.6f) { GameManager.Instance._GameState.Value = GameState.Playing; } return; } if (GameManager.Instance._GameState.Value == GameState.Playing) { Dictionary <string, string> d; if (hitQue.Count > 0) { d = hitQue.Dequeue(); var g = players[d["trg"]]; Vector3 start = new Vector3(float.Parse(d["startX"]), float.Parse(d["startY"]), float.Parse(d["startZ"])); Vector3 end = new Vector3(float.Parse(d["endX"]), float.Parse(d["endY"]), float.Parse(d["endZ"])); g.GetComponent <PlayerScript>().model.setImpactData(start, end, g); } if (elimQue.Count > 0) { d = elimQue.Dequeue(); exclusion(d ["trg"].ToString()); } Debug.Log(watching); if (watching && Input.GetKeyDown(KeyCode.Escape)) { MenuSetting(); } /* * if (!Exping && (MAX!=1) &&(players.Count == 1)) { * score += 300; * MenuSetting (); * }else if(MAX==1 && players.Count == 0) * { * MenuSetting(); * } */ } else { if (gm._GameState.Value == GameState.ConnectionComp && Input.GetKeyDown(KeyCode.Escape)) { so.Disconnection(); so.id = ""; so.name = ""; gm._GameState.Value = GameState.Menu; RoomScript.Instance.removeMenu01Player(); } else if (gm._GameState.Value == GameState.WaitingOtherPlayer && Input.GetKeyDown(KeyCode.Escape)) { Debug.Log("検索中止:[退室]" + myRoom.roomName); var data = new Dictionary <string, string>(); data["to"] = "LEAVE"; so.EmitMessage("Quick", data); myRoom = null; gm._GameState.Value = GameState.ConnectionComp; RoomScript.Instance.removeMenu02Players(); } } }