Exemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        if (!MonobitNetwork.isConnect)
        {
            MonobitNetwork.autoJoinLobby = true;
            MonobitNetwork.ConnectServer("testServer");
        }
        if (!MonobitNetwork.inRoom)
        {
            //サーバ上の部屋を全取得
            RoomData[] _roomDatas = MonobitNetwork.GetRoomData();
            //部屋が1つでもあるなら
            if (_roomDatas.Length >= 1)
            {
                //1つ目の部屋に入る
                MonobitNetwork.JoinRoom(_roomDatas[0].name);
            }
            else
            {
                Debug.Log("部屋作る");
                //「ChatTest」という名前で部屋を作る
                MonobitNetwork.CreateRoom("ChatTest");
            }
        }


        if (MonobitNetwork.inRoom && Input.GetKeyDown(KeyCode.J))
        {
            Debug.Log("送るよ");
            _monobitView.RPC("Receive", MonobitTargets.All, this.gameObject.GetComponent <MeshRenderer>() as Object);
        }
    }
Exemplo n.º 2
0
 private void LoadStageRequest()
 {
     Debug.Log("全員に送信!");
     _monobitView.RPC("LoadStage",
                      MonobitTargets.All,
                      _gimmick.transform.position,
                      _gimmick.transform.rotation,
                      _gimmick.transform.localScale);
 }
Exemplo n.º 3
0
    public static void SEND(ChatUSER user, string text)
    {
        string str0 = user.ToString();
        string str1 = text;

        //各PCのADD関数を引数をそのまま入れて呼ぶ
        _monobitview.RPC("RECV", MonobitTargets.All, str0, str1);
        Debug.Log("送信" + str0 + str1);
    }
Exemplo n.º 4
0
    public virtual void SendChat(string text)
    {
        if (String.IsNullOrEmpty(text))
        {
            return;
        }

        //不適切な表現を削除--------------------------------------------------------------

        text = text.Replace(" ", "").Replace(" ", "").Trim();
        if (ForbiddenWords.WordFilter(text) == "")
        {
            text += Environment.NewLine + "<color=red>不適切な表現を含むため送信できません</color>";
            return;
        }

        //---------------------------------------------------------------------------------


        //送信
        _view.RPC("ReceiveChat", MonobitTargets.All, text);
    }