bool IRTPPropertyListener.UpdateProperty(RTPProperty property, float value, RTPPropertyType type) { if (UpdateProperty(property, value, type)) { return(true); } if (property._property == 8) { if (property._name == "Delay") { _delay = RTPParameterToProperty.SetValueByType(_delay, value, type); if (_triggerMode == RandomComponentTriggerMode.Retrigger) { _retriggerTime = _delay; } return(true); } if (property._name == "Delay Randomization") { _delayMaxRandomization = RTPParameterToProperty.SetValueByType(_delayMaxRandomization, value, type); return(true); } } return(false); }
bool IRTPPropertyListener.UpdateProperty(RTPProperty property, float value, RTPPropertyType type) { if (UpdateProperty(property, value, type)) { return(true); } if (property._property == 8 && property._name == "Switch" && _components.Count > 0) { int index = (int)(value * (float)_components.Count); Component component = _components[index]; if (component != _selectedComponent) { SetSwitch(component.Name, (_componentInstance != null) ? true : false); } return(true); } return(false); }
bool IRTPPropertyListener.UpdateProperty(RTPProperty property, float value, RTPPropertyType type) { if (UpdateProperty(property, value, type)) { return(true); } if (property._property == 8) { for (int i = 0; i < _parametersList.Length; i++) { TimelineParameter timelineParameter = _parametersList[i]; if (timelineParameter._name == property._name) { timelineParameter.SetValue(value); } } } return(false); }
public static float SetValueByType(float in1, float in2, RTPPropertyType type = RTPPropertyType.Set) { switch (type) { case RTPPropertyType.Multiply: return(in1 * in2); case RTPPropertyType.Divide: return(in1 / in2); case RTPPropertyType.Add: return(in1 + in2); case RTPPropertyType.Subtract: return(in1 - in2); default: return(in2); } }