protected void Start() { m_text = GetComponent <Text>(); IReadOnlyReactiveProperty <int> property = GetProperty <int>(); property.TakeUntilDestroy(this).SubscribeToText(m_text).AddTo(this); }
protected void Start() { m_selectable = GetComponent <Selectable>(); IReadOnlyReactiveProperty <bool> property = GetProperty <bool>(); property.TakeUntilDestroy(this).SubscribeToInteractable(m_selectable).AddTo(this); }
protected void Start() { m_text = GetComponent <Text>(); IReadOnlyReactiveProperty <int> property = GetProperty <int>(); (from l in property.TakeUntilDestroy(this) select PersistentSingleton <LocalizationService> .Instance.Text(m_key, l)).SubscribeToText(m_text).AddTo(this); }
protected void Start() { m_text = GetComponent <Text>(); IReadOnlyReactiveProperty <BigDouble> property = GetProperty <BigDouble>(); (from big in property.TakeUntilDestroy(this) select BigString.ToString(big, m_precision)).SubscribeToText(m_text).AddTo(this); }
protected void Start() { m_text = GetComponent <Text>(); IReadOnlyReactiveProperty <int> property = GetProperty <int>(); (from secs in property.TakeUntilDestroy(this) select(!m_short) ? TextUtils.FormatSeconds(secs) : TextUtils.FormatSecondsShort(secs)).SubscribeToText(m_text).AddTo(this); }
protected void Start() { m_text = GetComponent <Text>(); IReadOnlyReactiveProperty <string> property = GetProperty <string>(); (from i in property.TakeUntilDestroy(this) select i.ToString()).SubscribeToTextUntilNull(base.gameObject, m_text).AddTo(this); }
protected void Start() { m_slider = GetComponent <Slider>(); IReadOnlyReactiveProperty <float> property = GetProperty <float>(); property.TakeUntilDestroy(this).Subscribe(delegate(float val) { m_slider.value = val; }).AddTo(this); }
protected void Start() { m_reactiveInt = GetProperty <int>(); m_text = GetComponent <Text>(); m_rolling.SetCurrent(m_reactiveInt.Value); m_text.text = Mathf.RoundToInt(m_rolling.Current).ToString(); m_reactiveInt.TakeUntilDestroy(this).Delay(TimeSpan.FromSeconds(m_delay)).Subscribe(delegate(int target) { m_rolling.SetTarget(target); }) .AddTo(this); }
protected void Start() { Image image = GetComponent <Image>(); IReadOnlyReactiveProperty <string> property = GetProperty <string>(); (from path in property.TakeUntilDestroy(this) select PngTexture.LoadPNGAsTexture2D(path, 120, 120)).Subscribe(delegate(Texture2D texture) { if (texture != null) { Material material = new Material(image.material); material.SetTexture("_MainTex", texture); image.material = material; } }).AddTo(this); }