コード例 #1
0
        public CapabilitiesChanges(PListDictionary dic)
        {
            if (dic == null)
            {
                return;
            }

            foreach (var kvp in dic)
            {
                SystemCapability key;

                try
                {
                    key = (SystemCapability)System.Enum.Parse(typeof(SystemCapability), kvp.Key);
                }
                catch (System.Exception e)
                {
                    Debug.LogError("EgoXproject: Invalid entry in Capabilities section. Skipping. " + e.Message);
                    continue;
                }

                var capDic = kvp.Value as PListDictionary;

                if (capDic == null)
                {
                    Debug.LogError("EgoXproject: Invalid entry in Capabilities section. Skipping. ");
                    continue;
                }

                _capabilities[key] = SystemCapabilityHelper.Create(key, capDic);
            }
        }
コード例 #2
0
 public void EnableCapability(SystemCapability capability, bool enabled)
 {
     if (enabled)
     {
         if (!IsCapabilityEnabled(capability))
         {
             _capabilities[capability] = SystemCapabilityHelper.Create(capability);
         }
     }
     else
     {
         _capabilities.Remove(capability);
     }
 }