private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
Esempio n. 2
0
        public override void Execute()
        {
            StartStep();

            bool hasFailure = false;
            CL.IEX.Wait(15);

            MilestonesManager test = new MilestonesManager(@"Health Check Input\ExpectedMilestonesPerState.txt");
            NavigationsManager navigations = new NavigationsManager(@"Health Check Input\Navigations.txt");
            OutputManager outPut = new OutputManager(CL);

            Navigation currentNavigation = navigations.GetNextNavigation();
            while (currentNavigation != null)
            {
                outPut.StartNavigation(currentNavigation.GetFullPath());

                string nextDest = currentNavigation.GetNextState();
                while (nextDest != null)
                {

                    outPut.StartDestination(test.GetStateByName(nextDest));
                    MilestonesChecker.Start(test.GetStateByName(nextDest), CL);
                    try
                    {
                        res = CL.IEX.MilestonesEPG.Navigate(nextDest.Replace("amp;", ""));//"PIN & PARENTAL CONTROL");
                    }
                    catch (Exception)
                    {

                    }
                    List<KeyValuePair<string, string>> msError = MilestonesChecker.Finish(test.GetStateByName(nextDest), CL);
                    if (msError.Count > 0)
                    {
                        hasFailure = true;

                        if (!res.CommandSucceeded)
                        {
                            msError.Add(new KeyValuePair<string, string>("Navigation Error: ", res.FailureReason));
                        }
                        outPut.DestinationFail(msError);
                        break;
                    }
                    nextDest = currentNavigation.GetNextState();
                }

                outPut.FinishNavigation();
                
                //return to root 
                res = CL.IEX.MilestonesEPG.Navigate("MAIN MENU");
                if (!res.CommandSucceeded)
                {
                    FailStep(CL,"Box is Dead !! :-( ");
                }
                CL.IEX.Wait(15);

                currentNavigation = navigations.GetNextNavigation();
            }
            outPut.WriteSummary();

            if (hasFailure)
            {
              //  FailStep(CL,"Some navigation(s) failed");
            }
            PassStep();
        }
 void Awake()
 {
     database   = GameObject.FindGameObjectWithTag("Database").GetComponent <Database>();
     milestones = GameObject.FindGameObjectWithTag("Milestone").GetComponent <MilestonesManager>();
 }