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


C# ISFSObject.GetInt方法代码示例

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


在下文中一共展示了ISFSObject.GetInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

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

示例2: HandleResponse

        public void HandleResponse(ISFSObject anObjectIn, GameWorldManager ourGWM)
        {
            string aSettlementName = anObjectIn.GetUtfString("Name");
            int ID = anObjectIn.GetInt("ID");
            float[] location = anObjectIn.GetFloatArray("LocationArray");
            int level = anObjectIn.GetInt("CenterNodeLevel");

            GameObject aSettlement = ourGWM.createObject("Prefabs/Settlements/" + aSettlementName + "/" + level.ToString());
            aSettlement.name = "Settlement_" + aSettlementName + "_" + ID;
            aSettlement.transform.position = new Vector3(location[0], location[1], location[2]);
        }
开发者ID:Gabe-Biele,项目名称:Project-Circleage,代码行数:11,代码来源:SpawnSettlementHandler.cs

示例3: HandleSync

 public override void HandleSync(ISFSObject obj)
 {
     if(obj.ContainsKey("gate_state")){
         int newState = obj.GetInt("gate_state");
         open = (newState == 0) ? true : false;
     }
 }
开发者ID:claw2013hku,项目名称:UnityTestProject,代码行数:7,代码来源:NetSyncObjGate.cs

示例4: 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);
 }
开发者ID:PanCrucian,项目名称:IOL,代码行数:11,代码来源:ServerResponses.cs

示例5: 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);
     }
 }
开发者ID:claw2013hku,项目名称:UnityTestProject,代码行数:9,代码来源:SFSNetworkManager.cs

示例6: 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);
 }
开发者ID:claw2013hku,项目名称:UnityTestProject,代码行数:10,代码来源:SFSNetworkManager.cs

示例7: HandleResponse

        public void HandleResponse(ISFSObject anObjectIn, GameWorldManager ourGWM)
        {
            string aResourceName = anObjectIn.GetUtfString("Name");
            int ID = anObjectIn.GetInt("ID");
            float[] location = anObjectIn.GetFloatArray("Location");

            GameObject aResource = ourGWM.createObject("Prefabs/Resources/" + aResourceName);
            aResource.name = "Resource_" + aResourceName + "_" + ID;
            aResource.transform.position = new Vector3(location[0], location[1], location[2]);

            //Add Newly spawned resource to Dictionary
            ourGWM.getResourceDictionary().Add(ID, aResource);
        }
开发者ID:Gabe-Biele,项目名称:Project-Circleage,代码行数:13,代码来源:SpawnResourceHandler.cs

示例8: HandleResponse

        public void HandleResponse(ISFSObject anObjectIn, GameWorldManager ourGWM)
        {
            string aNPCName = anObjectIn.GetUtfString("Name");
            int ID = anObjectIn.GetInt("ID");
            float[] location = anObjectIn.GetFloatArray("Location");

            GameObject aNPC = ourGWM.createObject("Prefabs/NPC/" + aNPCName);
            aNPC.name = "NPC_" + aNPCName + "_" + ID;
            aNPC.AddComponent<RemotePlayerController>();
            aNPC.transform.position = new Vector3(location[0], location[1], location[2]);
            aNPC.GetComponentInChildren<TextMesh>().text = aNPCName;

            //Add Newly spawned player to Dictionary
            ourGWM.getNPCDictionary().Add(ID, aNPC);
        }
开发者ID:Gabe-Biele,项目名称:Project-Circleage,代码行数:15,代码来源:SpawnNPCHandler.cs

示例9: HandleSync

 public override void HandleSync(ISFSObject obj)
 {
     if(obj.ContainsKey("trigger_state")){
         int newState = obj.GetInt("trigger_state");
         switch(newState){
         case 0:
             state = TriggerState.LEFT;
             break;
         case 1:
             state = TriggerState.MIDDLE;
             break;
         case 2:
             state = TriggerState.RIGHT;
             break;
         }
     }
 }
开发者ID:claw2013hku,项目名称:UnityTestProject,代码行数:17,代码来源:NetSyncObjTrigger.cs

示例10: HandleResponse

        public void HandleResponse(ISFSObject anObjectIn, GameWorldManager ourGWM)
        {
            GameObject aContributionPanel = ourGWM.createObject("UI/ContributionPanel");
            aContributionPanel.name = "ContributionPanel";
            aContributionPanel.transform.SetParent(GameObject.Find("UICanvas").transform);
            aContributionPanel.transform.localPosition = new Vector3(0, 0, 0);
            aContributionPanel.transform.FindChild("ExitButton").GetComponent<Button>().onClick.AddListener(() => GameObject.Find("SceneScriptsObject").GetComponent<GameUI>().contributionExitButton_Clicked());
            aContributionPanel.transform.FindChild("ContributeButton").GetComponent<Button>().onClick.AddListener(() => GameObject.Find("SceneScriptsObject").GetComponent<GameUI>().contributionButton_Clicked());
            aContributionPanel.transform.FindChild("NameLabel").GetComponent<Text>().text = anObjectIn.GetUtfString("Name");
            aContributionPanel.transform.FindChild("LevelLabel").GetComponent<Text>().text = "(Level " + anObjectIn.GetInt("CenterNodeLevel").ToString() + ")";
            aContributionPanel.transform.FindChild("CurrentContributionLabel").GetComponent<Text>().text = anObjectIn.GetInt("Contribution").ToString();
            aContributionPanel.transform.FindChild("ContributionCapTotalLabel").GetComponent<Text>().text = anObjectIn.GetInt("ContributionCap").ToString();
            aContributionPanel.transform.FindChild("ContributionPB").GetComponent<Scrollbar>().size = (float)anObjectIn.GetInt("CurrentTNL") / (float)anObjectIn.GetInt("TotalTNL");
            aContributionPanel.transform.FindChild("ContributionPB").FindChild("ContributionText").GetComponent<Text>().text = anObjectIn.GetInt("CurrentTNL").ToString() + " / " + anObjectIn.GetInt("TotalTNL").ToString();
            aContributionPanel.transform.FindChild("CurrentFoodLabel").GetComponent<Text>().text = anObjectIn.GetInt("CurrentFood").ToString();

            //Switch Cursor Mode
            Camera.main.GetComponent<CameraController>().setCursorVisible(true);
        }
开发者ID:Gabe-Biele,项目名称:Project-Circleage,代码行数:19,代码来源:CenterNodeInformationHandler.cs

示例11: OnHandleMessage

    public override void OnHandleMessage(ISFSObject data)
    {
        maxCharacters = data.GetInt("maxCharacters");
        ISFSObject characters = data.GetSFSObject("characters");
        Character character;
        foreach (string key in characters.GetKeys())
        {
            character = new Character();
            Debug.Log("Adding character: " + key);
            if (character.FromSFSObject(characters.GetSFSObject(key)))
            {
                characterList.Add(character);
            }
        }

        Debug.Log("Max: " + maxCharacters);
        Debug.Log("Characters: " + characterList.Count);
    }
开发者ID:Antaresgames,项目名称:AegisBorn,代码行数:18,代码来源:CharacterListHandler.cs

示例12: HandleHealthChange

    // Health of the player changed - updating GUI and playing sounds if it's damage
    private void HandleHealthChange(ISFSObject dt)
    {
        int userId = dt.GetInt("id");
        int health = dt.GetInt("health");
        if (userId == smartFox.MySelf.Id) {
            if (health<GameHUD.Instance.Health) {
                SoundManager.Instance.PlayDamage(PlayerManager.Instance.GetPlayerObject().audio);
            }

            GameHUD.Instance.UpdateHealth(health);
        }
        else {
            PlayerManager.Instance.UpdateHealthForEnemy(userId, health);
        }
    }
开发者ID:justdude,项目名称:Network-Hunter,代码行数:16,代码来源:NetworkManager.cs

示例13: CurrentTimeUpdate

 /// <summary>
 /// Обновилось текущее время на сервере
 /// </summary>
 /// <param name="data"></param>
 void CurrentTimeUpdate(ISFSObject data)
 {
     if (OnCurrentTimeUpdate != null)
         OnCurrentTimeUpdate(data.GetInt("currentTime"));
 }
开发者ID:PanCrucian,项目名称:IOL,代码行数:9,代码来源:ServerResponses.cs

示例14: unlockBlock

 private void unlockBlock(ISFSObject msg)
 {
     _blocks[msg.GetInt("index")].rigidbody.isKinematic = false;
 }
开发者ID:Daminvar,项目名称:Scatterblocks,代码行数:4,代码来源:GameManager.cs

示例15: showTimer

 public void showTimer(ISFSObject data)
 {
     gameObject.GetComponent<HackSecondsManager>().setAction(data.GetUtfString("ACTION"));
     gameObject.GetComponent<HackSecondsManager>().setSeconds(data.GetInt("seconds"));
 }
开发者ID:Hargalaten,项目名称:meGAMEss,代码行数:5,代码来源:NetworkManager.cs


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