예제 #1
0
 public void Start()
 {
     ChangeColor = FlagProp.ToMVVMReactiveCommand();
     ChangeColor.Subscribe(_ => Color.Value = Random.ColorHSV());
     Text.Value = DateTime.Now.ToShortTimeString();
     CoExecute.Execute(ChangeRoutine);
     CoExecute.Execute(UnityUpdate);
 }
예제 #2
0
 private IEnumerator ChangeRoutine()
 {
     while (true)
     {
         FlagProp.Value       = !FlagProp.Value;
         VisabilityProp.Value = !VisabilityProp.Value;
         if (TestCollection.Count > 0)
         {
             TestCollection.RemoveAt(Random.Range(0, TestCollection.Count - 1));
         }
         for (var i = 0; i < 2; i++)
         {
             TestCollection.Add(new TestDataViewModel()
             {
                 Message = Random.Range(0, 1000).ToString(), Color = Random.ColorHSV()
             });
         }
         yield return(new UnityEngine.WaitForSeconds(3f));
     }
 }