本文整理汇总了C#中ReactiveProperty.SubscribeToText方法的典型用法代码示例。如果您正苦于以下问题:C# ReactiveProperty.SubscribeToText方法的具体用法?C# ReactiveProperty.SubscribeToText怎么用?C# ReactiveProperty.SubscribeToText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ReactiveProperty
的用法示例。
在下文中一共展示了ReactiveProperty.SubscribeToText方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Awake
void Awake()
{
var editPresenter = EditNotesPresenter.Instance;
this.UpdateAsObservable()
.Where(_ => Input.GetKeyDown(KeyCode.Escape))
.Subscribe(_ => Application.Quit());
var saveActionObservable = this.UpdateAsObservable()
.Where(_ => KeyInput.CtrlPlus(KeyCode.S))
.Merge(saveButton.OnClickAsObservable());
mustBeSaved = Observable.Merge(
EditData.BPM.Select(_ => true),
EditData.OffsetSamples.Select(_ => true),
EditData.MaxBlock.Select(_ => true),
editPresenter.RequestForEditNote.Select(_ => true),
editPresenter.RequestForAddNote.Select(_ => true),
editPresenter.RequestForRemoveNote.Select(_ => true),
editPresenter.RequestForChangeNoteStatus.Select(_ => true),
Audio.OnLoad.Select(_ => false),
saveActionObservable.Select(_ => false))
.SkipUntil(Audio.OnLoad.DelayFrame(1))
.Do(unsaved => saveButton.GetComponent<Image>().color = unsaved ? unsavedStateButtonColor : savedStateButtonColor)
.ToReactiveProperty();
mustBeSaved.SubscribeToText(messageText, unsaved => unsaved ? "保存が必要な状態" : "");
saveActionObservable.Subscribe(_ => Save());
dialogSaveButton.AddListener(
EventTriggerType.PointerClick,
(e) =>
{
mustBeSaved.Value = false;
saveDialog.SetActive(false);
Save();
Application.Quit();
});
dialogDoNotSaveButton.AddListener(
EventTriggerType.PointerClick,
(e) =>
{
mustBeSaved.Value = false;
saveDialog.SetActive(false);
Application.Quit();
});
dialogCancelButton.AddListener(
EventTriggerType.PointerClick,
(e) =>
{
saveDialog.SetActive(false);
});
}
示例2: Initialize
protected override void Initialize()
{
var image = this.GetComponent<Image>();
Message = new ReactiveProperty<string>("");
Message.SubscribeToText(text);
Color = new ReactiveProperty<UnityEngine.Color>();
Color.Subscribe(x => image.color = x);
}
示例3: Start
void Start()
{
if (alreadyStarted) return;
alreadyStarted = true;
var image = this.GetComponent<Image>();
Message = new ReactiveProperty<string>("");
Message.SubscribeToText(text);
Color = new ReactiveProperty<UnityEngine.Color>();
Color.Subscribe(x => image.color = x);
}