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


C# ISFSObject.ContainsKey方法代码示例

本文整理汇总了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;
     }
 }
开发者ID:claw2013hku,项目名称:UnityTestProject,代码行数:7,代码来源:NetSyncObjGate.cs

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

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

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

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

示例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;
 }
开发者ID:Antaresgames,项目名称:AegisBorn,代码行数:23,代码来源:Character.cs

示例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;
 }
开发者ID:Antaresgames,项目名称:AegisBorn,代码行数:10,代码来源:ReceivableObject.cs

示例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;
 }
开发者ID:Antaresgames,项目名称:AegisBorn,代码行数:10,代码来源:ReceivableObject.cs

示例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;
 }
开发者ID:Antaresgames,项目名称:AegisBorn,代码行数:10,代码来源:ReceivableObject.cs

示例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;
 }
开发者ID:Antaresgames,项目名称:AegisBorn,代码行数:10,代码来源:ReceivableObject.cs


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