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,64 +0,0 @@
|
|||
using System;
|
||||
|
||||
namespace UniRx.Operators
|
||||
{
|
||||
internal class DeferObservable<T> : OperatorObservableBase<T>
|
||||
{
|
||||
readonly Func<IObservable<T>> observableFactory;
|
||||
|
||||
public DeferObservable(Func<IObservable<T>> observableFactory)
|
||||
: base(false)
|
||||
{
|
||||
this.observableFactory = observableFactory;
|
||||
}
|
||||
|
||||
protected override IDisposable SubscribeCore(IObserver<T> observer, IDisposable cancel)
|
||||
{
|
||||
observer = new Defer(observer, cancel);
|
||||
|
||||
IObservable<T> source;
|
||||
try
|
||||
{
|
||||
source = observableFactory();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
source = Observable.Throw<T>(ex);
|
||||
}
|
||||
|
||||
return source.Subscribe(observer);
|
||||
}
|
||||
|
||||
class Defer : OperatorObserverBase<T, T>
|
||||
{
|
||||
public Defer(IObserver<T> observer, IDisposable cancel) : base(observer, cancel)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnNext(T value)
|
||||
{
|
||||
try
|
||||
{
|
||||
base.observer.OnNext(value);
|
||||
}
|
||||
catch
|
||||
{
|
||||
Dispose();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnError(Exception error)
|
||||
{
|
||||
try { observer.OnError(error); }
|
||||
finally { Dispose(); }
|
||||
}
|
||||
|
||||
public override void OnCompleted()
|
||||
{
|
||||
try { observer.OnCompleted(); }
|
||||
finally { Dispose(); }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue