Пример #1
0
 void Start()
 {
     intProperty.Subscribe(it => Debug.Log(it));
     longProperty.Subscribe(it => Debug.Log(it));
     floatProperty.Subscribe(it => Debug.Log(it));
     doubleProperty.Subscribe(it => Debug.Log(it));
     byteProperty.Subscribe(it => Debug.Log(it));
     boolProperty.Subscribe(it => Debug.Log(it));
     stringProperty.Subscribe(it => Debug.Log(it));
     vector2Property.Subscribe(it => Debug.Log(it));
     vector3Property.Subscribe(it => Debug.Log(it));
     vector4Property.Subscribe(it => Debug.Log(it));
     quaternionProperty.Subscribe(it => Debug.Log(it));
     colorProperty.Subscribe(it => Debug.Log(it));
     boundsProperty.Subscribe(it => Debug.Log(it));
     animationCurveProperty.Subscribe(it => Debug.Log(it));
 }
Пример #2
0
        private void SubscribeObservablesBasic()
        {
            RectTransformDimensionsChangeSubject
            .Subscribe(_ => ApplyNumbers())
            .AddTo(Disposables);

            _CustomMaterial.Subscribe(_mat => SetMaterialToRenderers(GetMaterialForSprite(_mat)))
            .AddTo(Disposables);

            _Color.Subscribe(_col => SetColorToRenderers(_col))
            .AddTo(Disposables);

            Observable.CombineLatest(_SortingLayerID, _OrderInLayer, (_1, _2) => Unit.Default)
            .Subscribe(_ => SetSortToRenderers(SortingLayerID, OrderInLayer))
            .AddTo(Disposables);


            SubscribeObservables();
        }