本文整理汇总了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"));
}
}
示例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]);
}
示例3: HandleSync
public override void HandleSync(ISFSObject obj)
{
if(obj.ContainsKey("gate_state")){
int newState = obj.GetInt("gate_state");
open = (newState == 0) ? true : false;
}
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例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: 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;
}
}
}
示例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);
}
示例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);
}
示例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);
}
}
示例13: CurrentTimeUpdate
/// <summary>
/// Обновилось текущее время на сервере
/// </summary>
/// <param name="data"></param>
void CurrentTimeUpdate(ISFSObject data)
{
if (OnCurrentTimeUpdate != null)
OnCurrentTimeUpdate(data.GetInt("currentTime"));
}
示例14: unlockBlock
private void unlockBlock(ISFSObject msg)
{
_blocks[msg.GetInt("index")].rigidbody.isKinematic = false;
}
示例15: showTimer
public void showTimer(ISFSObject data)
{
gameObject.GetComponent<HackSecondsManager>().setAction(data.GetUtfString("ACTION"));
gameObject.GetComponent<HackSecondsManager>().setSeconds(data.GetInt("seconds"));
}