예제 #1
0
    // Start is called before the first frame update
    void Start()
    {
        //Self PlayerObject Init
        self = new PlayerMPO
        {
            Name = "myRobbot:" + Guid.NewGuid().ToString("N"),

            Transform = new TransformMPO()
            {
                Position = new Vector3(0, 0, 0),
                Rotation = new Quaternion(0, 0, 0, 0)
            },

            Character = new CharacterMPO()
            {
                CharacterModel = GameObject.FindGameObjectWithTag("CharacterModel").name,
                ColorMaterial  = defaultMaterial.name
            }
        };

        //自分の入力したチャットイベント購読登録
        //送信イベント受信したらチャット送信
        //※UniRx標準のイベントチェックとかあるっぽいのでそっちでも良いかも
        chatManager.OnReceivedChatSelfMessage.Subscribe(
            message => {
            sendMessage(message);
        }
            )
        .AddTo(this);

        host.text = "";
        port.text = "";

        //マッチボタン処理のイベント登録 UniRx
        MatchButtonAction();
    }