目录为:Assets/Scripts/GameEntity/目录下
InviteOtherPlayer.cs
邀请好友类
using UnityEngine;
using System.Collections;
using System;
using System.Collections.Generic;
//邀请好友
public class InviteOtherPlayer
{
//static
private static InviteOtherPlayer instance = null;
public static InviteOtherPlayer Instance
{
get
{
if (instance == null)
{
instance = new InviteOtherPlayer ();
}
return instance;
}
}
public UInt64 RoomID
{
private set;
get;
}
public string PassWord
{
private set;
get;
}
public string NiceName
{
private set;
get;
}
public int Length
{
private set;
get;
}
public void SetInvitation(UInt64 roomID, string passWord, int length, string niceName)
{
Length = length;
RoomID = roomID;
PassWord = passWord;
NiceName = niceName;
}
}