internal async void Loaded(FrameworkElement view)
        {
            // Initialize the dialog manager.
            this.DialogManager.Initialize(view);

            // Start showing dialogs.
            DialogTask dialogTask = null;

            dialogTask = this.ShowSimpleDialog();
            await dialogTask;

            dialogTask = this.ShowMessageInWindow();
            await dialogTask;

            dialogTask = this.ShowMessageInAdornedView();
            await dialogTask;

            dialogTask = this.ShowLongMessageDialog();
            await dialogTask;

            dialogTask = this.ShowLongTitleDialog();
            await dialogTask;

            dialogTask = this.ShowAutoCancelDialog();
            await dialogTask;

            dialogTask = this.ShowCanceledDialog();
            await dialogTask;

            var result = await this.ShowMessageWithContentDialog();

            if (result == DialogResult.Yes)
            {
                dialogTask = await this.ShowComplexDialog();

                await dialogTask;
            }

            dialogTask = this.ShowDisabledButtonDialog();
            await dialogTask;

            dialogTask = this.ShowNestedDialog();
            await dialogTask;

            dialogTask = this.ShowDialogThatNeedsClosePermission();
            await dialogTask;

            dialogTask = this.ShowWarningDialog();
            await dialogTask;

            dialogTask = this.ShowExceptionDialogWithoutException();
            await dialogTask;

            dialogTask = this.ShowSimpleExceptionDialog();
            await dialogTask;

            dialogTask = this.ShowNestedExceptionDialog();
            await dialogTask;

            dialogTask = this.ShowMultipleExceptionsDialog();
            await dialogTask;

            dialogTask = this.ShowContentDialog();
            await dialogTask;

            dialogTask = this.ShowContentWithOwnButton();
            await dialogTask;
        }
Esempio n. 2
0
    void Start()
    {
        #region lấy các liên kết
        dialogTask     = GameObject.Find("DialogTask").GetComponent <DialogTask>();
        newItemPrefabs = (GameObject)Resources.Load("Common/PanelNewItem");
        btnStorage     = transform.FindChild("Btn_Storage").GetComponent <UITexture>();
        starIcon       = transform.FindChild("FrameObject").FindChild("Fr_star").FindChild("icon_star").GetComponent <UITexture>();
        coinIcon       = transform.FindChild("FrameObject").FindChild("Fr_dollar").FindChild("icon_dollar").GetComponent <UITexture>();
        labelsInCommon = transform.FindChild("FrameObject").GetComponentsInChildren <UILabel>();
        clockBar       = transform.FindChild("FrameObject").FindChild("Fr_days").FindChild("thanh_clock").GetComponent <UITexture>();
        starBar        = transform.FindChild("FrameObject").FindChild("Fr_star").FindChild("thanh_star").GetComponent <UITexture>();
        iconWeather    = transform.FindChild("FrameObject").FindChild("Fr_weather").FindChild("icon_weather").GetComponent <UISprite>();
        print(weatherDay);
        iconWeather.spriteName = weatherDay;
        if (weatherDay.Equals("nang") || weatherDay.Equals("mua") || weatherDay.Equals("tuyet"))
        {
            IconWeatherController.setScale(true);
        }
        else
        {
            IconWeatherController.setScale(false);
        }
        spriteProducts  = Resources.LoadAll("Factory/Button/Images/Product");
        spriteMaterials = Resources.LoadAll("Factory/Button/Images/Material");
        #endregion

        #region timeSystem,star
        idDay = 1;
        if (isGuide && VariableSystem.mission == 7)
        {
            idDay = 7;
            //LotteryController.countSpin = 0;
        }
        maxTimeOfMission = MissionData.targetCommon.maxTime;
        if (MissionPowerUp.MoreTime)
        {
            if (maxTimeOfMission % 2 == 0)
            {
                maxTimeOfMission *= 1.5f;
            }
            else
            {
                maxTimeOfMission = maxTimeOfMission * 1.5f + 0.5f;
            }
        }
        targetStar             = MissionData.targetCommon.targetCustomerRate;
        labelsInCommon[0].text = getNameDay(idDay);

        if (VariableSystem.language.Equals("Vietnamese"))
        {
            labelsInCommon[1].text = "Còn lại " + maxTimeOfMission.ToString() + " ngày!";
        }
        else
        {
            labelsInCommon[1].text = (maxTimeOfMission == 1 ? "1 Day " : maxTimeOfMission.ToString() + " Days ") + "to go!";
        }
        currentStar        = 0;
        starBar.fillAmount = 0;
        #endregion

        #region moneySystem,diamond,new items
        dollar = MissionData.targetCommon.startMoney;
        if (MissionData.itemsInNew.Count > 0)
        {
            CallNewItem();
        }
        labelsInCommon[2].text = DString.ConvertToMoneyString(dollar.ToString());
        labelsInCommon[3].text = DString.ConvertToMoneyString(VariableSystem.diamond.ToString());
        #endregion
        CheckItemPowerUp();
        audioControl.PlayMusicInstance("Nhac nen " + (UnityEngine.Random.Range(0, 1250) % 2 + 1).ToString(), true, true, 0.23f);
        if (targetStar == 0)
        {
            targetStar = getMaxCustomer((int)maxTimeOfMission) * 4;
        }
        isPlayHetGio = false;

        //for (int i = 5; i < 36; i++)  getMaxCustomer(i);
    }