Esempio n. 1
0
    void StartRecipe(GameObject go)
    {
        //如果没有选择材料,则提示
        foreach (SlotBox slot in SlotList.Values)
        {
            if (slot.slot.Name == null)
            {
                SmallNoticeUI sNotice = gameObject.AddComponent <SmallNoticeUI>();
                sNotice = sNotice.INIT();

                string str = "请放入材料!";
                sNotice.OpenNotice(str, 2f, Plane.transform);
                return;
            }
        }

        btn_startRecipe.gameObject.SetActive(false);

        //下拉属性界面和合成槽
        float targetPos = Screen.height - PropertyListPlane.rect.height * 0.5f;

        LeanTween.moveY(PropertyListPlane.gameObject, targetPos, 0.5f).setEase(LeanTweenType.easeOutQuad);
        targetPos = recipeSlotsList.rect.height * 0.5f;
        LeanTween.moveY(recipeSlotsList.gameObject, targetPos, 0.5f).setEase(LeanTweenType.easeOutQuad);
        LeanTween.scale(recipeSlotsList.gameObject, new Vector3(0.8f, 0.8f, 0.8f), 0.5f).setEase(LeanTweenType.easeOutQuad);

        AddFristPropertyUIEft();
        SetPropertyPlane();
    }
Esempio n. 2
0
    //在加个板上点击确认按钮
    void OkToMove(GameObject go)
    {
        LeanTween.cancel(priceBoard.gameObject);
        LeanTween.scale(priceBoard.gameObject, new Vector3(0, 0, 0), 0.15f).setOnComplete(() =>
        {
            priceBoard.gameObject.SetActive(false);
        });

        //扣除货币如果不足则弹出货币不足提示
        if (!_mapUI.DownMoney(playerPoints.Price, playerPoints.Targetposition, false))
        {
            SmallNoticeUI sNotice = gameObject.AddComponent <SmallNoticeUI>();
            sNotice = sNotice.INIT();
            string str = "金币不足...";
            sNotice.OpenNotice(str, 0.5f, MovePlayer);

            CloseMovePathLine();
            return;
        }

        MovePath();
        ShowPathPoint(playerPoints.Targetpoint);
    }
Esempio n. 3
0
    void CollectAction(GameObject go)
    {
        if (iscanClick)
        {
            //如果次数不足则弹出次数不足提示
            if (!_mapUI.DownMineCount(1, playerPoints.Targetposition, false))
            {
                SmallNoticeUI sNotice = gameObject.AddComponent <SmallNoticeUI>();
                sNotice = sNotice.INIT();
                string str = "采集次数不足...";
                sNotice.OpenNotice(str, 0.5f, MovePlayer);
                return;
            }

            iscanClick = false;
            state      = MoveState.Mining;
            LeanTween.rotateLocal(btn_mine.gameObject, new Vector3(0, 0, 90), 0.25f).setLoopPingPong(2).setOnComplete(() =>
            {
                collectAction.CollectionAction(playerPoints.Targetpoint, playerPoints.Targetposition);
                ChangeCanClick();
                state = MoveState.Stay;
            });
        }
    }
Esempio n. 4
0
    void SetTarget(GameObject go)
    {
        //如果正在移动/采集则跳过
        if (state != MoveState.Stay)
        {
            SmallNoticeUI sNotice = gameObject.AddComponent <SmallNoticeUI>();
            sNotice = sNotice.INIT();
            sNotice.SetMaxNotice(2, MovePlayer);
            sNotice.SetAlignType(SmallNoticeList.Align.UP, MovePlayer);
            sNotice.SetFirstPosition(new Vector3(0, Screen.height / 2 - 50, 0), MovePlayer);

            string str = "移动中...";
            if (state == MoveState.Mining)
            {
                str = "采集中...";
            }

            sNotice.OpenNotice(str, 0.5f, MovePlayer);
            return;
        }

        playerPoints.Targetpoint    = int.Parse(go.name);
        playerPoints.Targetposition = go.GetComponent <RectTransform>();
        pathBox.Clear();
        pathBox.Add("," + playerPoints.Nowpoint.ToString() + ",");
        FindPath(playerPoints.Nowpoint);
        Bestpaths = GetBestPath(pathBox);

        ShowPriceBoard(playerPoints.Targetpoint);

        //获取路径中的点,然后显示出来
        GetMovePathLine();
        ShowMovePathLine();

        //ShowPathPoint(playerPoints.Targetpoint);
    }
Esempio n. 5
0
 // Use this for initialization
 void Start()
 {
     sNotice = new SmallNoticeUI();
     sNotice = sNotice.INIT();
 }