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


C# IControl.DrawPreStateSelectGUI方法代码示例

本文整理汇总了C#中IControl.DrawPreStateSelectGUI方法的典型用法代码示例。如果您正苦于以下问题:C# IControl.DrawPreStateSelectGUI方法的具体用法?C# IControl.DrawPreStateSelectGUI怎么用?C# IControl.DrawPreStateSelectGUI使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IControl的用法示例。


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

示例1: OnInspectorGUI

	public override void OnInspectorGUI()
	{
		base.OnInspectorGUI();

		isDirty = false;

		control = (IControl)target;

		// Have the specific control class's implementation
		// draw any control-specific settings:
		DrawPrestateSettings();

		GUILayout.BeginVertical();

		//-------------------------------		
		// Draw a nice separator:
		//-------------------------------		
		GUILayout.Space(5.0f);

		GUILayout.BeginVertical("Toolbar");

		GUILayout.BeginHorizontal();
		GUILayout.Space(10.0f);
		GUILayout.Label("State/Element: ");
		GUILayout.FlexibleSpace();

		
		
		// Start keeping track of any changed values:
		BeginMonitorChanges();
		
		// Do the pre-state selection GUI, if any:
		control.DrawPreStateSelectGUI(curState, true);

		EndMonitorChanges();



		// Get the control's state names:
		stateNames = control.EnumStateElements();

		if (stateNames == null)
			return;

		// Cap our state to the number of states available:
		curState = Mathf.Min(curState, stateNames.Length - 1);

		// Choose the state we want to edit:
		curState = EditorGUILayout.Popup(curState, stateNames);

		GUILayout.FlexibleSpace();

		GUILayout.EndHorizontal();
		GUILayout.EndVertical();
		//-------------------------------		
		// End separator
		//-------------------------------		


		// Keep track of any changed values:
		BeginMonitorChanges();

		// Do the post-state selection GUI, if any:
		control.DrawPostStateSelectGUI(curState);

		EndMonitorChanges();


		if (control is IPackableControl)
			ShowSpriteSettings();
		else
			stateInfo = control.GetStateElementInfo(curState);

		transitions = stateInfo.transitions;


		//-----------------------------------------
		// Draw our state label stuff:
		//-----------------------------------------
		if (stateInfo.stateLabel != null)
		{
			BeginMonitorChanges();
			DoStateLabel();
			EndMonitorChanges();
		}


		//-----------------------------------------
		// Draw our transition stuff:
		//-----------------------------------------
		if (transitions != null)
			if (transitions.list != null)
				if (transitions.list.Length > 0)
					DoTransitionStuff();



		GUILayout.Space(10f);

		GUILayout.EndVertical();
//.........这里部分代码省略.........
开发者ID:psaykham,项目名称:ARPandaBox,代码行数:101,代码来源:UICtlInspector.cs


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