Beispiel #1
0
    public void MoveToCurrentDeckPos(GameObject centeredObject)
    {
        centerOnChild.onCenter -= MoveToCurrentDeckPos;

        SpringPanel.Stop(scrollView.gameObject);
        centerOnChild.CenterOn(curSelectedMainSlot.transform);
    }
Beispiel #2
0
        public void OnClickLand(PlowLandFrame land)
        {
            if (land == null)
            {
                return;
            }
            land.OnClickLand();
            if (mTouchingFarmLand != null)
            {
                //mTouchingFarmLand = null;
                return;
            }
            MatureTimeBg.gameObject.SetActive(false);
            if (mMatureTimer != null)
            {
                StopCoroutine(mMatureTimer);
                mMatureTimer = null;
            }
            mMatureScend = 0;
            if (land.DataModel.State == (int)LandState.Lock)
            {
                //这块土地还未开垦,请提升农场等级!
                var e1 = new ShowUIHintBoard(300302);
                EventDispatcher.Instance.DispatchEvent(e1);
                return;
            }
            var parent = UIManager.GetInstance().GetUIRoot(UIType.TYPE_TIP);
            var loc    = parent.transform.worldToLocalMatrix * land.LockSprite.worldCenter;

            loc.x -= 100;
            loc.y += 70;
            loc.z  = -300;
            LandMenu.transform.localPosition  = loc;
            LandMenu.transform.localPosition += new Vector3(-80, 0, 0);
            SpringPanel.Stop(MenuObject.gameObject);
            ResetScrollViewPostion();
            EventDispatcher.Instance.DispatchEvent(new FarmLandCellClick(land.DataModel.Index, false));
            mTouchingFarmLand = land;
            DragState         = LandDragState.Invalid;
        }