当前位置: 首页>>代码示例>>C#>>正文


C# ISFSObject.GetIntArray方法代码示例

本文整理汇总了C#中ISFSObject.GetIntArray方法的典型用法代码示例。如果您正苦于以下问题:C# ISFSObject.GetIntArray方法的具体用法?C# ISFSObject.GetIntArray怎么用?C# ISFSObject.GetIntArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ISFSObject的用法示例。


在下文中一共展示了ISFSObject.GetIntArray方法的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();
            }
        }
开发者ID:Gabe-Biele,项目名称:Project-Circleage,代码行数:40,代码来源:InventoryUpdateHandler.cs

示例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);
            }
        }
开发者ID:Gabe-Biele,项目名称:Project-Circleage,代码行数:22,代码来源:SpawnNodeHandler.cs


注:本文中的ISFSObject.GetIntArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。