private void Update() { Vector3 mousePos = cam.ScreenToWorldPoint(Input.mousePosition); mousePos.z = 0f; transform.rotation = Quaternion.Euler(Vector3.forward * CustomLib.AngleFromPos(transform.position, mousePos)); float dist = Vector2.Distance(transform.position, mousePos); if (dist <= 2f) { dist = 0f; } else if (dist >= 10) { dist = Const.MaxAngle; } else { dist = Const.Dist2AngleA * dist + Const.Dist2AngleB; } coeff = 2 * Mathf.PI / (2 * Mathf.PI - dist); // 1-8 angle = 360f - (dist * Mathf.Rad2Deg); if (musicEffect != null) { musicEffect.UpdateShape(angle); } ApplyMusic(angle); }
public void AppointmentCreateOrSelectBooking(string SelectOption, string NewLPNo = null) { if (SelectOption == active) { CustomWait.WaitFortheLoadingIconDisappear5000(); Console.WriteLine(OpenActiveModalTitle.Text); int ActiveRowCount = Drive.driver.FindElements(By.XPath(OpenActiveBookingCount)).Count(); Console.WriteLine(OpenActiveModalTitle.Text + ':' + ActiveRowCount); CustomWait.WaitFortheLoadingIconDisappear3000(); SelectExistBooking.Click(); } else if (SelectOption == New) { CustomWait.WaitFortheLoadingIconDisappear3000(); CloseActiveBooking.Click(); int VehicleRowCount = Drive.driver.FindElements(By.XPath(VehicleTableCount)).Count(); string BeforeVehicle = "((//div[contains(text(),'"; string AfterVehicle = "')])/parent::td[contains(@data-th,'License')])/parent::*/td[@data-th='Actions']"; for (int i = 1; i <= VehicleRowCount; i++) { string ActualRowData = BeforeVehicle + NewLPNo + AfterVehicle; IWebElement FinalVehicleData = Drive.driver.FindElement(By.XPath(ActualRowData)); ((IJavaScriptExecutor)Drive.driver).ExecuteScript("arguments[0].scrollIntoView(true);", FinalVehicleData); CustomWait.WaitFortheLoadingIconDisappear3000(); FinalVehicleData.Click(); CustomWait.WaitFortheLoadingIconDisappear2000(); CustomLib.AlertMessage(); } } }
public void AddModal(string ModalTitle) { if (ModalTitle == "Add Package") { AddPackageOkBtn.Click(); CustomLib.AlertMessage(); } else if (ModalTitle == "Add Service") { AddServiceOkBtn.Click(); CustomLib.AlertMessage(); } else if (ModalTitle == "Add Operation") { AddOperationSaveBtn.Click(); CustomLib.AlertMessage(); } else if (ModalTitle == "Add Material") { AddMaterialOkBtn.Click(); CustomLib.AlertMessage(); } else if (ModalTitle == "Add AOP") { AddAOPOkBtn.Click(); CustomLib.AlertMessage(); } }
public void CheckMechanicBusinessAbsencePageValidations() { CustomLib.Highlightelement(saveMechanicBusinessAbsenceBtn); saveMechanicBusinessAbsenceBtn.Click(); CustomWait.FluentWaitbyXPath("StartDateValidation"); string StartDateValidationText = StartDateValidation.Text; Assert.AreEqual("Start date is required", StartDateValidationText); Console.WriteLine("Start Date Error is :" + StartDateValidationText); CustomWait.FluentWaitbyXPath("EndDateValidation"); string EndDateValidationText = EndDateValidation.Text; Assert.AreEqual("End date is required", EndDateValidationText); Console.WriteLine("End Date Error is :" + EndDateValidationText); CustomWait.FluentWaitbyXPath("DescriptionValidation"); string DescriptionValidationText = DescriptionValidation.Text; Assert.AreEqual("Description is Required", DescriptionValidationText); Console.WriteLine("Description error text is :" + DescriptionValidationText); CustomWait.FluentWaitbyXPath("CancelMechanicBusinessAbsencePage"); ((IJavaScriptExecutor)Drive.driver).ExecuteScript("window.scrollBy(0,200)"); CustomLib.Highlightelement(CancelMechanicBusinessAbsencePage); CancelMechanicBusinessAbsencePage.Click(); }
protected override void Attack(GameObject target) { Look(target.transform.position - transform.position); GameObject newBullet = Instantiate(bullet, CustomLib.MoveInDirection(transform.position, target.transform.position, transform.localScale.x), transform.rotation); newBullet.transform.localScale.Scale(transform.localScale); }
public void clickintoActionBtn() { CustomWait.FluentWaitbyXPath("EditButton"); CustomLib.Highlightelement(EditButton); EditButton.Click(); CustomWait.WaitFortheLoadingIconDisappear2000(); }
public void ClickonLanguage() { CustomWait.WaitFortheLoadingIconDisappear5000(); Drive.driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5); CustomWait.FluentWaitbyXPath("engLanguage"); CustomLib.Highlightelement(EngLanguage); EngLanguage.Clicks(); }
protected override void Attack(GameObject target) { Look(target.transform.position - transform.position); if (fireSpit != null) { Instantiate(fireSpit, CustomLib.MoveInDirection(transform.position, target.transform.position, transform.localScale.x), transform.rotation); } }
/// <summary> /// Select Dealer /// : here we can check the functionality that once we click on /// dealer dropdown and then enter entry on it and select that dealer. /// </summary> /// <param name="DealerName"></param> public void SelectDealer(string RandomNumberofActualDealerNumber, string ActualDealerNumber) { CustomWait.FluentWaitbyXPath("selectDealers"); SelectDealers.Clear(); SelectDealers.SendKeys(RandomNumberofActualDealerNumber); CustomWait.WaitFortheLoadingIconDisappear2000(); CustomLib.DealerDropDown(ActualDealerNumber, MechanicDealerDropDown); }
public void AppointmentSelectDealer(string RandomNumberofActualDealerNumber = null, string ActualDealerNumber = null) { SelectDealers.Clear(); CustomWait.WaitFortheLoadingIconDisappear2000(); SelectDealers.SendKeys(RandomNumberofActualDealerNumber); CustomWait.WaitFortheLoadingIconDisappear2000(); CustomLib.DealerDropDown(ActualDealerNumber, AppointmentDealerDropDown); }
public virtual void GetAway(float dir) // The speaker asks the unit to move away { if (!isOrderedToMove) { isOrderedToMove = true; Vector3 targetPos = CustomLib.MoveInDirection(transform.position, dir, 0.5f); GoThere(targetPos); } }
public void EnterEndDateMechanicLeaveDetails(int index, string selectMonth, string selectYear, string selectdate) { CustomWait.WaitFortheLoadingIconDisappear2000(); EndDate.Click(); CustomWait.WaitFortheLoadingIconDisappear2000(); CustomLib.HandleCalendar(index, selectMonth, selectYear, selectdate); CustomWait.WaitFortheLoadingIconDisappear2000(); saveMechanicLeaveBtn.Click(); CustomWait.WaitFortheLoadingIconDisappear10000(); }
public void EnterPassword(string password) { CustomLib.Highlightelement(TxtPassword); CustomWait.FluentWaitbyXPath("txtPassword"); TxtPassword.SendKeys(password);//Enter Password CustomLib.Highlightelement(SignIn); //Click on LoginBtn CustomWait.FluentWaitbyXPath("signIn"); SignIn.Clicks(); }
private void RefreshTarget() { if (target == null) { GoThere(transform.position); return; } Vector3 targetPosition = CustomLib.MoveInDirection(target.transform.position, transform.position, (target.transform.localScale.x / 2f) + range - 0.1f); GoThere(targetPosition); }
public GetPropertiesObjects StaySignedIN() { CustomLib.Highlightelement(StaySignedIn); CustomWait.FluentWaitbyXPath("staySignedIn"); StaySignedIn.Clicks(); CustomLib.Highlightelement(Yes); CustomWait.FluentWaitbyXPath("yes"); Yes.Clicks(); //Return to the GetProperties return(new GetPropertiesObjects()); }
public void EnterUserName(string userName) { Drive.driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5); //Enter UserName CustomLib.Highlightelement(TxtUserName); CustomWait.FluentWaitbyXPath("txtUserName"); TxtUserName.SendKeys(userName); //Click on LoginBtn CustomLib.Highlightelement(SubmitBtn); CustomWait.FluentWaitbyXPath("submitBtn"); SubmitBtn.Clicks(); }
public void EnterStartDateMechanicLeaveDetails(int index, string selectMonth, string selectYear, string selectdate) { //CustomLib.FluentWaitbyXPath(Drive.driver, "AddMechanicLeaves"); //AddMechanicLeaves.Click(); if (DateRange.Selected) { CustomWait.WaitFortheLoadingIconDisappear2000(); PassComment.SendKeys("Today I am Not feeling Well."); StartDate.Click(); CustomWait.WaitFortheLoadingIconDisappear2000(); CustomLib.HandleCalendar(index, selectMonth, selectYear, selectdate); CustomWait.WaitFortheLoadingIconDisappear5000(); } }
/// <summary> /// Navigate to Mechanics /// :Click on DARS Tab>> Click on Mechanics Tab in Workshop setting /// </summary> public void ClickonDARS() { Drive.driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5); CustomWait.FluentWaitbyXPath("engLanguage"); CustomLib.Highlightelement(engLanguage); engLanguage.Clicks(); //Click on DARS Tab CustomLib.Highlightelement(DARSHighlight); CustomWait.FluentWaitbyXPath("clickonDARS"); clickonDARS.Click(); CustomWait.FluentWaitbyXPath("clickonMechanicsTab"); CustomLib.Highlightelement(clickonMechanicsTab); clickonMechanicsTab.Click(); }
public void UpdateShape(float angle) { List <Vector3> newPositions = new List <Vector3>(); if (angle < 360) { newPositions.Add(transform.position + Vector3.forward * -0.1f); } for (float teta = -angle / 2f; teta < angle / 2f; teta += 10) { newPositions.Add(CustomLib.MoveInDirection(transform.position, (transform.rotation.eulerAngles.z + teta) * Mathf.Deg2Rad, effectSize) + Vector3.forward * -0.1f); } newPositions.Add(CustomLib.MoveInDirection(transform.position, (transform.rotation.eulerAngles.z + angle / 2f) * Mathf.Deg2Rad, effectSize) + Vector3.forward * -0.1f); lineRenderer.positionCount = newPositions.Count; lineRenderer.SetPositions(newPositions.ToArray()); }
public void ApplyMusic(float angle) { currentDebuff = new Ablaze(force * Time.deltaTime * coeff); foreach (GameObject coreling in fieldOfView.seenCorelings) { Demon demon = coreling.GetComponent <Demon>(); if (demon != null) { float angleFromMus = CustomLib.AngleFromPos(transform.position, demon.transform.position) - transform.rotation.eulerAngles.z; if (angleFromMus <= angle / 2f && angleFromMus >= -angle / 2f) { demon.AddDebuff(currentDebuff); } } } }
public void CheckMechanicLeavePageValidations() { CustomLib.Highlightelement(saveMechanicLeaveBtn); saveMechanicLeaveBtn.Click(); CustomWait.FluentWaitbyXPath("StartDateError"); string StartDateErrorText = StartDateError.Text; Assert.AreEqual("Start date is required", StartDateErrorText); Console.WriteLine("Start Date Error is :" + StartDateErrorText); CustomWait.FluentWaitbyXPath("EndDateError"); string EndDateErrorText = EndDateError.Text; Assert.AreEqual("End date is required", EndDateErrorText); Console.WriteLine("End Date Error is :" + EndDateErrorText); CustomWait.FluentWaitbyXPath("CancelMechanicLeavePage"); CustomLib.Highlightelement(CancelMechanicLeavePage); CancelMechanicLeavePage.Click(); }
public void AppointmentType(string value) { ClickAppointmentType.Click(); CustomWait.WaitFortheLoadingIconDisappear3000(); CustomWait.FluentWaitbyXPath("AssertGetType"); CustomLib.DropDownbyName(value, Types); CustomWait.WaitFortheLoadingIconDisappear5000(); if (value == "All") { Console.WriteLine("All Types has been selected"); } else { string TypeInfo = AssertGetType.GetAttribute("title"); Console.WriteLine("First Row Type Name is:" + TypeInfo); Assert.AreEqual(value, TypeInfo); } }
public void ValidateSDCR(string SelectOption) { if (SelectOption == active) { ((IJavaScriptExecutor)Drive.driver).ExecuteScript("arguments[0].scrollIntoView(true);", ActiveSDCR); CustomWait.WaitFortheLoadingIconDisappear2000(); ActiveSDCR.Click(); CustomLib.MultipleAlertMessages(); } else if (SelectOption == New) { ((IJavaScriptExecutor)Drive.driver).ExecuteScript("arguments[0].scrollIntoView(true);", NewSDCR); CustomWait.WaitFortheLoadingIconDisappear2000(); NewSDCR.Click(); CustomWait.WaitFortheLoadingIconDisappear2000(); CustomLib.MultipleAlertMessages(); } }
public void ChangingFixedPrice(string FP, string Code, string Comment = null) { CustomWait.WaitFortheLoadingIconDisappear2000(); ((IJavaScriptExecutor)Drive.driver).ExecuteScript("arguments[0].scrollIntoView(true);", FixedPriceChange); FixedPriceChange.Click(); CustomWait.WaitFortheLoadingIconDisappear2000(); FixedPriceChange.SendKeys(Keys.Control + "A" + Keys.Delete); CustomWait.WaitFortheLoadingIconDisappear2000(); FixedPriceChange.SendKeys(FP); FixedPriceChange.SendKeys(Keys.Enter); CustomWait.WaitFortheLoadingIconDisappear2000(); Console.WriteLine(CauseCodesDeletionTitle.Text); CustomWait.WaitFortheLoadingIconDisappear2000(); CustomLib.DropDownbyName(Code, CodesDropDown); AddCommentInCauseCodeDeletion.SendKeys(Comment); OKCauseComments.Click(); CustomLib.AlertMessage(); CustomWait.WaitFortheLoadingIconDisappear3000(); }
public void GiveCustomerApproval(string DropDownAction, string Comment = null) { WorkOrderTab.Click(); CustomWait.WaitFortheLoadingIconDisappear5000(); ((IJavaScriptExecutor)Drive.driver).ExecuteScript("arguments[0].scrollIntoView(true);", CustomerApprovalCheckBox); CustomerApprovalCheckBox.Click(); CustomWait.WaitFortheLoadingIconDisappear2000(); ((IJavaScriptExecutor)Drive.driver).ExecuteScript("arguments[0].scrollIntoView(true);", Actions); Actions.Click(); CustomWait.WaitFortheLoadingIconDisappear2000(); CustomLib.DropDownbyName(DropDownAction, ActionDropdown); CustomWait.WaitFortheLoadingIconDisappear2000(); Console.WriteLine(ApproveBehalfCustomerTitle.Text); Console.WriteLine(ApproveBehalfCustomerText.Text); ApproveBehalfCustomerInput.SendKeys(Comment); ApproveBehalfCustomerSave.Click(); CustomWait.WaitFortheLoadingIconDisappear3000(); bool ValidateApproval = ApproveBehalfCustomerChecked.Displayed; Console.WriteLine("Approve Behalf of Customer is" + "_" + ValidateApproval); }
public void selectOperationGroup(string selectOperation) { AddOperationGroup.Click(); CustomLib.DropDownbyName(selectOperation, operationgroup); }
public void AddingService(string Service) { CustomLib.DropDownbyName(Service, OtherServices); }
public void AddingPackage(string selectOperation) { AddOperationGroup.Click(); CustomLib.DropDownbyName(selectOperation, operationgroup); selectJobFromTable.Click(); }
public void ExitFromMechanicDetailsPage() { CustomLib.Highlightelement(ExitFromMechanicAdditionalDetailsPage); CustomWait.WaitFortheLoadingIconDisappear2000(); Hardwareworking.Hover(ExitFromMechanicAdditionalDetailsPage); }
private void OnCollisionEnter2D(Collision2D collision) { if (!(collision.collider.CompareTag(gameObject.tag))) // human collides with demon { return; } Unit unit = collision.collider.GetComponent <Unit>(); if (unit == null) // Error { Debug.LogError("An object tagged as " + collision.collider.tag + " misses the unit script : " + collision.collider.name); return; } if (unit.aiPathfinder == null) // Error { Debug.LogError("A unit misses the AIPathfinder component : " + collision.collider.name); return; } float targetDir = CustomLib.AngleFromPos(Vector2.zero, unit.aiPathfinder.direction); float sourceDir = CustomLib.AngleFromPos(Vector2.zero, aiPathfinder.direction); // Get angles from directions and positions float angleTarget; float angleSource; if (unit.aiPathfinder.direction.Equals(Vector2.zero)) { angleTarget = 0f; } else { angleTarget = CustomLib.AngleFromPos(unit.rb.position, rb.position) - targetDir; if (angleTarget <= -180) // Transform angles from 0;360 to -180;180 { angleTarget += 360; } else if (angleTarget > 180) { angleTarget -= 360; } } if (aiPathfinder.direction.Equals(Vector2.zero)) { angleSource = 0f; } else { angleSource = CustomLib.AngleFromPos(rb.position, unit.rb.position) - sourceDir; if (angleSource <= -180) { angleSource += 360; } else if (angleSource > 180) { angleSource -= 360; } } if (Mathf.Abs(angleTarget) > Mathf.Abs(angleSource)) // The unit with the larger angle deal with the collision. The other awaits orders { return; } float angleIntensity = Mathf.Abs(angleSource); float dir = angleSource / angleIntensity; // 1 if left ; -1 if right float newDir = sourceDir - dir * (90f - angleIntensity); GetAway(Mathf.Deg2Rad * newDir); // source unit.GetAway(Mathf.Deg2Rad * (newDir + 180f)); // target }