Exemplo n.º 1
0
 public static IDisposable BindPlayTo(this ParticleSystem input, IReactiveProperty <bool> property, BindingTypes bindingType = BindingTypes.Default, params IFilter <bool>[] filters)
 {
     return(GenericBindings.Bind(() => input.isPlaying, x => {
         if (x)
         {
             input.Play();
         }
         else
         {
             input.Stop();
         }
     }, property, bindingType, filters).AddTo(input));
 }
Exemplo n.º 2
0
 public static IDisposable BindPlayTo(this ParticleSystem input, Func <bool> getter, Action <bool> setter, BindingTypes bindingType = BindingTypes.Default, params IFilter <bool>[] filters)
 {
     return(GenericBindings.Bind(() => input.isPlaying, x =>
     {
         if (x)
         {
             input.Play();
         }
         else
         {
             input.Stop();
         }
     }, getter, setter, bindingType, filters).AddTo(input));
 }
Exemplo n.º 3
0
        public static IDisposable BindValueTo(this TMP_Dropdown input, IReactiveProperty <string> property, BindingTypes bindingType = BindingTypes.Default, params IFilter <string>[] filters)
        {
            return(GenericBindings.Bind(() => input.options[input.value].text, x =>
            {
                var matchingIndex = 0;
                for (var i = 0; i < input.options.Count; i++)
                {
                    if (input.options[i].text == property.Value)
                    {
                        matchingIndex = i;
                        break;
                    }
                }

                input.value = matchingIndex;
            }, property, bindingType, filters).AddTo(input));
        }
Exemplo n.º 4
0
        public static IDisposable BindValueTo(this TMP_Dropdown input, Func <string> getter, Action <string> setter, BindingTypes bindingType = BindingTypes.Default, params IFilter <string>[] filters)
        {
            return(GenericBindings.Bind(() => input.options[input.value].text, x =>
            {
                var matchingIndex = 0;
                var currentValue = getter();
                for (var i = 0; i < input.options.Count; i++)
                {
                    if (input.options[i].text == currentValue)
                    {
                        matchingIndex = i;
                        break;
                    }
                }

                input.value = matchingIndex;
            }, getter, setter, bindingType, filters).AddTo(input));
        }
Exemplo n.º 5
0
 public static IDisposable BindFloatTo(this Animator input, int parameter, Func <float> getter, Action <float> setter, BindingTypes bindingType = BindingTypes.Default, params IFilter <float>[] filters)
 {
     return(GenericBindings.Bind(() => input.GetFloat(parameter), x => input.SetFloat(parameter, x), getter, setter, bindingType, filters).AddTo(input));
 }
Exemplo n.º 6
0
 public static IDisposable BindBoolTo(this Animator input, string parameter, Func <bool> getter, Action <bool> setter, BindingTypes bindingType = BindingTypes.Default, params IFilter <bool>[] filters)
 {
     return(GenericBindings.Bind(() => input.GetBool(parameter), x => input.SetBool(parameter, x), getter, setter, bindingType, filters).AddTo(input));
 }
Exemplo n.º 7
0
 public static IDisposable BindFloatTo(this Animator input, int parameter, IReactiveProperty <float> property, BindingTypes bindingType = BindingTypes.Default, params IFilter <float>[] filters)
 {
     return(GenericBindings.Bind(() => input.GetFloat(parameter), x => input.SetFloat(parameter, x), property, bindingType, filters).AddTo(input));
 }
 public static IDisposable BindPositionTo(this RectTransform input, IReactiveProperty <Vector3> property, BindingTypes bindingType = BindingTypes.Default, params IFilter <Vector3>[] filters)
 {
     return(GenericBindings.Bind(() => input.position, x => input.transform.position = x, property, bindingType, filters).AddTo(input));
 }
Exemplo n.º 9
0
 public static IDisposable BindTriggerTo(this Animator input, string parameter, Func <bool> getter, Action <bool> setter, BindingTypes bindingType = BindingTypes.Default, params IFilter <bool>[] filters)
 {
     return(GenericBindings.Bind(null, x => input.SetTrigger(parameter), getter, setter, BindingTypes.OneWay, filters).AddTo(input));
 }
Exemplo n.º 10
0
 public static IDisposable BindShaderTo(this Material input, IReactiveProperty <Shader> property, BindingTypes bindingType = BindingTypes.Default, params IFilter <Shader>[] filters)
 {
     return(GenericBindings.Bind(() => input.shader, x => input.shader = x, property, bindingType, filters));
 }
Exemplo n.º 11
0
 public static IDisposable BindValueTo(this TMP_Dropdown input, IReactiveProperty <int> property, BindingTypes bindingType = BindingTypes.Default, params IFilter <int>[] filters)
 {
     return(GenericBindings.Bind(() => input.value, x => input.value = x, property, bindingType, filters).AddTo(input));
 }
Exemplo n.º 12
0
 public static IDisposable BindIkRotationWeightTo(this Animator input, AvatarIKGoal ikGoal, Func <float> getter, Action <float> setter, BindingTypes bindingType = BindingTypes.Default, params IFilter <float>[] filters)
 {
     return(GenericBindings.Bind(() => input.GetIKRotationWeight(ikGoal), x => input.SetIKRotationWeight(ikGoal, x), getter, setter, bindingType, filters).AddTo(input));
 }
Exemplo n.º 13
0
 public static IDisposable BindRootPositionTo(this Animator input, IReactiveProperty <Quaternion> property, BindingTypes bindingType = BindingTypes.Default, params IFilter <Quaternion>[] filters)
 {
     return(GenericBindings.Bind(() => input.rootRotation, x => input.rootRotation = x, property, bindingType, filters).AddTo(input));
 }
Exemplo n.º 14
0
 public static IDisposable BindIkPositionTo(this Animator input, AvatarIKGoal ikGoal, Func <Vector3> getter, Action <Vector3> setter, BindingTypes bindingType = BindingTypes.Default, params IFilter <Vector3>[] filters)
 {
     return(GenericBindings.Bind(() => input.GetIKPosition(ikGoal), x => input.SetIKPosition(ikGoal, x), getter, setter, bindingType, filters).AddTo(input));
 }
Exemplo n.º 15
0
 public static IDisposable BindIkRotationWeightTo(this Animator input, AvatarIKGoal ikGoal, IReactiveProperty <float> property, BindingTypes bindingType = BindingTypes.Default, params IFilter <float>[] filters)
 {
     return(GenericBindings.Bind(() => input.GetIKRotationWeight(ikGoal), x => input.SetIKRotationWeight(ikGoal, x), property, bindingType, filters).AddTo(input));
 }
Exemplo n.º 16
0
 public static IDisposable BindIkHintPositionTo(this Animator input, AvatarIKHint ikHint, IReactiveProperty <Vector3> property, BindingTypes bindingType = BindingTypes.Default, params IFilter <Vector3>[] filters)
 {
     return(GenericBindings.Bind(() => input.GetIKHintPosition(ikHint), x => input.SetIKHintPosition(ikHint, x), property, bindingType, filters).AddTo(input));
 }
Exemplo n.º 17
0
 public static IDisposable BindSpeedTo(this Animator input, Func <float> getter, Action <float> setter, BindingTypes bindingType = BindingTypes.Default, params IFilter <float>[] filters)
 {
     return(GenericBindings.Bind(() => input.speed, x => input.speed = x, getter, setter, bindingType, filters).AddTo(input));
 }
Exemplo n.º 18
0
 public static IDisposable BindSpeedTo(this Animator input, IReactiveProperty <float> property, BindingTypes bindingType = BindingTypes.Default, params IFilter <float>[] filters)
 {
     return(GenericBindings.Bind(() => input.speed, x => input.speed = x, property, bindingType, filters).AddTo(input));
 }
Exemplo n.º 19
0
 public static IDisposable BindTextureTo(this Material input, IReactiveProperty <Texture> property, BindingTypes bindingType = BindingTypes.Default, params IFilter <Texture>[] filters)
 {
     return(GenericBindings.Bind(() => input.mainTexture, x => input.mainTexture = x, property, bindingType, filters));
 }
Exemplo n.º 20
0
 public static IDisposable BindRootPositionTo(this Animator input, Func <Quaternion> getter, Action <Quaternion> setter, BindingTypes bindingType = BindingTypes.Default, params IFilter <Quaternion>[] filters)
 {
     return(GenericBindings.Bind(() => input.rootRotation, x => input.rootRotation = x, getter, setter, bindingType, filters).AddTo(input));
 }
Exemplo n.º 21
0
 public static IDisposable BindColorTo(this Material input, Func <Texture> getter, Action <Texture> setter, BindingTypes bindingType = BindingTypes.Default, params IFilter <Texture>[] filters)
 {
     return(GenericBindings.Bind(() => input.mainTexture, x => input.mainTexture = x, getter, setter, bindingType, filters));
 }
Exemplo n.º 22
0
 public static IDisposable BindFillAmountTo(this Image input, Func <float> getter, params IFilter <float>[] filters)
 {
     return(GenericBindings.Bind(() => input.fillAmount, x => input.fillAmount = x, getter, null, BindingTypes.OneWay, filters).AddTo(input));
 }
Exemplo n.º 23
0
 public static IDisposable BindShaderTo(this Material input, Func <Shader> getter, Action <Shader> setter, BindingTypes bindingType = BindingTypes.Default, params IFilter <Shader>[] filters)
 {
     return(GenericBindings.Bind(() => input.shader, x => input.shader = x, getter, setter, bindingType, filters));
 }
Exemplo n.º 24
0
 public static IDisposable BindRootMotionTo(this Animator input, IReactiveProperty <bool> property, BindingTypes bindingType = BindingTypes.Default, params IFilter <bool>[] filters)
 {
     return(GenericBindings.Bind(() => input.applyRootMotion, x => input.applyRootMotion = x, property, bindingType, filters).AddTo(input));
 }
Exemplo n.º 25
0
 public static IDisposable BindValueTo(this TMP_Dropdown input, Func <int> getter, Action <int> setter, BindingTypes bindingType = BindingTypes.Default, params IFilter <int>[] filters)
 {
     return(GenericBindings.Bind(() => input.value, x => input.value = x, getter, setter, bindingType, filters).AddTo(input));
 }
Exemplo n.º 26
0
 public static IDisposable BindBoolTo(this Animator input, string parameter, IReactiveProperty <bool> property, BindingTypes bindingType = BindingTypes.Default, params IFilter <bool>[] filters)
 {
     return(GenericBindings.Bind(() => input.GetBool(parameter), x => input.SetBool(parameter, x), property, bindingType, filters).AddTo(input));
 }
Exemplo n.º 27
0
 public static IDisposable BindStabilizeFeetTo(this Animator input, IReactiveProperty <bool> property, BindingTypes bindingType = BindingTypes.Default, params IFilter <bool>[] filters)
 {
     return(GenericBindings.Bind(() => input.stabilizeFeet, x => input.stabilizeFeet = x, property, bindingType, filters).AddTo(input));
 }
Exemplo n.º 28
0
 public static IDisposable BindTriggerTo(this Animator input, string parameter, IReactiveProperty <bool> property, IFilter <bool>[] filters)
 {
     return(GenericBindings.Bind(null, x => input.SetTrigger(parameter), property, BindingTypes.OneWay, filters).AddTo(input));
 }
Exemplo n.º 29
0
 public static IDisposable BindFillAmountTo(this Image input, IReactiveProperty <double> property, params IFilter <float>[] filters)
 {
     return(GenericBindings.Bind(() => input.fillAmount, x => input.fillAmount = x, property, new DoubleToFloatConverter(), BindingTypes.OneWay, filters).AddTo(input));
 }
Exemplo n.º 30
0
 public static IDisposable BindStabilizeFeetTo(this Animator input, Func <bool> getter, Action <bool> setter, BindingTypes bindingType = BindingTypes.Default, params IFilter <bool>[] filters)
 {
     return(GenericBindings.Bind(() => input.stabilizeFeet, x => input.stabilizeFeet = x, getter, setter, bindingType, filters).AddTo(input));
 }