protected override void CreateTween() { Vector3[] newValues = useTransformDestination && destination != null?ArrayExtend.CreateArray(destination.position) : values; _tween = TweensExtend.TranslateTween(container.Component, _valueForTween, isAutoKill, functionEnum, space, mode, curveFactor, newValues); curveFactor = _tween.CurveFactor; }
public override void Play(bool setInit = false) { if (_tween != null) { _tween.FinalValues = ArrayExtend.ConvertNumbersAndVectors <Vector4>(values); } base.Play(setInit); }
public override void Play(bool setInit = false) { if (_tween != null) { Vector3[] newValues = useTransformDestination && destination != null?ArrayExtend.CreateArray(destination.position) : values; _tween.FinalValues = ArrayExtend.ConvertNumbersAndVectors <Vector4>(newValues); } base.Play(setInit); }
// tween for the audio mixer parameters. /// <param name = "mixer">The audio mixer container</param> /// <param name = "nameParamMixer">the name of the parameter you want to change</param> /// <param name = "timeOrVelocity">the time of tween</param> /// <param name = "isAutoKill">Does the tween have to destroy itself when it ends?</param> /// <param name = "functionEnum">the function to soften the tween</param> /// <param name = "values">The values that the tween must reach</param> public static TweenContainer MixerParamTween(this AudioMixer mixer, string nameParamMixer, float timeOrVelocity, bool isAutoKill, FunctionEnum functionEnum, ChangeModes changeMode, params float[] values) { if (mixer == null) { return(null); } void SetNewValue(Vector4 newValue) { if (mixer != null) { mixer.GetFloat(nameParamMixer, out float currentValue); currentValue += newValue.x; mixer.SetFloat(nameParamMixer, currentValue); } else { LogManager.LogWarning("The tween is is referring to object that is not exist", "Tween"); } } Vector4 GetInitValue() { float result = 0; if (mixer != null) { mixer.GetFloat(nameParamMixer, out result); } else { LogManager.LogWarning("The tween is is referring to object that is not exist", "Tween"); } return(new Vector4(result, 0, 0, 0)); } AnimationCurveInfo curve = new(functionEnum); Vector4[] finalValues = ArrayExtend.ConvertNumbersAndVectors <Vector4>(values); return(TweenContainer.CreateTween(GetInitValue, timeOrVelocity, SetNewValue, isAutoKill, curve, changeMode, finalValues)); }
public void RemoveContainerIntern(object container) { object[] containers = ArrayExtend.CreateArray(container); RemoveElements(containers); }
public void AddContainerIntern(object container) { object[] containers = ArrayExtend.CreateArray(container); CreateNewElements(containers); }
public DebugVar[] GetMembers(string[] categories) { List <string> aux = new(categories); List <DebugVar> result = new(); var debugPages = ReflectionExtend.CreateDerivedInstances <DebugScreenVarsNative>(); foreach (var debugPage in debugPages) { var methods = ReflectionExtend.GetMethodsWithSpecificAttribute <DebugScreenAttribute>(ArrayExtend.CreateArray(debugPage), (DebugScreenAttribute attr) => { return(aux != null && aux.Contains(attr.DebugCategory)); }); foreach (var method in methods) { var member = method.Invoke <MemberComplexInfo>(); string name = ""; if (member != null) { name = ReflectionExtend.GetValueAttribute(method.methodInfo, (DebugScreenAttribute attr) => { return(attr.DebugName); }); result.Add(new DebugVar(name, member)); } } } return(result.ToArray()); }