Ejemplo n.º 1
0
        //This is not controlled by smh.cT because its scope is the entire segment over which the challenge executes,
        //not just the boss phase. In the case of BPoHC stage events, this scope is the phase cT of the stage section.
        private IEnumerator TrackChallenges(IChallengeRequest cr, Action <InstanceRecord> onSuccess)
        {
            while (Exec == null)
            {
                yield return(null);
            }
            var challenges = cr.Challenges;
            var ctx        = new TrackingContext(Exec, this, onSuccess);

            for (; completion == null; ctx.t += ETime.FRAME_TIME)
            {
                for (int ii = 0; ii < challenges.Length; ++ii)
                {
                    if (!challenges[ii].FrameCheck(ctx))
                    {
                        ChallengeFailed(cr, ctx);
                        yield break;
                    }
                }
                yield return(null);
            }
            for (int ii = 0; ii < challenges.Length; ++ii)
            {
                if (!challenges[ii].EndCheck(ctx, completion.Value))
                {
                    ChallengeFailed(cr, ctx);
                    yield break;
                }
            }
            ChallengeSuccess(cr, ctx);
        }
Ejemplo n.º 2
0
 private void ChallengeSuccess(IChallengeRequest cr, TrackingContext ctx)
 {
     if (cr.OnSuccess(ctx))
     {
         CleanupState();
     }
 }
Ejemplo n.º 3
0
 public void TrackChallenge(IChallengeRequest cr, Action <InstanceRecord> onSuccess)
 {
     Log.Unity($"Tracking challenge {cr.Description}");
     CleanupState();
     tracking    = cr;
     Restriction = new Restrictions(cr.Challenges);
     challengePhotos.Clear();
     cr.Initialize();
     RunDroppableRIEnumerator(TrackChallenges(cr, onSuccess));
 }
Ejemplo n.º 4
0
 private void ChallengeFailed(IChallengeRequest cr, TrackingContext ctx)
 {
     cr.OnFail(ctx);
     CleanupState();
 }