本文整理汇总了C#中ISFSObject.ContainsKey方法的典型用法代码示例。如果您正苦于以下问题:C# ISFSObject.ContainsKey方法的具体用法?C# ISFSObject.ContainsKey怎么用?C# ISFSObject.ContainsKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISFSObject
的用法示例。
在下文中一共展示了ISFSObject.ContainsKey方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleSync
public override void HandleSync(ISFSObject obj)
{
if(obj.ContainsKey("gate_state")){
int newState = obj.GetInt("gate_state");
open = (newState == 0) ? true : false;
}
}
示例2: ReceiveResultant
public void ReceiveResultant(ISFSObject obj, bool clearBuffer = false)
{
if(obj.ContainsKey("char_pos")){
if(clearBuffer){
if(resultantInterpolator != null){
resultantInterpolator.ClearBuffer();
}
}
ReceiveResultant(CharPosEffComp.ResultantFromSFSObject(obj));
}
}
示例3: ReceiveMoveDirection
public void ReceiveMoveDirection(ISFSObject obj, bool clearBuffer = false)
{
if(obj.ContainsKey("char_mov")){
if(clearBuffer){
if(moveDirInterpolator != null){
moveDirInterpolator.ClearBuffer();
}
}
ReceiveMoveDirection(CharPosEffComp.MoveDirFromSFSObject(obj));
}
}
示例4: 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;
}
}
}
示例5: ReceiveStatus
public void ReceiveStatus(ISFSObject sObj)
{
if(!sObj.ContainsKey(NetSyncObjCharacter.statusDS)){
Debug.LogError("no status init");
return;
}
ISFSObject statusObj = sObj.GetSFSObject(NetSyncObjCharacter.statusDS);
if(statusObj.ContainsKey("currentHP")){
component.HP = statusObj.GetFloat("currentHP");
Debug.Log ("Receiving HP Change : " + component.HP);
}
if(statusObj.ContainsKey("team")){
component.Team = statusObj.GetInt("team");
Debug.Log ("Team Change: " + component.Team);
}
}
示例6: FromSFSObject
public override bool FromSFSObject(ISFSObject data)
{
bool retVal = false;
try
{
if (data.ContainsKey("id"))
{
id = GetLong(data, "id");
}
else
{
throw new Exception("SFSObject did not contain character id");
}
name = GetString(data, "name");
level = GetInt(data, "level");
retVal = true;
}
catch (Exception e)
{
Debug.Log(e);
}
return retVal;
}
示例7: TryGetString
public bool TryGetString(ISFSObject data, string key, out string value)
{
if (data.ContainsKey(key))
{
value = GetString(data, key);
return true;
}
value = "";
return false;
}
示例8: TryGetInt
public bool TryGetInt(ISFSObject data, string key, out int value)
{
if (data.ContainsKey(key))
{
value = GetInt(data, key);
return true;
}
value = 0;
return false;
}
示例9: TryGetDouble
public bool TryGetDouble(ISFSObject data, string key, out double value)
{
if (data.ContainsKey(key))
{
value = GetDouble(data, key);
return true;
}
value = 0d;
return false;
}
示例10: TryGetBool
public bool TryGetBool(ISFSObject data, string key, out bool value)
{
if (data.ContainsKey(key))
{
value = GetBool(data, key);
return true;
}
value = false;
return false;
}