public void AddReturnsTrueIfSuccessfullyAdded() { var dictionary = new OptionDictionary <string, string>(); var result = dictionary.Add("key", "value"); Assert.That(result, Is.True); }
public void AddReturnsFalseIfKeyAlreadyAdded() { var dictionary = new OptionDictionary <string, string> { { "key", "value" } }; var result = dictionary.Add("key", "other-value"); Assert.That(result, Is.False); }
void OnEnable() { if (EnabledOptions == null) EnabledOptions = new OptionDictionary(); foreach (string name in Enum.GetNames(typeof(BuildAssetBundleOptions))) { // the first enum value is 'None' so we skip it. if (string.IsNullOrEmpty(name) || name == "None") continue; BuildAssetBundleOptions key = (BuildAssetBundleOptions)Enum.Parse(typeof(BuildAssetBundleOptions), name); if (!EnabledOptions.ContainsKey(key)) { bool val = false; #if UNITY_5 // Skip some options which are not neccessary on Unity 5.x // CollectDependencies and DeterministicAssetBundle are always enabled in the new AssetBundle build system introduced in 5.0. // CompleteAssets is ingored as we always start from assets rather than objects, it should be complete by default. if (key != BuildAssetBundleOptions.None && (key == BuildAssetBundleOptions.UncompressedAssetBundle || key == BuildAssetBundleOptions.DisableWriteTypeTree || key == BuildAssetBundleOptions.ForceRebuildAssetBundle || key == BuildAssetBundleOptions.IgnoreTypeTreeChanges || key == BuildAssetBundleOptions.AppendHashToAssetBundleName #if !(UNITY_5_0 || UNITY_5_1 || UNITY_5_2) // from Unity 5.3x, it supports ChunkBasedCompression || key == BuildAssetBundleOptions.ChunkBasedCompression)) #endif { EnabledOptions.Add(key, val); } #else EnabledOptions.Add(key, val); #endif } } }
public XtiProcess AddConfigOptions(object options, string name = "") { config.Add(options, name); return(this); }
public Entity Add(BlockPos relative, Entity entity) { _entities.Add(relative, entity); return(entity); }
public void Register <T>() where T : struct, IComponent => _storageRegistry.Add(typeof(T), new StorageHandler <T>(typeof(T), _chunks.Entities));