本文整理汇总了C#中GUIManager.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# GUIManager.Equals方法的具体用法?C# GUIManager.Equals怎么用?C# GUIManager.Equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GUIManager
的用法示例。
在下文中一共展示了GUIManager.Equals方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderGUIObjects
public void RenderGUIObjects(GUIManager gui)
{
//warning, function must be called from onGUI.
if(gui.Equals(null))return;//I require checking the instance to avoid null ref exception errors
GUI.skin.box.normal.background = texture; //applying red texture here for box
showSelection(pointer,6.0f);//Displays a red box over the current selection
//Go thru each GUIObject to render and see if they have been pressed, where appropriate
foreach(KeyValuePair<string,GUIProperties> entry in GUIObjects){
switch(entry.Value.type){
case GUIType.Button:
if(!entry.Value.show) break;
if(GUI.Button(new Rect(entry.Value.rect),entry.Value.name,skin.GetStyle(entry.Value.style))){
OnClick(this,new ButtonName(entry.Key));
}
break;
case GUIType.Label:
GUI.Label(new Rect(entry.Value.rect),entry.Value.name,skin.GetStyle(entry.Value.style));
break;
case GUIType.Toggle:
if(!GUI.Toggle(new Rect(entry.Value.rect),entry.Value.check,entry.Value.name,skin.GetStyle(entry.Value.style)).Equals(entry.Value.check)){
entry.Value.check = !entry.Value.check;
OnToggle(this,new ButtonName(entry.Key,entry.Value.check));
}
break;
case GUIType.Slider:
entry.Value.defaultVal = GUI.HorizontalSlider(new Rect(entry.Value.rect),entry.Value.defaultVal,entry.Value.min,entry.Value.max);
if(GUI.changed) OnScroll(this,new ButtonName(entry.Key,entry.Value.defaultVal));
break;
default:
break;
}
}
}