本文整理汇总了C#中ISFSObject.GetSFSArray方法的典型用法代码示例。如果您正苦于以下问题:C# ISFSObject.GetSFSArray方法的具体用法?C# ISFSObject.GetSFSArray怎么用?C# ISFSObject.GetSFSArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISFSObject
的用法示例。
在下文中一共展示了ISFSObject.GetSFSArray方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: listAllUsers
public void listAllUsers(ISFSObject dataObject)
{
ISFSArray datos = dataObject.GetSFSArray("usuarios");
foreach (SFSObject proyectoObject in datos){
allUsers.Add(proyectoObject.GetUtfString("nick"));
}
allUsersFullStrings = allUsers.ToArray();
}
示例2: 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();
}
示例3: listUserXProject
public void listUserXProject(ISFSObject dataObject)
{
ISFSArray datos = dataObject.GetSFSArray("usuarios");
users.Clear();
usersFull.Clear();
foreach (SFSObject proyectoObject in datos){
users.Add(proyectoObject.GetUtfString("nick"));
usersFull.Add(proyectoObject.GetUtfString("rol"));
}
usersNameStrings =users.ToArray();
usersFullStrings = usersFull.ToArray();
}
示例4: OnResponseGetAssetsInfo
private void OnResponseGetAssetsInfo(ISFSObject a_infoData)
{
//assetsinfo
if(a_infoData.GetBool(Keys.SUCCESS))
{
ISFSArray l_tempSfsArray = a_infoData.GetSFSArray(Keys.ASSETS_INFO);
List<AssetsInfo> l_allCurrentInfoList = new List<AssetsInfo>();
for (int indexAssetInfo = 0; indexAssetInfo < l_tempSfsArray.Count; indexAssetInfo++)
{
AssetsInfo l_temp = new AssetsInfo();
l_temp.AssetID = (int)(l_tempSfsArray.GetSFSObject(indexAssetInfo)).GetLong("assetsid");
l_temp.ImageTargetID = (l_tempSfsArray.GetSFSObject(indexAssetInfo)).GetUtfString("imagetargetid");
l_temp.URL = (l_tempSfsArray.GetSFSObject(indexAssetInfo)).GetUtfString("assetsurl");
l_temp.AssetName = (l_tempSfsArray.GetSFSObject(indexAssetInfo)).GetUtfString("assetname");
l_allCurrentInfoList.Add(l_temp);
}
GameBaseEvent l_assetsInfoEvent = new GameBaseEvent(eGameEvents.getAssetsInfo.ToString());
GameEventArgs l_eventArg = new GameEventArgs();
l_eventArg.EventData = (object)l_allCurrentInfoList;
l_assetsInfoEvent.Args = l_eventArg;
dispatchEvent(this, l_assetsInfoEvent);
}
else
{
Debug.Log(a_infoData.GetUtfString(Keys.ERROR));
}
}
示例5: syncBlocks
private void syncBlocks(ISFSObject msg)
{
var networkBlocks = msg.GetSFSArray("blocks");
for(int i = 0; i < networkBlocks.Size (); i++) {
Debug.Log(_blocks[i].name);
float[] coordinates = networkBlocks.GetSFSObject(i).GetFloatArray("position");
float[] velocityComponents = networkBlocks.GetSFSObject(i).GetFloatArray("velocity");
_blocks[i].transform.position = new Vector3(coordinates[0], _blocks[i].transform.position.y, coordinates[1]);
_blocks[i].rigidbody.velocity = new Vector3(velocityComponents[0], 0, velocityComponents[1]);
}
}
示例6: SetupInventory
private void SetupInventory(ISFSObject data)
{
gameObject.GetComponent<InventoryManager>().UpdatePlayerInventory(data.GetSFSArray("inventory"));
}
示例7: tracePath
private void tracePath(ISFSObject data)
{
if(lost)
{
mg.getNotificationManager().DisplayWindow("ACTIONSDISABLED");
return;
}
ISFSArray path = data.GetSFSArray("hackingPath");
int i = 0;
while(i < path.Size()-1)
{
String startC = (String) path.GetElementAt(i);
String targetC =(String) path.GetElementAt(i+1);
String[] coord_1 = startC.Split(':');
String[] coord_2 = targetC.Split(':');
Vector3 p0 = new Vector3(float.Parse(coord_1[0]), float.Parse(coord_1[1]), 1F);
Vector3 p1 = new Vector3(float.Parse(coord_2[0]), float.Parse(coord_2[1]), 1F);
float inclinazioneRay = Mathf.Atan((p1.y-p0.y)/(p1.x-p0.x))*Mathf.Rad2Deg;
rotation.eulerAngles = new Vector3(0,0,inclinazioneRay);
float distance = Vector3.Distance(p1,p0);
rayLenght = distance;
Vector3 d0 = new Vector3(-5.8f, 2.2f, 1f);
Vector3 d1 = new Vector3(5.3f, 2.5f, 1f);
if(!((p0 == d0 && p1 == d1)|| (p1 == d0 && p0 == d1)))
{
ray = Instantiate(rayPrefab) as GameObject;
ray.transform.parent = GameObject.Find("UI").transform;
ray.transform.localPosition = new Vector3((p1.x+p0.x)/2,(p1.y+p0.y)/2, 5F);
ray.transform.localScale = new Vector2(rayLenght, 0.7F);
ray.transform.rotation=rotation;
}
else
{
ray = Instantiate(rayPrefab) as GameObject;
ray.transform.parent = GameObject.Find("UI").transform;
ray.transform.localPosition = new Vector3(6.03F, 2.5F, 5F);
ray.transform.localScale = new Vector2(1.18F, 0.7F);
ray.transform.rotation=rotation;
ray = Instantiate(rayPrefab) as GameObject;
ray.transform.parent = GameObject.Find("UI").transform;
ray.transform.localPosition = new Vector3(-6.25F, 2.18F, 5F);
ray.transform.localScale = new Vector2(0.8F, 0.7F);
ray.transform.rotation=rotation;
}
i++;
}
}
示例8: DisplayEndingStats
private void DisplayEndingStats(ISFSObject data)
{
GameObject.Find("BlackPanel").GetComponent<SpriteRenderer>().enabled = true;
GameObject.Find("EndGameCamera").GetComponent<Camera>().enabled = true;
gameEnded = true;
Debug.Log("recieved endgame");
string text = "";
for(int i = 0; i < data.Size(); i++){
ISFSArray p = data.GetSFSArray("player"+i);
p.GetBool(3);//won
string victory = p.GetBool(3)?"VICTORY":"DEFEAT";
text += p.GetUtfString(0)+": "+victory+"\nConquered Gateway: "+p.GetInt(1)+"\nEarned Money: "+p.GetInt(2)+"\n\n";
}
GameObject.Find("endStats").GetComponent<UILabel>().text = text;
}
示例9: InstallItem
private void InstallItem(ISFSObject data)
{
if(data.GetBool("success"))
mg.getNotificationManager().DisplayWindow("INSTALLED");
gameObject.GetComponent<InventoryManager>().UpdatePlayerInventory(data.GetSFSArray("inventory"));
ISFSObject data2 = new SFSObject();
Gateway gtw = gameObject.GetComponent<TextManager>().gtw;
data2.PutUtfString("selctedGateway", gtw.getState());
smartFox.Send(new ExtensionRequest("refreshGtw", data2, smartFox.LastJoinedRoom));
}
示例10: HandleTransform
// Updating transform of the remote player from server
private void HandleTransform(ISFSObject dt)
{
//Debug.Log("transform!!");
int userId = dt.GetInt("id");
//
if (userId != smartFox.MySelf.Id) {
// Update transform of the remote user object
NetworkTransformReceiver recipient = PlayerManager.Instance.GetRecipient(userId);
if (recipient==null) Debug.Log("me mameeeeee");
else Debug.Log("me llegan datos de "+userId);
ISFSArray data = dt.GetSFSArray("transform");
//NetworkTransform ntransform = NetworkTransform.FromSFSObject(data);
if (recipient!=null) {
//recipient.ReceiveTransform(ntransform);
recipient.addObject(data);
//System.Threading.Thread.Sleep((int)Time.deltaTime);
}
/*ISFSArray buff = dt.GetSFSArray("transformBuffer");
if (buff == null) Debug.Log("ES NULLLLLLLL - BUFFER");
Debug.Log("SIZE BUFFER: "+buff.Size());
int num = 0;
foreach (SFSObject obj in buff){
Debug.Log("Paquete NRO: " + num);
num++;
NetworkTransform ntransform = NetworkTransform.FromSFSObject(obj);
if (recipient!=null) {
recipient.addObject(ntransform);
}
} */
}
}
示例11: Setup
public void Setup(ISFSObject obj)
{
particleSystem.renderer.sortingLayerName = "2 Middle Lower UI";
this.gwName = obj.GetUtfString("NAME");
this.state = obj.GetUtfString("STATE");
this.owner = obj.GetUtfString("OWNER");
this.atk = obj.GetInt("ATK");
this.def = obj.GetInt("DEF");
this.type = obj.GetUtfString("TYPE");
ISFSArray sws = obj.GetSFSArray("SW");
this.region = obj.GetUtfString("REGION");
this.sw = new string[3];
this.sw[0] = (string) sws.GetElementAt(0);
this.sw[1] = (string) sws.GetElementAt(1);
this.sw[2] = (string) sws.GetElementAt(2);
mg = GameObject.Find("Manager").GetComponent<Manager>();
gameObject.transform.position = new Vector3((float)obj.GetDouble("X")*mg.getScale().x,(float)obj.GetDouble("Y")*mg.getScale().y,1F);
gameObject.transform.localScale = new Vector3(0.25f,0.25f,0.25f);
}
示例12: Update
public void Update(ISFSObject obj)
{
this.owner = obj.GetUtfString("OWNER");
this.atk = obj.GetInt("ATK");
this.def = obj.GetInt("DEF");
ISFSArray sws = obj.GetSFSArray("SW");
this.sw = new string[3];
this.sw[0] = (string) sws.GetElementAt(0);
this.sw[1] = (string) sws.GetElementAt(1);
this.sw[2] = (string) sws.GetElementAt(2);
}
示例13: OnPlayersInfo
/// <summary>
/// Информация о игроках
/// </summary>
/// <param name="data"></param>
void OnPlayersInfo(ISFSObject data)
{
SetupServerPlayers(data.GetSFSArray("players"));
AddServerPlayerToClientPlayer();
}
示例14: OnCirclesInfo
/// <summary>
/// Пришла информация о состоянии кружочков
/// </summary>
/// <param name="data"></param>
void OnCirclesInfo(ISFSObject data)
{
SetupCircles(data.GetSFSArray("circles"));
}