Exemplo n.º 1
0
 private void RestartDoMove(NavMeshAgent navMeshAgent, NavMeshObstacle navMeshObstacle)
 {
     navMeshAgent.UpdateAsObservable()
     .Where(_ => (navMeshAgent.transform.position - navMeshAgent.destination).sqrMagnitude < (this.destinationCheckDistance * this.destinationCheckDistance))
     .Take(1)
     .SubscribeWithState3(this, navMeshAgent, navMeshObstacle, (_, _this, a, o) => { _this.DoMove(a, o); })
     .AddTo(this.runningEvents)
     .AddTo(navMeshAgent);
 }