This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Test] | |
public void MergePropertyTest() { | |
// Create an IEnumerable list of reactive proeprties | |
List<ReactiveProperty<int>> rxPropertyList = new List<ReactiveProperty<int>>(); | |
// Add a couple reactive properties | |
rxPropertyList.Add(new ReactiveProperty<int>(1)); | |
rxPropertyList.Add(new ReactiveProperty<int>(2)); | |
// Convert the IEnumerable list to an observable stream |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UniRxUnitTests { | |
[Test] | |
public void ReactiveCommandTest_2() { | |
// Arrange | |
ReactiveProperty<long> CurrentHp = new ReactiveProperty<long>(100); | |
// Only allow when the player is dead | |
// ReactiveCommand Resurrect = CurrentHp.Select(hp=> return hp <= 0).ToReactiveCommand(); | |
int canExecuteCalled = 0; | |
ReactiveCommand Resurrect = CurrentHp.Select(hp=> { canExecuteCalled++; return hp <= 0; }).ToReactiveCommand(); |
NewerOlder