This file contains 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
using UnityEngine; | |
using UniRx; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
public class SwitchGarbage : MonoBehaviour { | |
void Start() { |
This file contains 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
using UnityEngine; | |
using UniRx; | |
using System; | |
using System.Linq; | |
public class DamageVolumePlayer : MonoBehaviour { | |
// Health should live in a different component. Just here for simplicity | |
public FloatReactiveProperty Health = new FloatReactiveProperty(100); | |
public float DamagePerSecond = 1.0f; |
This file contains 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
using UnityEngine; | |
using UniRx.Triggers; | |
using UniRx; | |
public class DamageVolume : MonoBehaviour { | |
public bool IsNegateVolume = false; | |
void Start () { | |
Collider c = GetComponent<Collider>(); |
This file contains 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
using UnityEngine; | |
using UniRx; | |
using UnityEngine.SceneManagement; | |
public class Character { | |
public enum State { | |
Idle, | |
Attacking | |
} | |
public ReactiveProperty<State> CurStateObservable = new ReactiveProperty<State>(); |
This file contains 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
using UnityEngine; | |
/// <summary> | |
/// Spawn prefabs at pre-defined spawn points. | |
/// There can be a delay before spawning, then the prefabs can be spawned in batches with a delay between each batch. | |
/// </summary> | |
public class ListSpawner : MonoBehaviour { | |
public GameObject[] PrefabList; | |
public Transform[] SpawnPoints; |
This file contains 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
using UnityEngine; | |
using UniRx; | |
using System; | |
/// <summary> | |
/// Spawn prefabs at pre-defined spawn points. | |
/// There can be a delay before spawning, then the prefabs can be spawned in batches with a delay between each batch. | |
/// </summary> | |
public class ListSpawnerRx : MonoBehaviour { |
This file contains 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
using Pathfinding; | |
using System.Collections; | |
using UnityEngine; | |
public class LayerGridGraphToggle : MonoBehaviour { | |
public int Width = 200; // (nodes) | |
public int Depth = 200; // (nodes) | |
public float NodeSize = 0.5f; | |
public Vector3 Center = Vector3.zero; |
This file contains 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
using UnityEngine; | |
using UniRx; | |
using UniRx.Triggers; | |
using System; | |
[RequireComponent(typeof(Animator))] | |
public class AnimationStateTest : MonoBehaviour { | |
void Start () { |
This file contains 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
using System; | |
namespace UniRx { | |
public static class SwitchExtensions { | |
public static IObservable<OUT> SwitchSelectWhenTrue<OUT>( this IObservable<bool> observable, Func<IObservable<OUT>> resultIfTrue ) { | |
return observable.Select(value => value == true ? resultIfTrue() : Observable.Empty<OUT>()).Switch(); | |
} |
This file contains 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
using System; | |
using System.Collections; | |
using UniRx; | |
using UnityEngine; | |
using System.Threading; | |
namespace UniRx { | |
public static partial class CustomObservable { |
NewerOlder