コード例 #1
0
 private void OtherClick(LandProperty land)
 {
     if (Target_ != null && Target_ != land)
     {
         ClickReset();
     }
 }
コード例 #2
0
 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");
         //天剑
     }
 }
コード例 #3
0
        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);
        }
コード例 #4
0
    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;
    }
コード例 #5
0
 void TargetHighReset(LandProperty target)
 {
     if (!target)
     {
         return;
     }
     target.SetMaterial(target.SaveSelfMaterial);
     target.SaveSelfMaterial = null;
 }
コード例 #6
0
 // Use this for initialization
 void Awake()
 {
     foreach (Transform i in this.transform)
     {
         LandProperty j = i.GetComponent <LandProperty> ();
         if (j)
         {
             TuDi.Add(j);
         }
     }
 }
コード例 #7
0
 public void ClickReset()
 {
     //Target_.GetComponent<Highlighter> ().FlashingOff;
     if (Target_ != null)
     {
         TargetHighReset(Target_);
     }
     Target_ = null;
     ShuInfoPanel.gameObject.SetActive(false);
     ClickEvent();
 }
コード例 #8
0
        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;
            }            
        }
コード例 #9
0
        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);
        }
コード例 #10
0
    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);
    }
コード例 #11
0
    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();
    }
コード例 #12
0
 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);
         }
     }
 }
コード例 #13
0
        // [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());
        }
コード例 #14
0
        // [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());
        }
コード例 #15
0
    void MouseClicks()
    {
        if (ConfirmTarget() == null)
        {
            return;
        }
        if (ConfirmTarget() == Target_)
        {
            return;
        }

        OtherClick(ConfirmTarget());
        Target_ = ConfirmTarget();
        TargetSetHighlight(Target_);
        ClickGuoShu(Target_);
        ClickEvent();
    }
コード例 #16
0
    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);
            }
        }
    }
コード例 #17
0
    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);
    }
コード例 #18
0
            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");
            }
コード例 #19
0
    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);
        }
    }
コード例 #20
0
 public void Post(LandProperty landProperty)
 {
     this._landPropertyService.SaveLandProperty(landProperty);
 }