当前位置: 首页>>代码示例>>C#>>正文


C# RoomData.getRoomOwner方法代码示例

本文整理汇总了C#中RoomData.getRoomOwner方法的典型用法代码示例。如果您正苦于以下问题:C# RoomData.getRoomOwner方法的具体用法?C# RoomData.getRoomOwner怎么用?C# RoomData.getRoomOwner使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RoomData的用法示例。


在下文中一共展示了RoomData.getRoomOwner方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnUserJoinRoom

 //only host recieve it
 public void OnUserJoinRoom(RoomData eventObj, string userName)
 {
     Debug.Log("OnUserJoinRoom" + " " + eventObj.getRoomOwner() + " User connected" + userName);
     opponentName = userName;
     SC_AppWarpKit.StartGame();
 }
开发者ID:ohadsas,项目名称:Unity_Ice_Flakes_Project,代码行数:7,代码来源:SC_Logic.cs

示例2: OnUserJoinRoom

    //only host recieve it
    public void OnUserJoinRoom(RoomData eventObj, string userName)
    {
        Debug.Log("OnUserJoinRoom" + " " + eventObj.getRoomOwner() + " User connected" + userName);

        //checking if room was created by other user - if so, it will be set as the opponent.
        if (eventObj.getRoomOwner() != userName)
        {
            opponentName = eventObj.getRoomOwner();
            isMyTurn = false;
            myPlayerBoard_script.turn_msg.text = "Opponent turn - Places " + SgameInfo.max_number_of_ships + " battleships on their game board";
        }

        //If game room was created by user - then he should initiate game start
        if (!created_or_joined)
        {
            Debug.Log("I created room - i start game - my turn");
            isMyTurn = true;
            myPlayerBoard_script.turn_msg.text = "Your turn - Place " + SgameInfo.max_number_of_ships + " battleships on your game board\n \t\tFirst of 4 squars \n\t\tSecond of 3 squars and so on";
            SC_AppWarpKit.StartGame();
        }
    }
开发者ID:DFaiz,项目名称:BattleShipGame,代码行数:22,代码来源:SC_Logic.cs

示例3: OnUserJoinRoom

    public void OnUserJoinRoom(RoomData eventObj, string _UserName)
    {
        if(isUserConnected)
        {
            Debug.Log ("OnUserJoinRoom" + " " + eventObj.getRoomOwner () + " User connected" + userName);
            if (_UserName != eventObj.getRoomOwner () && userName == eventObj.getRoomOwner ())
            {
                opponentName = _UserName;
                SC_AppWarpKit.StartGame();
                Debug.Log("Start Game");
            }

            if(_UserName != eventObj.getRoomOwner ()){
                opponentName = eventObj.getRoomOwner ();
            }
        }
    }
开发者ID:ohadsas,项目名称:Unity_Ice_Flakes_Project,代码行数:17,代码来源:Multi_Player.cs

示例4: OnUserJoinRoom

    public void OnUserJoinRoom(RoomData eventObj, string _UserName)
    {
        if (isUserConnected)
        {
            Debug.Log("OnUserJoinRoom" + " " + eventObj.getRoomOwner() + " User connected" + userName);
            if (_UserName != eventObj.getRoomOwner() && userName == eventObj.getRoomOwner())
            {
                opponentName = _UserName;
                unityUIObjects["LoadingText"].GetComponent<Text>().text = "Starting Game...";
                Debug.Log("Start Game");
                SC_AppWarpKit.StartGame();
                Debug.Log("opponentName: " + opponentName);

            }

            if (_UserName != eventObj.getRoomOwner())
                opponentName = eventObj.getRoomOwner();
        }
    }
开发者ID:moshe31sh,项目名称:TankWarZone---Unity_Project,代码行数:19,代码来源:CS_MultiPlayerAppWrap.cs


注:本文中的RoomData.getRoomOwner方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。