本文整理汇总了C#中ISFSObject.GetUtfStringArray方法的典型用法代码示例。如果您正苦于以下问题:C# ISFSObject.GetUtfStringArray方法的具体用法?C# ISFSObject.GetUtfStringArray怎么用?C# ISFSObject.GetUtfStringArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISFSObject
的用法示例。
在下文中一共展示了ISFSObject.GetUtfStringArray方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleResponse
public void HandleResponse(ISFSObject anObjectIn, GameWorldManager ourGWM)
{
Debug.Log("Inventory Update Recieved");
int[] iDArray = anObjectIn.GetIntArray("IDArray");
int[] itemArray = anObjectIn.GetIntArray("ItemIDArray");
int[] quantityArray = anObjectIn.GetIntArray("QuantityArray");
string[] nameArray = anObjectIn.GetUtfStringArray("NameArray");
string[] descriptionArray = anObjectIn.GetUtfStringArray("DescriptionArray");
string[] locationArray = anObjectIn.GetUtfStringArray("SubLocationArray");
bool reopenInventory = false;
if(GameObject.Find("InventoryPanel") != null)
{
GameObject.Find("SceneScriptsObject").GetComponent<GameUI>().openInventory();
reopenInventory = true;
}
if(itemArray.Length != quantityArray.Length)
{
Debug.Log("Item array and quantity array are not the same size.");
}
int iPos = 0;
foreach (int ID in iDArray)
{
//If the inventory already has this item in it, simply update its data.
if(ourGWM.getLPC().getInventory().ContainsKey(ID))
{
ourGWM.getLPC().getInventory()[ID].updateItemData(itemArray[iPos], quantityArray[iPos], nameArray[iPos], descriptionArray[iPos], locationArray[iPos]);
}
else if(!ourGWM.getLPC().getInventory().ContainsKey(ID))
{
ourGWM.getLPC().getInventory().Add(ID, new Item(ID, itemArray[iPos], quantityArray[iPos], nameArray[iPos], descriptionArray[iPos], locationArray[iPos]));
}
iPos++;
}
if(reopenInventory)
{
GameObject.Find("SceneScriptsObject").GetComponent<GameUI>().openInventory();
}
}
示例2: HandleResponse
public void HandleResponse(ISFSObject anObjectIn, GameWorldManager ourGWM)
{
string[] types = anObjectIn.GetUtfStringArray("Type");
int[] levels = anObjectIn.GetIntArray("Level");
string[] location = anObjectIn.GetUtfStringArray("Location");
for(int i = 0; i < levels.Length; i++)
{
GameObject aNode;
if(levels[i] == 0)
{
aNode = ourGWM.createObject("Prefabs/Settlements/WoodSign");
}
else
{
aNode = ourGWM.createObject("Prefabs/Settlements/" + types[i] + "/" + levels[i].ToString());
}
aNode.name = "Node_" + types[i] + "_" + levels[i];
aNode.transform.position = new Vector3(Convert.ToSingle(location[i].Split(',')[0]), Convert.ToSingle(location[i].Split(',')[1]), Convert.ToSingle(location[i].Split(',')[2]));
aNode.transform.rotation = new Quaternion(0, Convert.ToSingle(location[i].Split(',')[3]), 0, 0);
}
}