本文整理汇总了C#中UIState类的典型用法代码示例。如果您正苦于以下问题:C# UIState类的具体用法?C# UIState怎么用?C# UIState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UIState类属于命名空间,在下文中一共展示了UIState类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: UI_ShowRows
private void UI_ShowRows(UIState state, int horizScroll)
{
var bufView = state.m_GridView;
if (bufView.IsDisposed)
return;
SuppressCaching = true;
for (int i = 0; i < bufView.Columns.Count; i++)
{
if (bufView.Columns[i].AutoSizeMode == DataGridViewAutoSizeColumnMode.AllCells)
{
bufView.Columns[i].AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
}
}
bufView.RowCount = 0;
if(!MeshView) byteOffset.Enabled = true;
if (state.m_Rows != null)
{
bufView.RowCount = Math.Min(state.m_Rows.Length, MaxRowCount);
if (state.m_Rows.Length > MaxRowCount)
largeBufferWarning.Visible = true;
ScrollToRow(bufView, RowOffset);
SuppressCaching = false;
bufView.HorizontalScrollingOffset = horizScroll;
}
if (vsInBufferView.Focused && m_Core.LogLoaded)
{
debugVertex.Enabled = debugVertexToolItem.Enabled = true;
}
}
开发者ID:Zorro666,项目名称:renderdoc,代码行数:39,代码来源:BufferViewer.cs
示例17: UI_FillRawData
private void UI_FillRawData(UIState state, int horizScroll)
{
var data = state.m_Data;
Input input = state.m_Input;
uint instance = m_MeshDisplay.curInstance;
Thread th = Helpers.NewThread(new ThreadStart(() =>
{
byte[][] d = data.Buffers;
Stream rawStream = new MemoryStream(state.m_RawData);
BinaryWriter rawWriter = new BinaryWriter(rawStream);
uint rownum = 0;
bool finished = false;
var bufferFormats = input.BufferFormats;
var generics = input.GenericValues;
Vec3f[] minBounds = new Vec3f[bufferFormats.Length];
Vec3f[] maxBounds = new Vec3f[bufferFormats.Length];
for (int el = 0; el < bufferFormats.Length; el++)
{
minBounds[el] = new Vec3f(float.MaxValue, float.MaxValue, float.MaxValue);
maxBounds[el] = new Vec3f(-float.MaxValue, -float.MaxValue, -float.MaxValue);
if (bufferFormats[el].format.compCount == 1)
minBounds[el].y = maxBounds[el].y = minBounds[el].z = maxBounds[el].z = 0.0f;
if (bufferFormats[el].format.compCount == 2)
minBounds[el].z = maxBounds[el].z = 0.0f;
}
while (!finished)
{
if (rownum >= data.IndexCount)
{
finished = true;
break;
}
uint index = rownum;
if (data.Indices != null)
{
if (rownum >= data.Indices.Length)
{
index = 0;
}
else
{
index = data.Indices[rownum];
}
}
else if ((input.Drawcall.flags & DrawcallFlags.UseIBuffer) != 0 && state == m_VSIn)
{
// no index buffer, but indexed drawcall
index = 0;
}
int elemsWithData = 0;
for (int el = 0; el < bufferFormats.Length; el++)
{
if (generics != null && generics[el] != null)
{
for(int g=0; g < generics[el].Length; g++)
{
if (generics[el][g] is uint)
rawWriter.Write((uint)generics[el][g]);
else if (generics[el][g] is int)
rawWriter.Write((int)generics[el][g]);
else if (generics[el][g] is float)
rawWriter.Write((float)generics[el][g]);
}
continue;
}
try
{
byte[] bytedata = d[bufferFormats[el].buffer];
Stream strm = state.m_Stream[bufferFormats[el].buffer];
BinaryReader read = state.m_Reader[bufferFormats[el].buffer];
uint instIdx = 0;
// for instancing, need to handle instance rate being 0 (every instance takes index 0 in that case)
if (bufferFormats[el].perinstance)
instIdx = bufferFormats[el].instancerate > 0 ? (instance / (uint)bufferFormats[el].instancerate) : 0;
else
instIdx = index;
uint stride = input.Strides[bufferFormats[el].buffer];
if (data.PostVS.stride != 0)
stride = data.PostVS.stride;
uint offs = stride * instIdx + bufferFormats[el].offset;
bool outofBounds = false;
//.........这里部分代码省略.........
开发者ID:Zorro666,项目名称:renderdoc,代码行数:101,代码来源:BufferViewer.cs
示例18: clickSwitchTraffic
private void clickSwitchTraffic(UIComponent component, UIMouseEventParameter eventParam)
{
if (_uiState != UIState.SwitchTrafficLight)
{
_uiState = UIState.SwitchTrafficLight;
_buttonSwitchTraffic.focusedBgSprite = "ButtonMenuFocused";
TrafficLightTool.SetToolMode(ToolMode.SwitchTrafficLight);
}
else
{
_uiState = UIState.None;
_buttonSwitchTraffic.focusedBgSprite = "ButtonMenu";
TrafficLightTool.SetToolMode(ToolMode.None);
}
}
开发者ID:oczkers,项目名称:Skylines-Traffic-Manager,代码行数:19,代码来源:UITrafficManager.cs
示例19: clickCrosswalk
private void clickCrosswalk(UIComponent component, UIMouseEventParameter eventParam)
{
if (_uiState != UIState.Crosswalk)
{
_uiState = UIState.Crosswalk;
_buttonCrosswalk.focusedBgSprite = "ButtonMenuFocused";
TrafficLightTool.SetToolMode(ToolMode.Crosswalk);
}
else
{
_uiState = UIState.None;
_buttonCrosswalk.focusedBgSprite = "ButtonMenu";
TrafficLightTool.SetToolMode(ToolMode.None);
}
}
开发者ID:oczkers,项目名称:Skylines-Traffic-Manager,代码行数:19,代码来源:UITrafficManager.cs
示例20: clickAddPrioritySigns
private void clickAddPrioritySigns(UIComponent component, UIMouseEventParameter eventParam)
{
if (_uiState != UIState.AddStopSign)
{
_uiState = UIState.AddStopSign;
_buttonPrioritySigns.focusedBgSprite = "ButtonMenuFocused";
TrafficLightTool.SetToolMode(ToolMode.AddPrioritySigns);
}
else
{
_uiState = UIState.None;
_buttonPrioritySigns.focusedBgSprite = "ButtonMenu";
TrafficLightTool.SetToolMode(ToolMode.None);
}
}
开发者ID:oczkers,项目名称:Skylines-Traffic-Manager,代码行数:19,代码来源:UITrafficManager.cs
注:本文中的UIState类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论