Weapos Rejiggered
Modified weapon scripts to eliminate specialized projectile behavior - allows charged weapons to have projectiles and modify weapon stats when charged Added machine gun weapon & VFX Moved third party code to Plugins folder to improve compile times
This commit is contained in:
parent
2a0fe34611
commit
dbc522a224
2105 changed files with 7033 additions and 1141 deletions
|
|
@ -1,57 +0,0 @@
|
|||
using System;
|
||||
using UniRx.Operators;
|
||||
|
||||
namespace UniRx.Operators
|
||||
{
|
||||
internal class SynchronizeObservable<T> : OperatorObservableBase<T>
|
||||
{
|
||||
readonly IObservable<T> source;
|
||||
readonly object gate;
|
||||
|
||||
public SynchronizeObservable(IObservable<T> source, object gate)
|
||||
: base(source.IsRequiredSubscribeOnCurrentThread())
|
||||
{
|
||||
this.source = source;
|
||||
this.gate = gate;
|
||||
}
|
||||
|
||||
protected override IDisposable SubscribeCore(IObserver<T> observer, IDisposable cancel)
|
||||
{
|
||||
return source.Subscribe(new Synchronize(this, observer, cancel));
|
||||
}
|
||||
|
||||
class Synchronize : OperatorObserverBase<T, T>
|
||||
{
|
||||
readonly SynchronizeObservable<T> parent;
|
||||
|
||||
public Synchronize(SynchronizeObservable<T> parent, IObserver<T> observer, IDisposable cancel) : base(observer, cancel)
|
||||
{
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public override void OnNext(T value)
|
||||
{
|
||||
lock (parent.gate)
|
||||
{
|
||||
base.observer.OnNext(value);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnError(Exception error)
|
||||
{
|
||||
lock (parent.gate)
|
||||
{
|
||||
try { observer.OnError(error); } finally { Dispose(); };
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnCompleted()
|
||||
{
|
||||
lock (parent.gate)
|
||||
{
|
||||
try { observer.OnCompleted(); } finally { Dispose(); };
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue