当前位置: 首页>>代码示例>>C#>>正文


C# UIState类代码示例

本文整理汇总了C#中UIState的典型用法代码示例。如果您正苦于以下问题:C# UIState类的具体用法?C# UIState怎么用?C# UIState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


UIState类属于命名空间,在下文中一共展示了UIState类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Update

    void Update()
    {
        if(Input.GetButtonDown("Start"))
        {
            // Start will open the menu if in game, or will close any other menu screen and return to game.
            switch((int)state)
            {
                case 0: // Game
                    state = UIState.MENU;
                    GameManager.inst.player.GetComponent<Player>().controlsEnabled = false;
                    break;
                default:
                    state = UIState.GAME;
                    GameManager.inst.player.GetComponent<Player>().controlsEnabled = true;
                    break;
            }
            UpdateUIState();
        }

        goldText.text = "" + GameManager.inst.inventory.gold;
        healthText.text = GameManager.inst.stats.hpCur + "/" + GameManager.inst.stats.hpMax;

        // Will need to move these into a function call when required, rather than every update.
        imgWep1.sprite = GameManager.inst.activeItems.wepSlot1.GetComponent<SpriteRenderer>().sprite;

        if(GameManager.inst.activeItems.wepSlot2)
            imgWep2.sprite = GameManager.inst.activeItems.wepSlot2.GetComponent<SpriteRenderer>().sprite;
    }
开发者ID:Silcoish,项目名称:DungeonCrawlers,代码行数:28,代码来源:UI_Game.cs

示例2: PlanEntry

 public PlanEntry(IUnityContainer container, UIState state, long id)
     : this()
 {
     this.container = new PlanContainer(container, state, id);
     binding = new BindingSource();
     binding.AddingNew += Binding_AddingNew;
 }
开发者ID:swanestle,项目名称:iXY,代码行数:7,代码来源:PlanEntry.cs

示例3: GameUIManager

    public GameUIManager()
    {
          int max = System.Enum.GetNames (typeof(MainUIState)).Length;
		m_UIStates = new UIState[max];
		for (int i = 0; i <max; i++) 
		{
			m_UIStates [i] = new UIState();
		}
        Debug.Log("Count of m_uistates" + m_UIStates.Length);
    }
开发者ID:LeviDahl,项目名称:PopularityContest,代码行数:10,代码来源:GameUIManager.cs

示例4: Awake

 void Awake()
 {
     if (s_instance == null)
     {
         s_instance = this;
     }
     else
     {
         Debug.LogError("Bad singleton with UIState");
     }
 }
开发者ID:euming,项目名称:FotP,代码行数:11,代码来源:UIState.cs

示例5: PlanContainer

 public PlanContainer(IUnityContainer container, UIState state, Plan plan)
     : this(container, state)
 {
     if (state == UIState.New)
     {
         Entity = new Plan();
     }
     else
     {
         this.Entity = plan;
     }
 }
开发者ID:swanestle,项目名称:iXY,代码行数:12,代码来源:PlanContainer.cs

示例6: OnGUI

    void OnGUI()
    {
        if (GUI.Button(new Rect(0, 0, 100, 20), "Create State"))
        {
            UIState newState = new UIState();
            if (m_UIStates.Count == 0) { newState.IsRoot = true; }
            newState.StateName = string.Format ("State {0}", m_UIStates.Count);
            newState.Window = this;
            m_UIStates.Add(newState);
        }

        BeginWindows();
        for (int i = 0; i < m_UIStates.Count; i++)
        {
            m_UIStates[i].StateRect = GUI.Window(i, m_UIStates[i].StateRect,
                                                    m_UIStates[i].DrawState,
                                                    m_UIStates[i].StateName);
        }
        EndWindows();
    }
开发者ID:co-chi-tam,项目名称:The-Dark-Creature,代码行数:20,代码来源:CreateFSM.cs

示例7: ChangeState

 private void ChangeState(UIState state)
 {
     Debug.Log("C#: change state: " + state);
     switch (state) {
     case UIState.Placement:
         mainUIView.enabled = true;
         eventUIView.enabled = false;
         userUIView.enabled = false;
         break;
     case UIState.Event:
         mainUIView.enabled = false;
         eventUIView.enabled = true;
         userUIView.enabled = false;
         break;
     case UIState.User:
         mainUIView.enabled = false;
         eventUIView.enabled = false;
         userUIView.enabled = true;
         break;
     }
     uiState = state;
 }
开发者ID:tejas123,项目名称:tapjoy-implementation-in-unity,代码行数:22,代码来源:TapjoySample.cs

示例8: ChangeUIState

 private void ChangeUIState(UIState state)
 {
     userInterfaceState = state;
     switch (state)
     {
         case UIState.AddState:
             taskTitleTextBox.Text = "";//Clear boxes
             descriptionTextBox.Text = "";
             dateField.Text = "";
             priorityDropBox.Text = "";
             addTaskButton.IsEnabled = true;
             changeTaskButton.IsEnabled = false;
             break;
         case UIState.EditState:
             taskTitleTextBox.Text = "";//Clear boxes
             descriptionTextBox.Text = "";
             dateField.Text = "";
             priorityDropBox.Text = "";
             addTaskButton.IsEnabled = false;
             changeTaskButton.IsEnabled = true;
             break;
     }
 }
开发者ID:shuoppy,项目名称:ToDoList,代码行数:23,代码来源:MainWindow.xaml.cs

示例9: ButtonClicked

    public void ButtonClicked(string buttonState)
    {
        //clearUI();
        switch (buttonState)
        {
            case "Movement":
                History.Push(currentState);
                currentState = UIState.Movement;
                break;
            case "Attack":
                History.Push(currentState);
                currentState = UIState.Attacking;
                break;
            case "Standby": // Standby button is pressed

                // The selected character can no longer act during the turn
                // The next character is then selected

                selectedCharacter.canAct = false;
                FindNextCharacter();
                break;
            case "Back":
                CleanMap();

                currentState = (UIState)History.Pop();
                break;
            case "Hold":
                CleanMap();
                currentState = UIState.Default;
                UIUpdate();
                break;
            default:
                currentState = UIState.Default;
                break;
        }
        UIUpdate();
    }
开发者ID:LunaLovecraft,项目名称:GDD2,代码行数:37,代码来源:UIManager.cs

示例10: ClickLaneRestrictions

        protected virtual void ClickLaneRestrictions(UIComponent component, UIMouseEventParameter eventParam)
        {
            if (_uiState != UIState.LaneRestrictions)
            {
                _uiState = UIState.LaneRestrictions;

                _buttonLaneRestrictions.focusedBgSprite = "ButtonMenuFocused";

                TrafficLightTool.SetToolMode(ToolMode.LaneRestrictions);
            }
            else
            {
                _uiState = UIState.None;

                _buttonLaneRestrictions.focusedBgSprite = "ButtonMenu";

                TrafficLightTool.SetToolMode(ToolMode.None);
            }
        }
开发者ID:oczkers,项目名称:Skylines-Traffic-Manager,代码行数:19,代码来源:UITrafficManager.cs

示例11: SetUIState

 protected void SetUIState(UIState value)
 {
     if (_TheUIState != value)
     {
         _TheUIState = value;
         if (UIStateChanged != null)
             UIStateChanged(this, EventArgs.Empty);
     }
 }
开发者ID:bigfatbrowncat,项目名称:CatEye,代码行数:9,代码来源:ExtendedStage.cs

示例12: MachineEntry

 public MachineEntry(IUnityContainer container, UIState state, Machine entry)
     : this()
 {
     this.container = new MasterEntryContainer<Machine>(container, state, entry);
 }
开发者ID:swanestle,项目名称:iXY,代码行数:5,代码来源:MachineEntry.cs

示例13: bufferView_MouseClick

        private void bufferView_MouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (m_Core.LogLoaded && e.RowIndex >= 0)
            {
                m_ContextUIState = GetUIState(sender);

                if (e.Button == MouseButtons.Right)
                {
                    openFormat.Visible = !MeshView;

                    debugVertex.Visible = MeshView &&
                        m_Core.LogLoaded &&
                        sender == vsInBufferView &&
                        vsInBufferView.SelectedRows.Count == 1;
                    setInstanceToolStripMenuItem.Enabled = (m_Core.CurDrawcall != null && m_Core.CurDrawcall.numInstances > 1);

                    rightclickMenu.Show(Cursor.Position);
                }
            }
        }
开发者ID:Zorro666,项目名称:renderdoc,代码行数:20,代码来源:BufferViewer.cs

示例14: bufferView_ColumnHeaderMouseClick

        private void bufferView_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (m_Core.LogLoaded && MeshView)
            {
                m_ContextUIState = GetUIState(sender);

                if (e.Button == MouseButtons.Right &&
                    m_ContextUIState.m_Input != null &&
                    m_ContextUIState.m_Input.BufferFormats != null)
                {
                    selectColumnAsPositionToolStripMenuItem.Visible = true;
                    selectAlphaAsSecondaryToolStripMenuItem.Visible = true;

                    m_ContextColumn = 0;
                    int colidx = 2; // skip VTX and IDX columns

                    for (int el = 0; el < m_ContextUIState.m_Input.BufferFormats.Length; el++)
                    {
                        for (int i = 0; i < m_ContextUIState.m_Input.BufferFormats[el].format.compCount; i++)
                        {
                            if (colidx == e.ColumnIndex)
                            {
                                m_ContextColumn = el;
                                selectAlphaAsSecondaryToolStripMenuItem.Visible = (m_ContextUIState.m_Input.BufferFormats[el].format.compCount >= 4);
                            }

                            colidx++;
                        }
                    }

                    columnContextMenu.Show(Cursor.Position);
                }
            }
        }
开发者ID:Zorro666,项目名称:renderdoc,代码行数:34,代码来源:BufferViewer.cs

示例15: UpdateHighlightVerts

        private void UpdateHighlightVerts(UIState ui)
        {
            if (ui == null || ui.m_RawData == null) return;
            if (ui.m_GridView.SelectedRows.Count == 0) return;
            if (!MeshView) return;

            if(highlightVerts.Checked)
                m_MeshDisplay.highlightVert = (uint)ui.m_GridView.SelectedRows[0].Index;
            else
                m_MeshDisplay.highlightVert = ~0U;

            render.Invalidate();
        }
开发者ID:Zorro666,项目名称:renderdoc,代码行数:13,代码来源:BufferViewer.cs


注:本文中的UIState类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。