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,62 +0,0 @@
|
|||
using System;
|
||||
|
||||
namespace UniRx.Operators
|
||||
{
|
||||
internal class Wait<T> : IObserver<T>
|
||||
{
|
||||
static readonly TimeSpan InfiniteTimeSpan = new TimeSpan(0, 0, 0, 0, -1); // from .NET 4.5
|
||||
|
||||
readonly IObservable<T> source;
|
||||
readonly TimeSpan timeout;
|
||||
|
||||
System.Threading.ManualResetEvent semaphore;
|
||||
|
||||
bool seenValue = false;
|
||||
T value = default(T);
|
||||
Exception ex = default(Exception);
|
||||
|
||||
public Wait(IObservable<T> source, TimeSpan timeout)
|
||||
{
|
||||
this.source = source;
|
||||
this.timeout = timeout;
|
||||
}
|
||||
|
||||
public T Run()
|
||||
{
|
||||
semaphore = new System.Threading.ManualResetEvent(false);
|
||||
using (source.Subscribe(this))
|
||||
{
|
||||
var waitComplete = (timeout == InfiniteTimeSpan)
|
||||
? semaphore.WaitOne()
|
||||
: semaphore.WaitOne(timeout);
|
||||
|
||||
if (!waitComplete)
|
||||
{
|
||||
throw new TimeoutException("OnCompleted not fired.");
|
||||
}
|
||||
}
|
||||
|
||||
if (ex != null) throw ex;
|
||||
if (!seenValue) throw new InvalidOperationException("No Elements.");
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
public void OnNext(T value)
|
||||
{
|
||||
seenValue = true;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public void OnError(Exception error)
|
||||
{
|
||||
this.ex = error;
|
||||
semaphore.Set();
|
||||
}
|
||||
|
||||
public void OnCompleted()
|
||||
{
|
||||
semaphore.Set();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue