private void OtherClick(LandProperty land) { if (Target_ != null && Target_ != land) { ClickReset(); } }
private void ClickGuoShu(LandProperty isLand) { if (isLand.KaiKen_.isKaiken) { StopAllCoroutines(); //BigLock = true; CameraMove.Instance.TargetMove(isLand.transform); // transform.GetChild(0).gameObject.SetActive(true); //for (int i = 0; i < isLand.IsKaiKenLand.transform.childCount; i++) // { // if (isLand.IsKaiKenLand.transform.GetChild(i).CompareTag("jinju")) // { // isLand.IsKaiKenLand.transform.GetChild (i).gameObject.layer = 8; // } // } //if (isLand.IsBoZhong.activeSelf) //{ // for (int i = 0; i < isLand.IsBoZhong.transform.childCount; i++) { // isLand.IsBoZhong.transform.GetChild (i).gameObject.layer = 8; // } //} //StartCoroutine("ClickTargetPlan"); FanHuiPanelUp(isLand); //天剑 Dic GetDic = null; Static.Instance.SaveTuDi.TryGetValue(Static.Instance.GetValue("d_id"), out GetDic); ShowDeadTime.text = GetDic.GetVaule("cf_jinbi"); TodaySY.text = GetDic.GetVaule("cf_jinbi"); //天剑 } }
public async Task <LandProperty> AddLandProperty(LandProperty property) { if (property != null) { property.IsActive = true; IFormFile[] files = new IFormFile[] { property.imageFile1, property.imageFile2, property.imageFile3 }; string[] fileLinks = new string[] { property.ImageLink1, property.ImageLink2, property.ImageLink3 }; for (int i = 0; i < files.Length; i++) { if (files[i] == null) { fileLinks[i] = "#"; } else { fileLinks[i] = GetFileUploadBlobReturnsLink(files[i]); } } property.ImageLink1 = fileLinks[0]; property.ImageLink2 = fileLinks[1]; property.ImageLink3 = fileLinks[2]; _db.LandProperties.Add(property); await _db.SaveChangesAsync(); return(property); } return(null); }
public void CamReset() { StopAllCoroutines(); //Target_.GetComponent<Highlighter> ().FlashingOff; if (Target_ != null) { // transform.GetChild(0).gameObject.SetActive(false); //for (int i = 0; i < Target_.IsKaiKenLand.transform.childCount; i++) // { // if (Target_.IsKaiKenLand.transform.GetChild(i).CompareTag("jinju")) // { // Target_.IsKaiKenLand.transform.GetChild(i).gameObject.layer = 9; // } // } //if (Target_.IsBoZhong.activeSelf) //{ // for (int i = 0; i < Target_.IsBoZhong.transform.childCount; i++) { // Target_.IsBoZhong.transform.GetChild (i).gameObject.layer = 9; // } //} TargetHighReset(Target_); } Target_ = null; //StartCoroutine("ClickTargetPlanReset"); CameraMove.Instance.CameraReset(); ClickEvent(); BigLock = false; }
void TargetHighReset(LandProperty target) { if (!target) { return; } target.SetMaterial(target.SaveSelfMaterial); target.SaveSelfMaterial = null; }
// Use this for initialization void Awake() { foreach (Transform i in this.transform) { LandProperty j = i.GetComponent <LandProperty> (); if (j) { TuDi.Add(j); } } }
public void ClickReset() { //Target_.GetComponent<Highlighter> ().FlashingOff; if (Target_ != null) { TargetHighReset(Target_); } Target_ = null; ShuInfoPanel.gameObject.SetActive(false); ClickEvent(); }
public void AddOrUpdate(UpdateLandPropertyInput input) { var config = new ConfigurationStore(new TypeMapFactory(), AutoMapper.Mappers.MapperRegistry.Mappers); var mapper = new MappingEngine(config); config.CreateMap<LandPropertyDto, LandProperty>().ConstructUsing(model => { if (model.Id == 0) { LandProperty toAdd = new LandProperty(); _landPropertyRepository.InsertAsync(toAdd); return toAdd; } else { return _landPropertyRepository.Get(model.Id); } }); config.CreateMap<LandPropertyOwnerDto, Owner>().ConstructUsing(model => { return _ownerRepository.Get(model.Id); }); config.CreateMap<MortgageDto, Mortgage>().ConstructUsing(model => { if (model.MortgageIdentifier > 0 && model.Id == 0) { Mortgage toAdd = new Mortgage(); _mortgageRepository.Insert(toAdd); return toAdd; } else if (model.Id > 0) { return _mortgageRepository.Get(model.Id); } else { return null; } }).ForMember(x => x.LandProperty, o => o.Ignore()); try { mapper.Map<LandPropertyDto, LandProperty>(input.LandPropToUpdate); } catch (Exception e) { throw e; } }
public async Task <LandProperty> EditLandProperty(int id, LandProperty property) { LandProperty landProperty = null; landProperty = _db.LandProperties.AsNoTracking().FirstOrDefault(m => m.Id == id); landProperty = property; landProperty.Id = id; _db.LandProperties.Update(landProperty); await _db.SaveChangesAsync(); return(landProperty); }
void TargetSetHighlight(LandProperty target) { if (!target) { return; } Material highligh = new Material(Shader.Find("Custom/OutLine2")); highligh.SetColor("_TintColor", HexToColor("FF7C7C00")); highligh.mainTexture = target.SelfMaterial_.mainTexture; target.SetMaterial(highligh); target.GetComponent <LandJump>().ClickUp(); Instantiate(ClickSound.gameObject); }
IEnumerator KaiKenAction(LandProperty land) { Shovel.transform.position = land.transform.position; //Shovel.gameObject.SetActive(true); Debug.Log("准备开垦"); //yield return new WaitForSeconds(2); yield return(null); land.KaiKen_.isKaiken = true; //Shovel.gameObject.SetActive(false); Instantiate(SoundObj); land.TuDiKaiKen(true); Static.Instance.UpdateAllObj(); }
public void KaiKen() { if (ModleClick.Instance.Target_ != null) { LandProperty land = ModleClick.Instance.Target_; if (!land.KaiKen_.isKaiken) { Debug.Log("准备开垦" + land.gameObject.name); StartCoroutine(KaiKenAction(land)); } else { Debug.Log("开垦过了" + land.gameObject.name); } } }
// [RequestFormLimits(MultipartBodyLengthLimit = long.MaxValue)] public async Task <IActionResult> AddLandProperty([FromForm] LandProperty property) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var result = await _manager.AddLandProperty(property); if (result != null) { return(Ok(result)); } return(BadRequest()); }
// [RequestFormLimits(MultipartBodyLengthLimit = long.MaxValue)] public async Task <IActionResult> EditLandProperty([FromRoute] int id, [FromBody] LandProperty property) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var result = await _manager.EditLandProperty(id, property); if (result != null) { return(Ok(result)); } return(BadRequest()); }
void MouseClicks() { if (ConfirmTarget() == null) { return; } if (ConfirmTarget() == Target_) { return; } OtherClick(ConfirmTarget()); Target_ = ConfirmTarget(); TargetSetHighlight(Target_); ClickGuoShu(Target_); ClickEvent(); }
public void BoZhong(GameObject message) { if (ModleClick.Instance.Target_ != null) { LandProperty land = ModleClick.Instance.Target_; if (!land.KaiKen_.isKaiken) { Debug.Log("土地还未开垦,请先开垦土地"); return; } if (message && !message.activeSelf) { message.SetActive(true); } } }
private void FanHuiPanelUp(LandProperty isLand) { ShuInfoPanel.gameObject.SetActive(true); ShuInfoPanel.transform.position = Camera.main.WorldToScreenPoint(isLand.transform.position); return; TopPanel.SetBool("Up", false); TopPanel.SetBool("Down", true); LeftPanel.SetBool("Up", false); LeftPanel.SetBool("Down", true); GuoShuPanel.SetBool("Up", true); GuoShuPanel.SetBool("Down", false); FanHuiPanel.SetBool("Up", true); FanHuiPanel.SetBool("Down", false); ShuInfoPanel.SetBool("Up", true); ShuInfoPanel.SetBool("Down", false); }
public async Task <Unit> Handle(Command request, CancellationToken cancellationToken) { var property = new LandProperty { Id = request.Id, Title = request.Title, StreatAddress1 = request.StreatAddress1, Suburb = request.Suburb, City = request.City }; _context.LandProperties.Add(property); var success = await _context.SaveChangesAsync() > 0; if (success) { return(Unit.Value); } throw new Exception("Problem saving changes"); }
LandProperty ConfirmTarget() { #if UNITY_EDITOR if (EventSystem.current.IsPointerOverGameObject() == true) { return(null); } #elif UNITY_IPHONE || UNITY_ANDROID if (Input.touchCount != 1) { return(null); } if (Input.touchCount == 1) { if (EventSystem.current.IsPointerOverGameObject(Input.GetTouch(0).fingerId)) { return(null); } } #endif #if UNITY_EDITOR Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); //从摄像机发出到点击坐标的射线 #elif UNITY_IPHONE || UNITY_ANDROID Ray ray = Camera.main.ScreenPointToRay(Input.GetTouch(0).position); //从摄像机发出到点击坐标的射线 #endif RaycastHit hitInfo; LayerMask mask = 1 << LayerMask.NameToLayer("TuDi"); if (Physics.Raycast(ray, out hitInfo, 100000f, mask.value)) { #if UNITY_EDITOR #elif UNITY_IPHONE || UNITY_ANDROID if (Input.GetTouch(0).phase == TouchPhase.Moved) { MovingTime += Time.deltaTime; if (MovingTime > 0.1f) { BenginTarget = null; EndTarget = null; } return(null); } #endif #if UNITY_EDITOR if (Input.GetMouseButtonDown(0)) #elif UNITY_IPHONE || UNITY_ANDROID if (Input.GetTouch(0).phase == TouchPhase.Began) #endif { EndTarget = null; MovingTime = 0; if (hitInfo.collider.gameObject.CompareTag("baoxiang")) { Baoxiang.Invoke(); } if (hitInfo.collider.gameObject.CompareTag("jinju")) { LandProperty hitobj = ChoseParent(hitInfo.collider.gameObject); BenginTarget = hitobj; } else { BenginTarget = null; } } #if UNITY_EDITOR if (Input.GetMouseButtonUp(0)) #elif UNITY_IPHONE || UNITY_ANDROID if (Input.GetTouch(0).phase == TouchPhase.Ended) #endif { if (hitInfo.collider.gameObject.CompareTag("jinju")) { LandProperty hitobj = ChoseParent(hitInfo.collider.gameObject); EndTarget = hitobj; } else { EndTarget = null; } } } else { EndTarget = null; BenginTarget = null; #if UNITY_EDITOR if (Input.GetMouseButtonDown(0)) #elif UNITY_IPHONE || UNITY_ANDROID if ((Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began)) #endif { #if UNITY_EDITOR if (!EventSystem.current.IsPointerOverGameObject() == true) #elif UNITY_IPHONE || UNITY_ANDROID if (!EventSystem.current.IsPointerOverGameObject(Input.GetTouch(0).fingerId)) #endif { Action.ResetAction(); ClickReset(); } } return(null); } if (BenginTarget == EndTarget && (BenginTarget != null && EndTarget != null)) { return(EndTarget); } else { #if UNITY_EDITOR if (Input.GetMouseButtonDown(0)) #elif UNITY_IPHONE || UNITY_ANDROID if ((Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began)) #endif { #if UNITY_EDITOR if (!EventSystem.current.IsPointerOverGameObject() == true) #elif UNITY_IPHONE || UNITY_ANDROID if (!EventSystem.current.IsPointerOverGameObject(Input.GetTouch(0).fingerId)) #endif { ClickReset(); } } return(null); } }
public void Post(LandProperty landProperty) { this._landPropertyService.SaveLandProperty(landProperty); }