SmartFoxServer sfs 实现私聊
新建LobbyGUI.cs
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Security.Permissions;
using System.Text;
using SmartFoxClientAPI;
using SmartFoxClientAPI.Data;
public class LobbyGUI : MonoBehaviour
{
private SmartFoxClient smartFox;
private string zone = "simpleChat";
private string username = "";
private string password = "";
private string loginErrorMessage = "";
private static bool isLoggedIn;
private static bool roomListReceived = false;
private static bool F=false;
private static bool ESC=false;
private static bool HY=false;
private static bool windowsKG=false;
private string newMessage = "";
private ArrayList messages = new ArrayList();
// Locker to use for messages collection to ensure its cross-thread safety
private System.Object messagesLocker = new System.Object();
private Vector2 chatScrollPosition, userScrollPosition;
private int roomSelection = 0;
private string [] roomStrings;
private int userSelection=0;
private string [] userStrings;
public int QJ_userid;
public int QJ_userroomid;
public string QJ_username;
public string QJ_userPrivatemsg;
public GUISkin gSkin;
void Awake ()
{
DontDestroyOnLoad (this);
}
void Start()
{
if (SmartFox.initialized)