示例#1
0
		public void OnGUI()
		{
			//after recompiling, restart the console
			TryInitialize();
			UserInput.Update();

			if(!Active)
			{
				return;
			}

			//has to be done in OnGUI
			Styles.TryInitialize(false);
			float offset = 0;

			float hDetails = GetHeight(Details, DisplayTitle);
			float hMessages = GetHeight(Messages);
			float hInput = GetHeight(Input);
			float hHints = GetHeight(Hints, DisplayHints);
			float hIssues = GetHeight(Issues, DisplayIssues);

			hMessages = hMessages-hDetails-hInput;

			Rect detailsRect = CreateRect(offset, hDetails);
			offset += hDetails;

			Rect messagesRect = CreateRect(offset, hMessages);
			offset += hMessages;

			Rect inputRect = CreateRect(offset, hInput);
			offset += hInput;

			Rect hintRect = CreateRect(offset, hHints);
			offset += hHints;

			Rect issuesRect = CreateRect(offset, hIssues);
			offset += hIssues;

			if(DisplayTitle)
			{
				Details.Render(detailsRect);
			}

			Console.PrintExecutedCommand = PrintExecutedCommand;

			Messages.Render(messagesRect);
			Input.Render(inputRect);
			if(DisplayHints && hHints > 1)
			{
				Hints.Render(hintRect);
			}
			if(DisplayIssues && hIssues > 1)
			{
				Issues.Render(issuesRect);
			}
		}