void Start() { if (!ENABLED) { return; } GameObject gameObject = GameObject.Find("Game"); _game = gameObject.GetComponent <DonkeyKongGame>(); _capsule = this.transform.Find("Capsule").gameObject; CollisionHelper col = _capsule.GetComponent <CollisionHelper>(); col.OnEnter += OnCollisionHelperEnter; col.OnExit += OnCollisionHelperExit; _collisionHelper = GroundCollider.GetComponent <CollisionHelper>(); _collisionHelper.IgnoreObjects.Add(this.gameObject); _collisionHelper.IgnoreObjects.Add(this.transform.Find("Capsule").gameObject); _collisionHelper.OnEnter += OnGroundCollisionEnter; _collisionHelper.OnExit += OnGroundCollisionExit; _clickHelper = this.transform.gameObject.GetComponent <ClickHelper>(); _clickHelper.OnMouseDown += OnMouseDown; _clickHelper.ClickObjectNames.Add("Hammer"); _clickHelper.ClickObjectNames.Add("HammerHead"); _hands = this.transform.gameObject.GetComponent <VRHands>(); _hands.OnLeftHandGrabbed += OnLeftHandGrabbed; _hands.OnRightHandGrabbed += OnRightHandGrabbed; _climber = this.transform.gameObject.GetComponent <PlayerClimber>(); }
/// Constructs an element at the specified offset. /// May return null if no element should be constructed. public override VisualLineElement ConstructElement(int offset) { var m = FindMatch(offset); // check whether there's a match exactly at offset if (!m.Success || m.Index != 0) { return(null); } if (!File.Exists(ClickHelper.Find(m.Groups[1].Value))) { return(null); } var line = new CustomLinkVisualLineText( new [] { m.Groups[1].Value, m.Groups[2].Value }, CurrentContext.VisualLine, m.Groups[0].Length, ToBrush(EnvironmentColors.ControlLinkTextColorKey), ClickHelper.HandleFileLinkClicked, false, CurrentContext.Document, _textEditor ); if (EnvDteHelper.ViewModel.IsClickedLine(line)) { line.ForegroundBrush = ToBrush(EnvironmentColors.StatusBarNoSolutionColorKey); } return(line); }
private void OnMouseUp(ClickHelper sender, string name, GameObject gameObject) { if (name != "Rung") { return; } IsClimbing = false; }
void Start() { _playerController = this.gameObject.GetComponent <OVRPlayerController>(); _characterController = this.gameObject.GetComponent <CharacterController>(); _hands = this.transform.gameObject.GetComponent <VRHands>(); _hands.OnLeftHandGrabbed += OnLeftHandGrabbed; _hands.OnLeftHandReleased += OnLeftHandReleased; _hands.OnRightHandGrabbed += OnRightHandGrabbed; _hands.OnRightHandReleased += OnRightHandReleased; _clickHelper = this.transform.gameObject.GetComponent <ClickHelper>(); _clickHelper.OnMouseDown += OnMouseDown; _clickHelper.OnMouseDownMove += OnMouseDownMove; _clickHelper.OnMouseUp += OnMouseUp; _clickHelper.ClickObjectNames.Add("Rung"); }
public void OpenPage() { //INavigation page = ObjectRepository.Driver.Navigate().; //page.GoToUrl(ObjectRepository.Config.GetWebsite()); //ObjectRepository.Driver.Navigate().GoToUrl(ObjectRepository.Config.GetWebsite()); NavigationHelper.NavigateToUrl(AppConfigReader.url); ObjectRepository.Driver.Manage().Window.Maximize(); //IWebElement element = ObjectRepository.Driver.FindElement(By.LinkText("Signin")); //element.Click(); ClickHelper.ClickLink(By.LinkText("Signin")); ClickHelper.TypeInTextBox(By.XPath("//div[@id='login']//input[@type='text']"), AppConfigReader.userName); ClickHelper.TypeInTextBox(By.XPath("//div[@id='login']//input[@type='password']"), AppConfigReader.getpasswor); ClickHelper.ClickLink(By.XPath("//div[@id='login']//input[@type='submit' and @value='Submit']")); Thread.Sleep(5000); }
public void SimpleAlert() { Login open = new Login(); open.OpenPage(); ClickHelper.ClickLink(By.XPath("//a[contains(text(), 'Alert')]")); Thread.Sleep(2000); ClickHelper.ClickLink(By.XPath("//a[contains(text(), 'Simple Alert')]")); ObjectRepository.Driver.SwitchTo().Frame(ObjectRepository.Driver.FindElement(By.XPath("//iframe[@src='alert/simple-alert.html']"))); ClickHelper.ClickLink(By.XPath("//button[contains(text(), 'Click the button to display an alert box:')]")); String Msg = ObjectRepository.Driver.SwitchTo().Alert().Text; Assert.AreEqual("I am an alert box!", Msg); if ("I am an alert box!".Equals(Msg)) { ObjectRepository.Driver.SwitchTo().Alert().Accept(); Console.WriteLine("Valid Alert Box: TestCase Passed"); } else { Console.WriteLine("Invalid Alert Box: TestCase Failed"); } }
private void OnMouseDownMove(ClickHelper sender, Vector3 delta) { _mouseMoveDelta = delta; }
private void OnMouseDown(ClickHelper sender, string name, GameObject gameObject) { CheckForGrabbedHammer(gameObject); }
static void Main(string[] args) { ClickHelper.CloseInternetExplorers(); ClickHelper.ClickThroughProcess(); }