コード例 #1
0
ファイル: Network.cs プロジェクト: bluebackblue/jsontest
        /** 更新。
         */
        public void Main()
        {
            switch (this.mode)
            {
            case Mode.Connect_Auto:
            {
                //自動接続。

                                        #if (USE_DEF_FEE_PUN)
                if (this.connect_auto.Main() == false)
                {
                    this.connect_auto = null;
                    this.mode         = Mode.Reset;
                }
                                        #endif
            } break;

            case Mode.Reset:
            {
                //リセット。

                this.my_player = null;
                this.player_list.Clear();
                this.mode = Mode.None;
            } break;
            }
        }
コード例 #2
0
ファイル: Network.cs プロジェクト: bluebackblue/jsontest
        /** [シングルトン]constructor
         */
        private Network()
        {
            //mode
            this.mode = Mode.None;

            //connect_auto
                        #if (USE_DEF_FEE_PUN)
            this.connect_auto = null;
                        #endif

            //ルート。
            this.root_gameobject      = new UnityEngine.GameObject();
            this.root_gameobject.name = "Network";
            UnityEngine.GameObject.DontDestroyOnLoad(this.root_gameobject);
            this.root_transform = this.root_gameobject.GetComponent <UnityEngine.Transform>();

            //disconnect_request
            this.disconnect_request = false;

            //player_list
            this.player_list = new System.Collections.Generic.List <Player_MonoBehaviour>();

            //my_player
            this.my_player = null;

            //recv_callback
            this.recv_callback = null;
        }
コード例 #3
0
ファイル: Network.cs プロジェクト: bluebackblue/jsontest
        /** 開始。
         */
        public void Start_AutoJoinRandomRoom()
        {
            if (this.mode == Mode.None)
            {
                this.mode = Mode.Connect_Auto;
                this.disconnect_request = false;

                                #if (USE_DEF_FEE_PUN)
                this.connect_auto = new Connect_Auto();
                                #endif
            }
        }