Exemplo n.º 1
0
 IEnumerable <Instruction> Restore(float time, Vector3 end)
 {
     yield return(ControlFlow.ConcurrentCall(
                      WaitForSecondsCr(time),
                      MoveTo(end)));
     //anim.SetTrigger("Rest");
 }
Exemplo n.º 2
0
    ///---------------------------------------------------------------------------------------

    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);
    }
Exemplo n.º 3
0
    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));
    }