public void Connect(string mediatorClassRef, string mediatorName)
    {
        this.mediatorName     = mediatorName;
        this.mediatorClassRef = mediatorClassRef;

        UnityFacade.GetInstance().ConnectMediator(this);
    }
        public override void Execute(Like4LikeManager mgr)
        {
            Login(mgr);

            while (true)
            {
                ReNavigateEarnUrl(mgr);
                var oldWindow = mgr.Driver.WindowHandles.First();

                if (mgr.Driver.Url == mgr.BonusUrl)
                {
                    var bonus = UnityFacade.Resolve <BonusPage>();
                    bonus.OldPage    = this;
                    mgr.CurrentState = bonus;

                    break;
                }

                mgr.Driver.SwitchTo().Window(oldWindow);
                var buttons = new ButtonGetter().Execute(mgr.Driver);

                foreach (var type in GetTypes())
                {
                    var arr = type.Split(new[] { "###" }, StringSplitOptions.RemoveEmptyEntries);
                    ProcessLike(mgr, buttons.Buttons, arr[0], arr[1]);
                }

                mgr.Driver.SwitchTo().Window(oldWindow);
                //mgr.Driver.Navigate().Refresh();
            }
        }
Exemple #3
0
 // Override Singleton Factory method
 public static UnityFacade GetInstance()
 {
     if (m_instance == null)
     {
         m_instance = new UnityFacade();
     }
     return(m_instance as UnityFacade);
 }
Exemple #4
0
 // Use this for initialization
 void Awake()
 {
     Debug.Log("main方法操作没有");
     //启动Facade操作
     UnityFacade.GetInstance().StartUp();
     //net启动
     NetWork.init();
 }
Exemple #5
0
        protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            JobHandle job = new MovementJob
            {
                deltaTime = UnityFacade.getDeltaTime(),
            }.Schedule(this, inputDeps);

            return(job);
        }
Exemple #6
0
        static void Main()
        {
            UnityFacade.Reinit("unity");
            var driver = UnityFacade.Resolve <DriverManager>();

            driver.Init();
            driver.CurrentState = UnityFacade.Resolve <LoginPage>();

            while (true)
            {
                driver.Do();
            }
        }
Exemple #7
0
 private void CheckForNavigate(Like4LikeManager mgr, IWebDriver driver)
 {
     if (driver.FindElements(By.XPath(ElementCheckLoginSuccessXPath)).Count > 0)
     {
         mgr.CurrentState = UnityFacade.Resolve <LogedInPage>();
     }
     else
     if (driver.FindElements(By.XPath(ElementCheckFailedXPath)).Count > 0)
     {
         mgr.CurrentState = UnityFacade.Resolve <EnterCodePage>();
     }
     else
     {
         Thread.Sleep(2000);
         throw new Exception("Unknown page");
     }
 }
 // Use this for initialization
 void Awake()
 {
     UnityFacade.GetInstance().StartUp();
 }
 static UnityFacade()
 {
     m_instance = new UnityFacade();
 }
Exemple #10
0
 static UnityFacade()
 {
     Instance = new UnityFacade();
 }
Exemple #11
0
 // Use this for initialization
 void Awake()
 {
     UnityFacade.GetInstance().StartUp(viewComponents, GetComponent <PhotonManager> ());
 }
Exemple #12
0
 private static void ToFacebookLike(Like4LikeManager mgr)
 {
     mgr.CurrentState = UnityFacade.Resolve <LikeFacebookPage>();//new LikeFacebookPage();
 }
Exemple #13
0
 private static void ToYoutubeLike(Like4LikeManager mgr)
 {
     mgr.CurrentState = UnityFacade.Resolve <LikeYoutubePage>();// new LikeYoutubePage();
 }
 public void Disconnect()
 {
     UnityFacade.GetInstance().DisconnectMediator(mediatorName);
 }
 //
 public void Connect()
 {
     UnityFacade.GetInstance().ConnectMediator(this);
 }