本文整理汇总了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;
}
示例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;
}
示例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);
}
示例4: Awake
void Awake()
{
if (s_instance == null)
{
s_instance = this;
}
else
{
Debug.LogError("Bad singleton with UIState");
}
}
示例5: PlanContainer
public PlanContainer(IUnityContainer container, UIState state, Plan plan)
: this(container, state)
{
if (state == UIState.New)
{
Entity = new Plan();
}
else
{
this.Entity = plan;
}
}
示例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();
}
示例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;
}
示例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;
}
}
示例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();
}
示例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);
}
}
示例11: SetUIState
protected void SetUIState(UIState value)
{
if (_TheUIState != value)
{
_TheUIState = value;
if (UIStateChanged != null)
UIStateChanged(this, EventArgs.Empty);
}
}
示例12: MachineEntry
public MachineEntry(IUnityContainer container, UIState state, Machine entry)
: this()
{
this.container = new MasterEntryContainer<Machine>(container, state, entry);
}
示例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);
}
}
}
示例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);
}
}
}
示例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();
}