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


C# ISFSObject.GetUtfString方法代码示例

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


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

示例1: fromSFSObject

 public void fromSFSObject(ISFSObject estimacion)
 {
     user = estimacion.GetUtfString("user");
     valorEstimacion = estimacion.GetFloat("valorEstimacion");
     descripcion = estimacion.GetUtfString("descripcion");
     id_UserStory = estimacion.GetLong("id_Story");
 }
开发者ID:CristianCosta,项目名称:Kinect,代码行数:7,代码来源:Estimacion.cs

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

示例3: 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

示例4: HandleResponse

 public void HandleResponse(ISFSObject anObjectIn, GameWorldManager ourGWM)
 {
     string aCharacterName = anObjectIn.GetUtfString("CharacterName");
     if(aCharacterName == ourGWM.getLPC().GetName())
     {
         return;
     }
     else if(ourGWM.getPlayerDictionary().ContainsKey(aCharacterName))
     {
         ourGWM.destroyObject("GameCharacter_" + aCharacterName);
         ourGWM.getPlayerDictionary().Remove(aCharacterName);
     }
 }
开发者ID:Gabe-Biele,项目名称:Project-Circleage,代码行数:13,代码来源:DespawnPlayerHandler.cs

示例5: 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

示例6: HandleResponse

        public void HandleResponse(ISFSObject anObjectIn, GameWorldManager ourGWM)
        {
            string aCharacterName = anObjectIn.GetUtfString("CharacterName");
            if(aCharacterName == ourGWM.getLPC().GetName())
            {
                return;
            }
            else if(ourGWM.getPlayerDictionary().ContainsKey(aCharacterName))
            {
                float Rotation = anObjectIn.GetFloat("Rotation");

                ourGWM.getPlayerDictionary()[aCharacterName].GetComponent<RemotePlayerController>().SetRotation(Rotation);
            }
        }
开发者ID:Gabe-Biele,项目名称:Project-Circleage,代码行数:14,代码来源:RotationUpdateHandler.cs

示例7: HandleResponse

 public void HandleResponse(ISFSObject anObjectIn, GameWorldManager ourGWM)
 {
     string aCharacterName = anObjectIn.GetUtfString("CharacterName");
     if(aCharacterName == ourGWM.getLPC().GetName())
     {
         return;
     }
     else if(ourGWM.getPlayerDictionary().ContainsKey(aCharacterName))
     {
         float[] LocationArray = anObjectIn.GetFloatArray("Location");
         bool IsMoving = anObjectIn.GetBool("IsMoving");
         ourGWM.getPlayerDictionary()[aCharacterName].GetComponent<RemotePlayerController>().SetPlayerMoving(IsMoving);
         ourGWM.getPlayerDictionary()[aCharacterName].transform.position = new Vector3(LocationArray[0], LocationArray[1], LocationArray[2]);
     }
 }
开发者ID:Gabe-Biele,项目名称:Project-Circleage,代码行数:15,代码来源:PositionUpdateHandler.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: 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

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

示例11: HandleResponse

        public void HandleResponse(ISFSObject anObjectIn, GameWorldManager ourGWM)
        {
            Debug.Log("Server spawning player.");
            float[] locationArray = anObjectIn.GetFloatArray("Location");
            float aRotation = anObjectIn.GetFloat("Rotation");
            string aCharacterName = anObjectIn.GetUtfString("CharacterName");

            if(anObjectIn.GetBool("IsLocal"))
            {
                GameObject aLocalPlayer = ourGWM.createObject("Prefabs/Player/PlayerBasic");
                aLocalPlayer.transform.position = new Vector3(locationArray[0], locationArray[1], locationArray[2]);
                aLocalPlayer.transform.rotation = Quaternion.identity;

                // Since this is the local player, lets add a controller and fix the camera
                aLocalPlayer.AddComponent<LocalPlayerController>();
                aLocalPlayer.AddComponent<InputController>();
                ourGWM.setLPC(aLocalPlayer.GetComponent<LocalPlayerController>());
                ourGWM.getLPC().SetName(aCharacterName);
                aLocalPlayer.GetComponentInChildren<TextMesh>().text = aCharacterName;

                GameObject cameraAttach = new GameObject();
                cameraAttach.transform.parent = aLocalPlayer.transform;
                cameraAttach.transform.localPosition = new Vector3(1f, 2.5f, 1.0f);
                cameraAttach.name = "Camera Target";
                Camera.main.transform.parent = cameraAttach.transform;
                Camera.main.GetComponent<CameraController>().setTarget(cameraAttach);
                Camera.main.GetComponent<CameraController>().setCursorVisible(false);
            }
            else if(!anObjectIn.GetBool("IsLocal"))
            {
                GameObject aRemotePlayer = ourGWM.createObject("Prefabs/Player/PlayerBasic");

                aRemotePlayer.name = "GameCharacter_" + aCharacterName;
                aRemotePlayer.AddComponent<RemotePlayerController>();
                aRemotePlayer.transform.position = new Vector3(locationArray[0], locationArray[1], locationArray[2]);
                aRemotePlayer.GetComponent<RemotePlayerController>().SetRotation(aRotation);
                aRemotePlayer.GetComponentInChildren<TextMesh>().text = aCharacterName;

                //Add Newly spawned player to Dictionary
                ourGWM.getPlayerDictionary().Add(aCharacterName, aRemotePlayer);
            }
        }
开发者ID:Gabe-Biele,项目名称:Project-Circleage,代码行数:42,代码来源:SpawnPlayerHandler.cs

示例12: HandleResponse

 public void HandleResponse(ISFSObject anObjectIn, GameWorldManager ourGWM)
 {
     GameUI ourGameUI = GameObject.Find("SceneScriptsObject").GetComponent<GameUI>();
     ourGameUI.processChat(anObjectIn.GetUtfString("ChatText"));
 }
开发者ID:Gabe-Biele,项目名称:Project-Circleage,代码行数:5,代码来源:ProcessChatHandler.cs

示例13: Smile

 /// <summary>
 /// Кто-то улыбается
 /// </summary>
 /// <param name="data"></param>
 void Smile(ISFSObject data)
 {
     Smiles.SmileTypes smileType = (Smiles.SmileTypes)Enum.Parse(typeof(Smiles.SmileTypes), data.GetUtfString("smileType"));
     string userName = data.GetUtfString("userName");
     if (OnSmile != null)
         OnSmile(smileType, userName);
 }
开发者ID:PanCrucian,项目名称:IOL,代码行数:11,代码来源:ServerResponses.cs

示例14: CreateNewGameObject

    public void CreateNewGameObject(ISFSObject obj)
    {
        string id = obj.GetUtfString("Id");

        //parse id to determine type
        string[] temp = id.Split('-');
        //Debug.Log(temp[0] + " " + temp[1] + " " + temp[2]);

        int type = int.Parse(temp[1]);

        GameObject newObject;

        //Debug.Log("Make new stuff");

        switch (type)
        {
            case 00: //tank
                Vector3 pos = new Vector3(obj.GetFloat("px"), obj.GetFloat("py"), obj.GetFloat("pz"));
                newObject = (GameObject)Instantiate(OtherPlayerTankPrefab, pos, Quaternion.identity);
                newObject.GetComponent<InputController>().id = temp[0];
                newObject.GetComponent<NetTag>().Id = temp[0] + "-00-" + "00";
                GameObject.FindWithTag("MainCamera").GetComponent<MainCameraScript>().setEnemies();
                GameObject.FindWithTag("MapCamera").GetComponent<MapCameraScript>().setEnemies();
                updatePhysList();
                break;

            case 1: //projectile
                newObject = (GameObject)Instantiate(heatProjectile, new Vector3(obj.GetFloat("ppx"), obj.GetFloat("ppy"), obj.GetFloat("ppz")), Quaternion.Euler(new Vector3(obj.GetFloat("prx"), obj.GetFloat("pry"), obj.GetFloat("prz"))));
                newObject.rigidbody.velocity = new Vector3(obj.GetFloat("pvx"), obj.GetFloat("pvy"), obj.GetFloat("pvz"));
                newObject.transform.position += newObject.rigidbody.velocity.normalized * 7;
                newObject.GetComponent<NetTag>().Id = temp[0] + "-1-" + temp[2];
                //primaryCount++;
                // Recoil
                /*NetInputController thisRemoteController = GetRemoteController(temp[0] + "-00-" + "00");
                thisRemoteController.Hull.rigidbody.AddForceAtPosition(-newObject.rigidbody.velocity * newObject.rigidbody.mass, thisRemoteController.Turret.Muzzle.transform.position, ForceMode.Impulse);*/
                updatePhysList();
                //Debug.Log("Spawning New Projectile with ID: " + newObject.GetComponent<NetTag>().Id);
                break;

            case 2: //missile
                newObject = (GameObject)Instantiate(ATMissile, new Vector3(obj.GetFloat("ppx"),obj.GetFloat("ppy"),obj.GetFloat("ppz")), Quaternion.Euler(new Vector3(obj.GetFloat("prx"),obj.GetFloat("pry"),obj.GetFloat("prz"))));
                newObject.GetComponent<GuidedProjectileInputController>().TargetPosition = new Vector3(obj.GetFloat("tx"), obj.GetFloat("ty"), obj.GetFloat("tz")); //ATMissile
                newObject.rigidbody.velocity = new Vector3(obj.GetFloat("pvx"), obj.GetFloat("pvy"), obj.GetFloat("pvz")); //ATMissile
                newObject.transform.position += newObject.rigidbody.velocity.normalized * 7;
                newObject.GetComponent<NetTag>().Id = temp[0] + "-2-" + temp[2];
                //secondaryCount++;
                updatePhysList();
                //Debug.Log("Spawning New Missile with ID: " + newObject.GetComponent<NetTag>().Id);
                break;

            default:
                //Debug.Log("Type was: " + type);
                break;
        }
    }
开发者ID:Rabenvald,项目名称:Heavy-Insertion,代码行数:55,代码来源:Manager.cs

示例15: recieveExplosionForce

    private void recieveExplosionForce(ISFSObject msg)
    {
        var force = msg.GetFloat("force");
        var pos = msg.GetFloatArray("pos");
        var team = msg.GetUtfString("team");
        targetPosition = new Vector3(pos[0], Y_PLANE, pos[1]);

        GameObject newExplosion = Instantiate(ExplosionPF, targetPosition, Quaternion.identity) as GameObject;

        if (team == "blue")
        {
            newExplosion.GetComponent<ParticleSystem>().startColor = new Color(0.0f, 0.5f, 1.0f, 1.0f);
        }
        else
        {
            newExplosion.GetComponent<ParticleSystem>().startColor = Color.red;
        }

        Vector3 lightPosition = targetPosition;
        lightPosition.y += 10.0f;

        GameObject explosionLight = Instantiate(ExplosionLightPF, lightPosition, Quaternion.identity) as GameObject;

        if (team == "blue")
        {
            explosionLight.GetComponent<Light>().color = Color.blue;
        }
        else
        {
            explosionLight.GetComponent<Light>().color = Color.red;
        }

        float totalTime = 2.0f * force/160.0f;

        Destroy(newExplosion, totalTime);

        totalTime = totalTime/5.0f;

        Destroy(explosionLight, totalTime);

        GameObject[] blocksArray = GameObject.FindGameObjectsWithTag("Block");
        foreach (GameObject block in blocksArray)
        {
            if (block.GetComponent<BoxCollider>().bounds.Contains(targetPosition))
            {
                var extents = block.GetComponent<BoxCollider>().bounds.extents;
                if(targetPosition.x > block.transform.position.x)
                    targetPosition += new Vector3(extents.x, 0, 0);
                else
                    targetPosition -= new Vector3(extents.x, 0, 0);

                if(targetPosition.z > block.transform.position.z)
                    targetPosition += new Vector3(0, 0, extents.z);
                else
                    targetPosition -= new Vector3(0, 0, extents.z);
            }

            block.GetComponent<Rigidbody>().AddExplosionForce(force, targetPosition, 25.0f, 0.0f, ForceMode.Impulse);
        }
    }
开发者ID:Daminvar,项目名称:Scatterblocks,代码行数:60,代码来源:GameManager.cs


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