将所有用户信息存储在当前在室内的自定义类中,我使用的是smartfoxServer

时间:2016-08-26 10:03:04

标签: android unity3d unityscript unity5 smartfoxserver

我使用自定义类来存储用户特定的信息类如下:

Parallel.ForEach(aList, entity =>
{
    //Can be asserted using  Assert(5,parameter.value) in the test
    parameter.value = 5;

    //Cannot be asserted, assertion fails Mock.Assert(parameter) in the test
    //is arranged using MustBeCalled
    parameter.call();   
})

我在运行时在列表中添加用户:

using UnityEngine;
using System.Collections;

public class RoomPlayerInfo  {

private int minutes;
private int seconds;
private int miliSecond;
private string userName;

public int Minutes{
    get{ return minutes; }
    set{ minutes = value;}
}

public int Seconds{
    get{ return seconds; }
    set{ seconds = value; }
}

public string UserName{
    get{ return userName; }
    set{ userName = value; }
}

public int MiliSecond{
    get{ return miliSecond;}
    set{ miliSecond = value;}
}
}

当我要在运行时删除一个播放器时,它只删除每个设备上的currentPlayer,意味着每个设备删除这个设备的自己的播放器,但我将删除最长时间的播放器游戏.. 我怎么能完成我的工作???

 private List<RoomPlayerInfo> listRoomPlayerInfo = new List<RoomPlayerInfo> ();

    RoomPlayerInfo rPI = new RoomPlayerInfo ();
    rPI.Minutes = diff.Minutes;
    rPI.Seconds = diff.Seconds;
    rPI.MiliSecond = diff.Milliseconds;
    rPI.UserName = sfs.MySelf.Name; 
    listRoomPlayerInfo.Add (rPI);

0 个答案:

没有答案