public static void ConsumeCube(CubeData cube)
    {
        Vector2 _pos;

        if (cube.color == instance.lastCube.color)
        {
            instance.multiplier++;
            _pos = Camera.main.WorldToScreenPoint(cube.objTrans.position);
            MultiplierControl.ShowMultiplier(cube.color, instance.multiplier, _pos);
            AudioControl.PlayFX("multiplier");
        }
        else
        {
            instance.multiplier = 1;
        }
        instance.lastCube = cube;

        instance.points += cube.points * instance.multiplier;
        instance.StartCoroutine(instance.destroyCube(cube));
        ScoreControl.Set(instance.points);
        if ((state == PLAYING) && (SpawnManager.RemainCubes() == 0))
        {
            state = SUCCESS;
            TitleControl.Animate("GOOD JOB!", TitleControl.SUCCESS_ANIM);
            instance.nextUpdate = Time.time + 2;
        }
    }
Exemple #2
0
        private async void btn_Refresh_Click(object sender, RoutedEventArgs e)
        {
            if (this.topViewDS != null)
            {
                TitleControl.DS_OnLoadMoreStarted(0);
                await this.topViewDS.Refresh();

                TitleControl.DS_OnLoadMoreCompleted(0);
            }
        }
        private async void LoadData()
        {
            this.topBloggerDS            = new RecommendBloggerDS();
            this.gv_Bloggers.ItemsSource = this.topBloggerDS.Bloggers;
            TitleControl.DS_OnLoadMoreStarted(0);
            await topBloggerDS.LoadRemoteData();

            TitleControl.DS_OnLoadMoreCompleted(0);
            this.DataContext = this.topBloggerDS.Bloggers;
        }
        private async void btn_Refresh_Click(object sender, RoutedEventArgs e)
        {
            if (sz_CategoryPosts.IsZoomedInViewActive)
            {
                if (this.categoryDS != null)
                {
                    TitleControl.DS_OnLoadMoreStarted(0);
                    await this.categoryDS.Refresh();

                    TitleControl.DS_OnLoadMoreCompleted(0);
                }
            }
        }
Exemple #5
0
 private async void btn_Refresh_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         TitleControl.DS_OnLoadMoreStarted(0);
         await FavoriteCategoryDS.Instance.LoadData();
         await FavoriteAuthorDS.Instance.LoadData();
         await FavoritePostDS.Instance.Refresh();
         TitleControl.DS_OnLoadMoreCompleted(0);
     }
     catch (Exception)
     {
         
     }
 }
Exemple #6
0
        /// <summary>
        /// 加入一个标签页
        /// </summary>
        /// <param name="form">标签页内容Form类型(建议使用白色背景)</param>
        /// <param name="title">标签页标题</param>
        private void addPage(Form form, string title)
        {
            form.FormBorderStyle = FormBorderStyle.None;
            form.TopLevel        = false;
            form.Dock            = DockStyle.Fill;
            var titlePanel = new TitleControl(title);

            titlePanel.Dock = DockStyle.Top;
            var newTabPage = new TabPage();

            newTabPage.Text = title;
            newTabPage.Controls.Add(form);
            newTabPage.Controls.Add(titlePanel);
            this.tabControl.Controls.Add(newTabPage);
            form.Show();
        }
Exemple #7
0
    private void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
        }

        // ゲーム初回起動時に取得する要素
        card             = GetComponent <CardControl>();
        fade             = GetComponent <FadeControl>();
        result           = GetComponent <ResultControl>();
        turnCounter      = GetComponent <TurnCounter>();
        getCardBox       = getCardBoxMainObj.transform.GetChild(0).gameObject;
        getCardBoxButton = getCardBoxMainObj.transform.GetChild(1).GetComponent <Button>();
        title            = GetComponent <TitleControl>();
    }
Exemple #8
0
        protected override void OnStartup(StartupEventArgs e)
        {
            var mainWindow   = new MainWindow();
            var menu         = new Menu();
            var titleControl = new TitleControl();

            var application   = new Core.Application();
            var tCPOperations = new Core.Operations.TCPOperations();

            //1. Создайте менеджер навигации
            var navigationManager  = new NavigationManager(mainWindow.CurrentPage);
            var navigationManager1 = new NavigationManager(menu.fPageMain);

            mainWindowViewModel    = new MainWindowViewModel(navigationManager, application, tCPOperations);
            mainWindow.DataContext = mainWindowViewModel;

            var menuViewModel = new MenuViewModel(navigationManager, application);

            menu.DataContext = menuViewModel;

            titleControlViewModel    = new TitleControlViewModel(navigationManager, application, tCPOperations);
            titleControl.DataContext = titleControlViewModel;


            //2. Определите правила навигации: зарегистрируйте ключ (строку) с соответствующими View и ViewModel для него
            //navigationManager.Register<MainWindow>("MainWindowKey", () => new MainWindowViewModel(navigationManager, application));
            navigationManager1.Register <MainWindow>("MainWindowKey", () => mainWindowViewModel);
            navigationManager.Register("MenuKey", () => new MenuViewModel(navigationManager1, application), () => menu);;
            navigationManager1.Register <TitleControl>("TitleControlKey", () => titleControlViewModel);

            //  GC.Collect();

            //3. Отобразите стартовый UI
            navigationManager.Navigate("MenuKey");

            mainWindow.Show();
        }
Exemple #9
0
        protected void Init()
        {
            TitleControl leftControl = new TitleControl();

            leftControl.SetSizeFlag = true;
            leftControl.Size        = new System.Drawing.Size(222, 448);
            leftControl.Text        = "分类列表";
            leftControl.SetBoder    = true;
            XBaseControl dataControl = new XBaseControl();

            dataControl.MouseClick += new MouseEventHandler(dataControl_MouseClick);
            this.Additem(dataControl);
            dataControl.Size   = new System.Drawing.Size(240, 385);
            leftControl.Pannel = dataControl;
            tab.XTabPages.Add(quicklyInput);
            tab.XTabPages.Add(photoInput);
            photoInput.Visible = false;
            controlCenter.AddRender(tab);
            this.btSave             = new XButton();
            this.btSave.Text        = "插 入";
            this.btSave.Enabled     = false;
            this.btSave.MouseClick += new MouseEventHandler(btSave_MouseClick);
            this.btSave.Size        = new System.Drawing.Size(90, 24);
            controlCenter.AddRender(this.btSave);
            this.cancel             = new XButton();
            this.cancel.Size        = new System.Drawing.Size(90, 24);
            this.cancel.Text        = "关 闭";
            this.cancel.MouseClick += new MouseEventHandler(cancel_MouseClick);
            controlCenter.AddRender(this.cancel);
            controlCenter.Paint += new PaintEventHandler(controlCenter_Paint);
            this.xLayoutPanel1.AddControl(controlCenter, ControlPosition.Center);
            this.xLayoutPanel1.AddControl(leftControl, ControlPosition.Left, 222);
            this.cancel.Location = new Point(320, controlCenter.Bounds.Bottom - 35);
            this.btSave.Location = new Point(220, controlCenter.Bounds.Bottom - 35);
            this.AddInput(this.quicklyInput, this.SelectRender.TeethType);
        }
Exemple #10
0
        private void TvSiteMapNodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            TreeNode selectedNode = e.Node;

            selectedNode.TreeView.SelectedNode = selectedNode;
            var collec = (Dictionary <string, string>)selectedNode.Tag;

            TreeNodeHelper.AddContextMenu(e.Node, this);
            Control existingControl = panelContainer.Controls.Count > 0 ? panelContainer.Controls[0] : null;

            if (existingControl != null)
            {
                panelContainer.Controls.Remove(existingControl);
                existingControl.Dispose();
                GC.Collect();
                GC.WaitForPendingFinalizers();
                GC.Collect();
            }

            switch (selectedNode.Text.Split(' ')[0])
            {
            case "SiteMap":
            {
                var ctrl = new SiteMapControl(collec);
                ctrl.Saved += CtrlSaved;

                panelContainer.Controls.Add(ctrl);
                ctrl.BringToFront();
                if (existingControl != null)
                {
                    panelContainer.Controls.Remove(existingControl);
                }
                tsbItemSave.Visible = true;
            }
            break;

            case "Area":
            {
                if (collec.Count == 0)
                {
                    collec.Add("Id", string.Format("tempId_{0}", DateTime.Now.Ticks));
                }
                var ctrl = new AreaControl(collec, webResourcesImageCache, webResourcesHtmlCache, Service);
                ctrl.Saved += CtrlSaved;

                panelContainer.Controls.Add(ctrl);
                ctrl.BringToFront();
                if (existingControl != null)
                {
                    panelContainer.Controls.Remove(existingControl);
                }
                tsbItemSave.Visible = true;
            }
            break;

            case "SubArea":
            {
                if (collec.Count == 0)
                {
                    collec.Add("Id", string.Format("tempId_{0}", DateTime.Now.Ticks));
                }
                var ctrl = new SubAreaControl(collec, entityCache, webResourcesImageCache, webResourcesHtmlCache,
                                              Service);
                ctrl.Saved += CtrlSaved;

                panelContainer.Controls.Add(ctrl);
                ctrl.BringToFront();
                if (existingControl != null)
                {
                    panelContainer.Controls.Remove(existingControl);
                }
                tsbItemSave.Visible = true;
            }
            break;

            case "Group":
            {
                if (collec.Count == 0)
                {
                    collec.Add("Id", string.Format("tempId_{0}", DateTime.Now.Ticks));
                }
                var ctrl = new GroupControl(collec);
                ctrl.Saved += CtrlSaved;

                panelContainer.Controls.Add(ctrl);
                ctrl.BringToFront();
                if (existingControl != null)
                {
                    panelContainer.Controls.Remove(existingControl);
                }
                tsbItemSave.Visible = true;
            }
            break;

            case "Privilege":
            {
                var ctrl = new PrivilegeControl(collec);
                ctrl.Saved += CtrlSaved;

                panelContainer.Controls.Add(ctrl);
                ctrl.BringToFront();
                if (existingControl != null)
                {
                    panelContainer.Controls.Remove(existingControl);
                }
                tsbItemSave.Visible = true;
            }
            break;

            case "Description":
            {
                var ctrl = new DescriptionControl(collec);
                ctrl.Saved += CtrlSaved;

                panelContainer.Controls.Add(ctrl);
                ctrl.BringToFront();
                if (existingControl != null)
                {
                    panelContainer.Controls.Remove(existingControl);
                }
                tsbItemSave.Visible = true;
            }
            break;

            case "Title":
            {
                var ctrl = new TitleControl(collec);
                ctrl.Saved += CtrlSaved;

                panelContainer.Controls.Add(ctrl);
                ctrl.BringToFront();
                if (existingControl != null)
                {
                    panelContainer.Controls.Remove(existingControl);
                }
                tsbItemSave.Visible = true;
            }
            break;

            default:
            {
                panelContainer.Controls.Clear();
                tsbItemSave.Visible = false;
            }
            break;
            }

            ManageMenuDisplay();
        }
Exemple #11
0
 void Awake()
 {
     control = this;
     //background = transform.FindChild("TitleBackground").GetComponent<Image>().
 }
    void Update()
    {
        switch (state)
        {
        case STANDBY:
            if (Time.time > nextUpdate)
            {
                state = PLAYING;
            }
            break;

        case PLAYING:
            time -= Time.deltaTime;
            if (time <= 0)
            {
                time  = 0;
                state = TIMEOVER;
                TitleControl.Animate("TIME OVER", TitleControl.GAMEOVER_ANIM);
                FaderControl.FadeIn(2);
                nextUpdate = Time.time + 3;
            }
            TimerControl.Set(Mathf.CeilToInt(time));
            break;

        case SUCCESS:
            if (Time.time > nextUpdate)
            {
                nextUpdate = Time.time + (0.002f * time);
                time      -= 1;
                AudioControl.PlayFX("point");
                if (time <= 0)
                {
                    time  = 0;
                    state = GAMEOVER;
                    FaderControl.FadeIn(2);
                    nextUpdate = Time.time + 3;
                    AudioControl.PlayFX("pointend");
                }
                TimerControl.Set(Mathf.CeilToInt(time));
                points++;
                ScoreControl.Set(points);
            }
            break;

        case DIE:
            state = GAMEOVER;
            TitleControl.Animate("GAME OVER", TitleControl.GAMEOVER_ANIM);
            FaderControl.FadeIn(2);
            nextUpdate = Time.time + 3;
            break;

        case TIMEOVER:
        case GAMEOVER:
            if (Time.time > nextUpdate)
            {
                if (points > PlayerPrefs.GetInt(BESTSCORE_KEY, 0))
                {
                    PlayerPrefs.SetInt(BESTSCORE_KEY, points);
                    PlayerPrefs.Save();
                }
                Application.LoadLevel("Menu");
            }
            break;
        }
    }
 void Awake()
 {
     instance = this;
     labels   = GetComponentsInChildren <TextMesh>();
     gameObject.SetActive(false);
 }