本文整理汇总了C#中ISFSObject类的典型用法代码示例。如果您正苦于以下问题:C# ISFSObject类的具体用法?C# ISFSObject怎么用?C# ISFSObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ISFSObject类属于命名空间,在下文中一共展示了ISFSObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ServerRequest
public ServerRequest(Type type, string commandId, ISFSObject requestData, GameObject handler, string callback) {
this.type = type;
this.commandId = commandId;
this.requestData = requestData;
this.handler = handler;
this.callback = callback;
}
示例2: GameStateChange
/// <summary>
/// Изменилось состояние игры
/// </summary>
/// <param name="data"></param>
void GameStateChange(ISFSObject data)
{
GameStates gameState = (GameStates)Enum.Parse(typeof(GameStates), data.GetUtfString("gameState"));
int time = data.GetInt("time");
if (OnGameStateUpdate != null)
OnGameStateUpdate(gameState, time);
}
示例3: FromSFSObject
public static NetworkTransform FromSFSObject(ISFSObject data)
{
NetworkTransform trans = new NetworkTransform();
ISFSObject transformData = data.GetSFSObject("transform");
float x = Convert.ToSingle(transformData.GetDouble("x"));
float y = Convert.ToSingle(transformData.GetDouble("y"));
float z = Convert.ToSingle(transformData.GetDouble("z"));
float rx = Convert.ToSingle(transformData.GetDouble("rx"));
float ry = Convert.ToSingle(transformData.GetDouble("ry"));
float rz = Convert.ToSingle(transformData.GetDouble("rz"));
trans.position = new Vector3(x, y, z);
trans.angleRotation = new Vector3(rx, ry, rz);
if (transformData.ContainsKey("t")) {
trans.TimeStamp = Convert.ToDouble(transformData.GetLong("t"));
}
else {
trans.TimeStamp = 0;
}
return trans;
}
示例4: OnExtensionResponse
/// <summary>
/// Пришел ответ от расширения сервера
/// </summary>
/// <param name="cmd"></param>
/// <param name="data"></param>
void OnExtensionResponse(string cmd, ISFSObject data)
{
Responses response = (Responses) Enum.Parse(typeof(Responses), cmd);
switch (response)
{
case Responses.GameStateChange:
GameStateChange(data);
break;
case Responses.CurrentTime:
CurrentTimeUpdate(data);
break;
case Responses.PlayersInfo:
if (OnPlayersInfo != null)
OnPlayersInfo(data);
break;
case Responses.Smile:
Smile(data);
break;
case Responses.CirclesInfo:
if (OnCirclesInfo != null)
OnCirclesInfo(data);
break;
case Responses.CircleAndPlayer:
if (OnCircleAndPlayer != null)
OnCircleAndPlayer(data);
break;
}
}
示例5: fromSFSObject
public void fromSFSObject(ISFSObject estimacion)
{
user = estimacion.GetUtfString("user");
valorEstimacion = estimacion.GetFloat("valorEstimacion");
descripcion = estimacion.GetUtfString("descripcion");
id_UserStory = estimacion.GetLong("id_Story");
}
示例6: HandleSync
public override void HandleSync(ISFSObject obj)
{
if(obj.ContainsKey("gate_state")){
int newState = obj.GetInt("gate_state");
open = (newState == 0) ? true : false;
}
}
示例7: UpdatePlayerInfo
public void UpdatePlayerInfo(ISFSObject data, Color myColor)
{
String colorName = "";
long time = data.GetLong("time");
int s,m,h;
string formattedTime;
if(myColor == Color.red)
colorName = "red";
if(myColor == Color.green)
colorName = "green";
if(myColor == Color.cyan)
colorName = "cyan";
if(myColor == Color.magenta)
colorName = "magenta";
if(myColor == Color.yellow)
colorName = "yellow";
int newtime = (int) time/1000;
s = (int) newtime%60;
m = (int) (newtime/60)%60;
h = (int) (newtime/3600)%24;
formattedTime = string.Format("{0:00}:{1:00}:{2:00}",h,m,s);
GameObject stats = GameObject.Find("StatLabels");
stats.transform.FindChild("Name").GetComponent<UILabel>().text = data.GetUtfString("name");
stats.transform.FindChild("Color").GetComponent<UILabel>().text = colorName;
stats.transform.FindChild("Color").GetComponent<UILabel>().color = myColor;
stats.transform.FindChild("Money").GetComponent<UILabel>().text = data.GetInt("money").ToString();
stats.transform.FindChild("Timer").GetComponent<UILabel>().text = formattedTime;
}
示例8: listAllUsers
public void listAllUsers(ISFSObject dataObject)
{
ISFSArray datos = dataObject.GetSFSArray("usuarios");
foreach (SFSObject proyectoObject in datos){
allUsers.Add(proyectoObject.GetUtfString("nick"));
}
allUsersFullStrings = allUsers.ToArray();
}
示例9: GetSFSTransform
public static Vector3 GetSFSTransform(ISFSObject data)
{
float x = data.GetFloat("x");
float y = data.GetFloat("y");
float z = data.GetFloat("z");
return new Vector3(x,y,z);
}
示例10: GetSFSRotation
public static Vector3 GetSFSRotation(ISFSObject data)
{
float rx = data.GetFloat("rx");
float ry = data.GetFloat("ry");
float rz = data.GetFloat("rz");
return new Vector3(rx, ry, rz);
}
示例11: HandleResponse
public void HandleResponse(ISFSObject anObjectIn, GameWorldManager ourGWM)
{
if(anObjectIn.GetBool("Gathered"))
{
ourGWM.destroyObject(ourGWM.getResourceDictionary()[anObjectIn.GetInt("ID")]);
ourGWM.getResourceDictionary().Remove(anObjectIn.GetInt("ID"));
}
}
示例12: HandleNetObjInit
public void HandleNetObjInit(ISFSObject data)
{
Debug.Log ("Handling obj init");
int id = data.GetInt("id");
NetSyncObj recipient = PlayerSpawner.Instance.GetRecipient(id);
if(recipient != null){
recipient.HandleInit(data);
}
}
示例13: HandleNetObjSync
public void HandleNetObjSync(ISFSObject data)
{
// Debug.Log ("Handling obj sync");
int id = data.GetInt("id");
NetSyncObj recipient = PlayerSpawner.Instance.GetRecipient(id);
if(recipient != null){
recipient.HandleSync(data);
}
// Debug.Log ("Handle obj sync, id: " + id);
}
示例14: eseguiAnimazioniRemoteT
//esegue animazioni remote Tastiera
public void eseguiAnimazioniRemoteT(ISFSObject sfsObjIn)
{
anim.SetFloat("Forward",sfsObjIn.GetFloat("f"));
anim.SetFloat("Turn", sfsObjIn.GetFloat("t"));
anim.SetBool("OnGround", sfsObjIn.GetBool("o"));
anim.SetFloat("Jump", sfsObjIn.GetFloat("j"));
anim.SetFloat("JumpLeg", sfsObjIn.GetFloat("jL"));
anim.SetBool("Attacco1", sfsObjIn.GetBool("a1"));
anim.SetBool("Attacco2", sfsObjIn.GetBool("a2"));
}
示例15: listAllProject
public void listAllProject(ISFSObject dataObject)
{
ISFSArray datos = dataObject.GetSFSArray("proyectos");
foreach (SFSObject proyectoObject in datos){
projects.Add(proyectoObject.GetUtfString("sala"));
projectsFull.Add(proyectoObject.GetUtfString("nombre"));
}
projectNameStrings = projects.ToArray();
projectFullStrings = projectsFull.ToArray();
}