本文整理汇总了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();
}
示例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();
}
}
示例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 ();
}
}
}
示例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();
}
}