本文整理汇总了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");
}
示例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);
}
示例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]);
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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]);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例12: HandleResponse
public void HandleResponse(ISFSObject anObjectIn, GameWorldManager ourGWM)
{
GameUI ourGameUI = GameObject.Find("SceneScriptsObject").GetComponent<GameUI>();
ourGameUI.processChat(anObjectIn.GetUtfString("ChatText"));
}
示例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);
}
示例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;
}
}
示例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);
}
}