コード例 #1
0
ファイル: ServerHostAndJoin.cs プロジェクト: pau1m/UnityUI
    void TakeAction(HostOrJoin choice)
    {
        hostOrJoin = choice;

        //Start or join, not both.
        if (hostOrJoin == HostOrJoin.Host)
        {
            StartServer();
        }

        if (hostOrJoin == HostOrJoin.Join)
        {
            //If we're joining, create a MasterServiceInterface to provide us with the interface for selecting a server
            msInterface = this.gameObject.AddComponent <MasterServerInterface>();
            //Provide a call back for when a server is selected.
            msInterface.OnServerSelected += HandleOnServerSelected;
        }
    }
コード例 #2
0
    void TakeAction(HostOrJoin choice)
    {
        hostOrJoin = choice;

        //Start or join, not both.
        if(hostOrJoin == HostOrJoin.Host) {
            StartServer();
        }

        if(hostOrJoin == HostOrJoin.Join) {
            //If we're joining, create a MasterServiceInterface to provide us with the interface for selecting a server
            msInterface = this.gameObject.AddComponent<MasterServerInterface>();
            //Provide a call back for when a server is selected.
            msInterface.OnServerSelected += HandleOnServerSelected;

        }
    }