IEnumerable <Instruction> Restore(float time, Vector3 end) { yield return(ControlFlow.ConcurrentCall( WaitForSecondsCr(time), MoveTo(end))); //anim.SetTrigger("Rest"); }
///--------------------------------------------------------------------------------------- IEnumerable <Instruction> TestConcurrent() { // Do some stuff Debug.Log("Beginning test 2, frame #" + Time.frameCount); yield return(ControlFlow.ConcurrentCall(TestConcurrentPart1(), TestConcurrentPart2())); Debug.Log("Finishing test 2 frame #" + Time.frameCount); }
IEnumerable <Instruction <bool> > ShouldFireProjectiles(Transform target, float initialAngle) { System.Func <IEnumerable <float>, float> ScoreArbitration = (scores) => { return(scores.Min()); }; System.Func <float, bool> ScoreThreshold = (combinedScore) => { return(combinedScore > 0.5f); }; yield return(Utils.Adapt( ControlFlow.ConcurrentCall( ScoreArbitration, ScoreDistance(target), ScoreAngle(initialAngle, target)), ScoreThreshold)); }