Ejemplo n.º 1
0
    void OnItemClicked(PictruePage_Item item)
    {
        AudioManager.PlaySe("button");
        // 如果是图片分类,则开始新游戏
        //if(!isUncomplete)
        //{
        if (item.data.status != PicturePage_ItemStatus.Locked)
        {
            //UIEngine.Forward<LevelCompletePage>();
            var picId = item.data.picRow.Get <int>("id");
            // GameController.EnterCore(picId);
            var admin = new Admission_PopupNewPage();
            UIEngine.Forward <LevelSettingsPage>(picId.ToString(), admin);
        }
        RadioStation.Brodcast("SELECT_PIC");
        //}

        // 如果是未完成的拼图, 则继续游戏
        // if(isUncomplete)
        // {
        //     var picId = item.data.picRow.Get<int>("id");
        //     var info = PlayerStatus.uncompletePuzzle[picId.ToString()];
        //     GameController.EnterWithInfo(info);
        //     // GameController.EnterCore(picId);
        //     // var admin = new Admission_PopupNewPage();
        //     // UIEngine.Forward<LevelSettingsPage>(picId.ToString(), admin);
        // }
    }
Ejemplo n.º 2
0
    public void OnStartButton()
    {
        if (first)
        {
            return;
        }
        // 检查这个 picId 是否已经有存档,如果有则提示
        var picId = int.Parse(this.param as string);

        var info = PlayerStatus.TryGetUncompleteOfPicId(picId);

        if (info != null)
        {
            var param = new DialogParam();
            param.des    = "会覆盖已存在的游戏,是否继续?";
            param.button = "确定";
            var admin  = new Admission_PopupNewPage();
            var dialog = UIEngine.Forward <DialogPage>(param, admin);
            dialog.Complete = result => {
                if (result == DialogResult.Conform)
                {
                    GameController.EnterCore(picId, selectItem.dataRow.Get <int>("id"));
                }
            };
        }
        else
        {
            GameController.EnterCore(picId, selectItem.dataRow.Get <int>("id"));
        }
        AudioManager.PlaySe("button");
        RadioStation.Brodcast("NEW_GAME");
    }
Ejemplo n.º 3
0
    public void OnGotButton()
    {
        if (PlayerStatus.IsTodaySigned())
        {
            return;
        }
        var day  = PlayerStatus.sign + 1;
        var gold = GetGoldOfDay(day);

        PlayerStatus.gold += gold;
        PlayerStatus.sign += 1;
        SetLastSignDayAsToday();
        PlayerStatus.Save();

        if (selectItem1 != null)
        {
            selectItem1.Flash();
            selectItem1.IsGot = true;
        }
        if (selectItem2 != null)
        {
            selectItem2.Flash();
            selectItem2.IsGot = true;
        }

        button_got.interactable = false;
        var text = button_got.GetComponentInChildren <Text>();

        text.text  = "已领取";
        text.color = new Color(1f, 1f, 1f, 0.7f);
        AudioManager.PlaySe("gain-gold");
        CoroutineManager.Create(WaitAndBack());
        RadioStation.Brodcast("SIGN");
    }
Ejemplo n.º 4
0
    public void OnItemClick(MainPage_Item item)
    {
        AudioManager.PlaySe("button");

        var param = new PicturePageParam();

        param.pageType = item.data.pageType;
        if (item.data.pageType == PicturePageType.Pictype)
        {
            param.picTypeId = item.data.row.Get <string>("id");
        }

        var rt   = item.GetComponent <RectTransform>();
        var rect = RectTransformUtil.GetWorldRect(rt);

        var admission = new Admission_ScaleUpNewPage(rect);

        UIEngine.Forward <PicturePage>(param, admission);

        HeadBarFloating.admission = new Admission_ScaleDownOldPage(rect);

        RadioStation.Brodcast("SELECT_PIC_TYPE");
    }