protected void ApplyOptionDelayed(AudioOption option, bool recycle) { var delayedOption = TypePoolManager.Create <AudioDelayedOption>(); delayedOption.Initialize(option, recycle, getDeltaTime); delayedOptions.Add(delayedOption); }
public void SetValue(IList array, int index) { if (array == null) { return; } if (array.Count > index) { var target = array[index]; if (target == null) { if (isUnityObject) { return; } else { target = array[index] = TypePoolManager.Create(source.GetType()); } } copier.CopyTo(source, target); } }
public void SetValue(IList array, int index) { if (array == null) { return; } if (array.Count > index) { var value = array[index]; if (value == null) { if (isUnityObject) { return; } else { value = array[index] = TypePoolManager.Create(elementType); } } PoolUtility.InitializeFields(value, setters); } }
public static List <IComponentOld> DeserializeComponents(string data) { List <IComponentOld> components; using (var reader = new StringReader(data)) { int count = int.Parse(reader.ReadLine()); components = new List <IComponentOld>(count); for (int i = 0; i < count; i++) { var type = TypeUtility.GetType(reader.ReadLine()); var line = reader.ReadLine(); if (type != null) { var component = TypePoolManager.Create(type); JsonUtility.FromJsonOverwrite(line, component); components.Add((IComponentOld)component); } } } return(components); }
public IComponentOld AddComponent(Type type) { var component = (IComponentOld)TypePoolManager.Create(type); AddComponent(component, true); return(component); }
public IAudioItem CreateDynamicItem(DynamicGetter getNextSettings, Func <Vector3> getPosition) { var spatializer = TypePoolManager.Create <AudioSpatializer>(); spatializer.Initialize(getPosition); return(CreateDynamicItem(getNextSettings, spatializer, null)); }
public AudioDynamicItem CreateDynamicItem(DynamicGetter getNextSettings, AudioSpatializer spatializer, IAudioItem parent) { var item = TypePoolManager.Create <AudioDynamicItem>(); item.Initialize(getNextSettings, this, spatializer, parent); return(item); }
public IAudioItem CreateItem(AudioSettingsBase settings, Func <Vector3> getPosition) { var spatializer = TypePoolManager.Create <AudioSpatializer>(); spatializer.Initialize(getPosition); return(CreateItem(settings, spatializer, null)); }
static AudioOption Create(Types type, object value, float delay = 0f) { var option = TypePoolManager.Create <AudioOption>(); option.Initialize(type, value, delay); return(option); }
public IAudioItem CreateDynamicItem(DynamicGetter getNextSettings, Transform follow) { var spatializer = TypePoolManager.Create <AudioSpatializer>(); spatializer.Initialize(follow); return(CreateDynamicItem(getNextSettings, spatializer, null)); }
public IAudioItem CreateItem(AudioSettingsBase settings, Transform follow) { var spatializer = TypePoolManager.Create <AudioSpatializer>(); spatializer.Initialize(follow); return(CreateItem(settings, spatializer, null)); }
public void Initialize(DynamicGetter getNextSettings, AudioItemManager itemManager, AudioSpatializer spatializer, IAudioItem parent) { settings = TypePoolManager.Create <AudioDynamicSettings>(); base.Initialize(settings.Identifier, itemManager, spatializer, parent); this.getNextSettings = getNextSettings ?? delegate { return(null); }; InitializeModifiers(settings); InitializeSources(); }
public static AudioValue <float> GetGlobalRTPCValue(string name) { AudioValue <float> value; if (!rtpcValues.TryGetValue(name, out value)) { value = TypePoolManager.Create <AudioValue <float> >(); rtpcValues[name] = value; } return(value); }
/// <summary> /// Gets an AudioValue containing the current switch value. /// </summary> /// <param name="name">The name of the switch.</param> /// <returns>The AudioValue.</returns> public AudioValue <int> GetSwitchValue(string name) { AudioValue <int> value; if (!switchValues.TryGetValue(name, out value)) { value = TypePoolManager.Create <AudioValue <int> >(); switchValues[name] = value; } return(value); }
public void Trigger <TId, TArg1, TArg2, TArg3>(TId identifier, TArg1 argument1, TArg2 argument2, TArg3 argument3) { var eventGroup = GetEventGroup <TId>(); var eventData = TypePoolManager.Create <TriggerEvent <TId, TArg1, TArg2, TArg3> >(); eventData.EventGroup = eventGroup; eventData.Identifier = identifier; eventData.Argument1 = argument1; eventData.Argument2 = argument2; eventData.Argument3 = argument3; Trigger((IEvent)eventData, 0f); }
public virtual void OnCreate() { if (Scope == RTPCScope.Local) { value = TypePoolManager.Create <AudioValue <float> >(); } else { value = GetGlobalRTPCValue(Name); } lastValue = Curve.Evaluate(GetRatio()); }
ComponentGroupBase CreateComponentGroup(Type componentType) { var componentGroupType = ComponentUtility.GetComponentGroupType(componentType); var componentGroup = (ComponentGroupBase)TypePoolManager.Create(componentGroupType); bool success = false; for (int i = 0; i < allComponents.Count; i++) { success |= componentGroup.TryAdd(allComponents[i]); } if (success) { AddComponentIndex(ComponentUtility.GetComponentIndex(componentType)); } return(componentGroup); }
public AudioItemBase CreateItem(AudioSettingsBase settings, AudioSpatializer spatializer, IAudioItem parent) { if (settings == null) { return(null); } switch (settings.Type) { default: var sourceItem = TypePoolManager.Create <AudioSourceItem>(); var source = PrefabPoolManager.Create(audioManager.Reference); source.Copy(audioManager.Reference, audioManager.UseCustomCurves); sourceItem.Initialize((AudioSourceSettings)settings, this, source, spatializer, parent); return(sourceItem); case AudioTypes.MixContainer: var mixContainerItem = TypePoolManager.Create <AudioMixContainerItem>(); mixContainerItem.Initialize((AudioMixContainerSettings)settings, this, spatializer, parent); return(mixContainerItem); case AudioTypes.RandomContainer: var randomContainerItem = TypePoolManager.Create <AudioRandomContainerItem>(); randomContainerItem.Initialize((AudioRandomContainerSettings)settings, this, spatializer, parent); return(randomContainerItem); case AudioTypes.EnumeratorContainer: var enumeratorContainerItem = TypePoolManager.Create <AudioEnumeratorContainerItem>(); enumeratorContainerItem.Initialize((AudioEnumeratorContainerSettings)settings, this, spatializer, parent); return(enumeratorContainerItem); case AudioTypes.SwitchContainer: var switchContainerItem = TypePoolManager.Create <AudioSwitchContainerItem>(); switchContainerItem.Initialize((AudioSwitchContainerSettings)settings, this, spatializer, parent); return(switchContainerItem); case AudioTypes.SequenceContainer: var sequenceContainerItem = TypePoolManager.Create <AudioSequenceContainerItem>(); sequenceContainerItem.Initialize((AudioSequenceContainerSettings)settings, this, spatializer, parent); return(sequenceContainerItem); } }
protected void UpdateSequence() { if (breakSequence || (sources.Count > 0 && !requestNextSettings)) { return; } var data = TypePoolManager.Create <AudioDynamicData>(); var settings = getNextSettings(this, data); currentStep++; if (settings == null || state == AudioStates.Stopped) { breakSequence = true; } else { AddSource(settings, data); } }
public void SetValue(object instance) { if (instance == null) { return; } var target = field.GetValue(instance); if (target == null) { if (isUnityObject) { return; } else { field.SetValue(instance, target = TypePoolManager.Create(source.GetType())); } } copier.CopyTo(source, target); }
public void SetValue(object instance) { if (instance == null) { return; } var value = field.GetValue(instance); if (value == null) { if (isUnityObject) { return; } else { field.SetValue(instance, value = TypePoolManager.Create(type)); } } PoolUtility.InitializeFields(value, setters); }
public IAudioItem CreateDynamicItem(DynamicGetter getNextSettings) { var spatializer = TypePoolManager.Create <AudioSpatializer>(); return(CreateDynamicItem(getNextSettings, spatializer, null)); }
void IPoolable.OnCreate() { value = TypePoolManager.Create <DynamicValue>(); }
public IAudioItem CreateItem(AudioSettingsBase settings) { var spatializer = TypePoolManager.Create <AudioSpatializer>(); return(CreateItem(settings, spatializer, null)); }