Example #1
0
	IEnumerator Start()
	{
		gui = UniRPGGlobal.DB.gameGUIData.GetComponent<DefaultGameGUIData>();
		gui.InitSkin();

		fadeTex = new Texture2D(2, 2, TextureFormat.ARGB32, false);
		fadeTex.SetPixel(0, 0, Color.white);
		fadeTex.SetPixel(1, 0, Color.white);
		fadeTex.SetPixel(0, 1, Color.white);
		fadeTex.SetPixel(1, 1, Color.white);
		fadeTex.Apply();

		UniRPGGlobal.RegisterLoadGameSceneListener(OnLoadingScene);

		// load the input bindings related to this gui theme
		// it is loading the shortcuts to open the various
		// windows like bag, skills window, etc
		InputManager.Instance.LoadInputFromBinder(new DefaultGUIInputBinder(), OnKeybindOrderChanged);

		// wait a frame before doing the following
		yield return null;

		UniRPGGUI.CalcGUIScale(gui.width, gui.height);

		actionSlotCount = gui.actionSlotsCount;
		gui.trActionBar.size = new Vector2(actionSlotCount * gui.actionIconWidth + actionSlotCount, gui.actionIconWidth);
		r[0] = GUIElementTransform.CalcRect(gui.width, gui.height, gui.trActionBar);

		r[1] = GUIElementTransform.CalcRect(gui.width, gui.height, gui.trRightPanel);
		r[2] = GUIElementTransform.CalcRect(gui.width, gui.height, gui.trLeftPanel);

		menuBarItems = 0;
		for (int i = 0; i < gui.menuOptions.Count; i++) if (gui.menuOptions[i].active) menuBarItems++;
		if (menuBarItems > 0)
		{
			gui.trMenuBar.size = new Vector2(gui.menuIconWidth * menuBarItems + menuBarItems, gui.menuIconWidth);
			r[3] = GUIElementTransform.CalcRect(gui.width, gui.height, gui.trMenuBar);
		}

		r[4] = r[3];
		r[4].y += r[3].height + 5;

		menuOptionsContent = new GUIContent[gui.menuOptions.Count];
		for (int i = 0; i < gui.menuOptions.Count; i++)
		{
			menuOptionsContent[i] = new GUIContent(gui.menuOptions[i].icon, gui.menuOptions[i].name);
		}

		r[6] = GUIElementTransform.CalcRect(gui.width, gui.height, gui.trLeftWidePanel);

		r[8] = new Rect(gui.width / 2 - 130, gui.height / 2 - 250, 260, 300);

		if (gui.showPlayerStatus)
		{
			r[10] = new Rect(0, 5, gui.statusPortraitWidth, gui.statusPortraitWidth);
			r[9] = new Rect(gui.statusPortraitWidth, 5, 0, 0);

			// init the player bars' attrib vars
			for (int i = 0; i < gui.playerStatusBars.Count; i++)
			{
				gui.playerStatusBars[i].attrib = UniRPGGlobal.Player.Actor.ActorClass.GetAttribute(gui.playerStatusBars[i].attribId);
			}
		}

		//if (gui.showTargetStatus)
		//{
			r[12] = new Rect(gui.width - gui.statusPortraitWidth - gui.statusBarWidth, 5, gui.statusPortraitWidth, gui.statusPortraitWidth);
			r[11] = new Rect(gui.width - gui.statusBarWidth, 5, 0 ,0);
		//}

		r[13] = new Rect(gui.width / 2 - 110, gui.height / 2 - 65, 220, 130);

		// create button click audio source if needed
		if (gui.sfxButton)
		{
			sfxButton = gameObject.AddComponent<AudioSource>();
			sfxButton.clip = gui.sfxButton;
			sfxButton.volume = UniRPGGlobal.DB.guiAudioVolume;
			sfxButton.playOnAwake = false;
			sfxButton.bypassEffects = true;
			sfxButton.bypassReverbZones = true;
			sfxButton.bypassListenerEffects = true;
			sfxButton.loop = false;
		}

		// ready
		state = State.Running;
	}
Example #2
0
	private void DrawMisc(DefaultGameGUIData gameData)
	{
		GUILayout.Space(15);
		GUILayout.Label("Misc Settings", UniRPGEdGui.Head2Style);
		EditorGUILayout.BeginHorizontal();

		EditorGUILayout.BeginVertical();
		{
			EditorGUILayout.BeginVertical(UniRPGEdGui.BoxStyle, GUILayout.Width(300));
			{
				gameData.sfxButton = (AudioClip)EditorGUILayout.ObjectField("Button sound", gameData.sfxButton, typeof(AudioClip), false);
				EditorGUILayout.Space();
				gameData.txEmptySlot = (Texture2D)EditorGUILayout.ObjectField("Empty Slot Icon", gameData.txEmptySlot, typeof(Texture2D), false);
			}
			EditorGUILayout.EndVertical();
			EditorGUILayout.BeginVertical(UniRPGEdGui.BoxStyle, GUILayout.Width(300));
			{
				GUILayout.Label("Character Panel", UniRPGEdGui.Head4Style);
				gameData.charaPanelName = EditorGUILayout.TextField("Name", gameData.charaPanelName);
				gameData.charaPanelShowLevel = EditorGUILayout.Toggle("Show Level", gameData.charaPanelShowLevel);
			}
			EditorGUILayout.EndVertical();
			EditorGUILayout.BeginVertical(UniRPGEdGui.BoxStyle, GUILayout.Width(300));
			{
				GUILayout.Label("Skill Panel", UniRPGEdGui.Head4Style);
				gameData.skillPanelName = EditorGUILayout.TextField("Name", gameData.skillPanelName);
			}
			EditorGUILayout.EndVertical();
			EditorGUILayout.BeginVertical(UniRPGEdGui.BoxStyle, GUILayout.Width(300));
			{
				GUILayout.Label("Bag Panel", UniRPGEdGui.Head4Style);
				gameData.bagPanelName = EditorGUILayout.TextField("Name", gameData.bagPanelName);
			}
			EditorGUILayout.EndVertical();
			EditorGUILayout.BeginVertical(UniRPGEdGui.BoxStyle, GUILayout.Width(300));
			{
				GUILayout.Label("Journal/ Quest Log Panel", UniRPGEdGui.Head4Style);
				gameData.logPanelName = EditorGUILayout.TextField("Name", gameData.logPanelName);
				gameData.txQuestComplete[0] = (Texture2D)EditorGUILayout.ObjectField("Quest Incomplete", gameData.txQuestComplete[0], typeof(Texture2D), false);
				gameData.txQuestComplete[1] = (Texture2D)EditorGUILayout.ObjectField("Quest Complete", gameData.txQuestComplete[1], typeof(Texture2D), false);
			}
			EditorGUILayout.EndVertical();
		}
		EditorGUILayout.EndVertical();
		EditorGUILayout.BeginVertical();
		{
			EditorGUILayout.BeginVertical(UniRPGEdGui.BoxStyle, GUILayout.Width(300));
			{
				GUILayout.Label("Player can still move while\nthese panels are open...\n", UniRPGEdGui.Head4Style);
				gameData.plrMoveCharSheet = EditorGUILayout.Toggle("Character Sheet", gameData.plrMoveCharSheet);
				gameData.plrMoveSkills = EditorGUILayout.Toggle("Skills", gameData.plrMoveSkills);
				gameData.plrMoveBag = EditorGUILayout.Toggle("Inventory (Bag)", gameData.plrMoveBag);
				gameData.plrMoveDialogue = EditorGUILayout.Toggle("Dialogue/Conversation", gameData.plrMoveDialogue);
				gameData.plrMoveJournal = EditorGUILayout.Toggle("Journal", gameData.plrMoveJournal);
				gameData.plrMoveShop = EditorGUILayout.Toggle("Shop", gameData.plrMoveShop);
			}
			EditorGUILayout.EndVertical();
		}
		EditorGUILayout.EndVertical();

		GUILayout.FlexibleSpace();
		EditorGUILayout.EndHorizontal();
	}
Example #3
0
	private void DrawStatusPanels(DefaultGameGUIData gameData)
	{
		GUILayout.Space(15);
		GUILayout.Label("Status Panels", UniRPGEdGui.Head2Style);

		EditorGUILayout.BeginHorizontal();
		{
			EditorGUILayout.BeginVertical();
			{
				EditorGUILayout.BeginVertical(UniRPGEdGui.BoxStyle, GUILayout.Width(300));
				{
					UniRPGEdGui.LookLikeControls(130);
					GUILayout.Label("Player", UniRPGEdGui.Head4Style);
					gameData.showPlayerStatus = EditorGUILayout.Toggle("Show Player Status", gameData.showPlayerStatus);
					if (gameData.showPlayerStatus)
					{
						EditorGUILayout.BeginHorizontal();
						{
							gameData.showPlayerPortrait = EditorGUILayout.Toggle("Show Portrait", gameData.showPlayerPortrait);
							EditorGUILayout.Space();
							if (gameData.showPlayerPortrait)
							{
								UniRPGEdGui.LookLikeControls(80);
								gameData.showPlayerLevel = EditorGUILayout.Toggle("Show Level", gameData.showPlayerLevel);
							}
							GUILayout.FlexibleSpace();
						}
						EditorGUILayout.EndHorizontal();
						UniRPGEdGui.LookLikeControls();
						EditorGUILayout.Space();
						EditorGUILayout.BeginHorizontal();
						{
							GUILayout.Label("Show value: ");
							if (GUILayout.Toggle(gameData.playerStatusShowValue == 0, " No")) gameData.playerStatusShowValue = 0;
							if (GUILayout.Toggle(gameData.playerStatusShowValue == 1, " Number")) gameData.playerStatusShowValue = 1;
							if (GUILayout.Toggle(gameData.playerStatusShowValue == 2, " Percentage")) gameData.playerStatusShowValue = 2;
						}
						EditorGUILayout.EndHorizontal();
						EditorGUILayout.Space();
						EditorGUILayout.BeginHorizontal();
						{
							GUILayout.Label("Attributes to Show", UniRPGEdGui.Head4Style);
							EditorGUILayout.Space();
							if (UniRPGEdGui.IconButton("Add", UniRPGEdGui.Icon_Plus, EditorStyles.miniButton))
							{
								gameData.playerStatusBars.Add(new DefaultGameGUIData_StatusBar());
							}
							GUILayout.FlexibleSpace();
						}
						EditorGUILayout.EndHorizontal();
						EditorGUILayout.Space();
						EditorGUILayout.BeginHorizontal();
						{
							GUILayout.Label("Attribute", GUILayout.Width(110));
							EditorGUILayout.Space();
							GUILayout.Label("Texture");
							GUILayout.FlexibleSpace();
						}
						EditorGUILayout.EndHorizontal();
						EditorGUILayout.Space();
						scroll[2] = UniRPGEdGui.BeginScrollView(scroll[2], UniRPGEdGui.ScrollViewNoTLMarginStyle, GUILayout.Height(120));
						{
							DefaultGameGUIData_StatusBar del = null;
							foreach (DefaultGameGUIData_StatusBar bar in gameData.playerStatusBars)
							{
								EditorGUILayout.BeginHorizontal();
								{
									int attribIdx = UniRPGEditorGlobal.DB.GetAttribNameIdx(bar.attribId);
									EditorGUI.BeginChangeCheck();
									attribIdx = EditorGUILayout.Popup(attribIdx, UniRPGEditorGlobal.DB.AttributeNames, GUILayout.Width(110));
									if (EditorGUI.EndChangeCheck() && attribIdx >= 0)
									{
										bar.attribId.Value = UniRPGEditorGlobal.DB.attributes[attribIdx].id.Value;
									}
									bar.texture = (Texture2D)EditorGUILayout.ObjectField(bar.texture, typeof(Texture2D), false, GUILayout.Width(110));
									if (GUILayout.Button("X", UniRPGEdGui.ButtonRightStyle, GUILayout.Width(20))) del = bar;
									GUILayout.FlexibleSpace();
								}
								EditorGUILayout.EndHorizontal();
							}

							if (del != null)
							{
								gameData.playerStatusBars.Remove(del);
								del = null;
							}
						}
						UniRPGEdGui.EndScrollView();
					}
					else
					{
						if (gameData.playerStatusBars.Count > 0) gameData.playerStatusBars = new List<DefaultGameGUIData_StatusBar>(0);
					}
				}
				EditorGUILayout.EndVertical();
				EditorGUILayout.BeginVertical(UniRPGEdGui.BoxStyle, GUILayout.Width(300));
				{
					gameData.statusPortraitWidth = EditorGUILayout.IntField("Portrait Size", gameData.statusPortraitWidth);
					gameData.statusBarWidth = EditorGUILayout.IntField("Statusbar Width", gameData.statusBarWidth);
					gameData.statusBarHeight = EditorGUILayout.IntField("Statusbar Height", gameData.statusBarHeight);
					gameData.statusBarBack = (Texture2D)EditorGUILayout.ObjectField("Statusbar Background", gameData.statusBarBack, typeof(Texture2D), false);
				}
				EditorGUILayout.EndVertical();
			}
			EditorGUILayout.EndVertical();

			EditorGUILayout.BeginVertical(UniRPGEdGui.BoxStyle, GUILayout.Width(300));
			{
				GUILayout.Label("Target", UniRPGEdGui.Head4Style);

				EditorGUILayout.BeginHorizontal();
				{
					GUILayout.Label(" ", GUILayout.Width(55));
					GUILayout.Label("Show", GUILayout.Width(40));
					GUILayout.Label("Name", GUILayout.Width(40));
					GUILayout.Label("Img", GUILayout.Width(40));
					GUILayout.Label("Lv", GUILayout.Width(40));
					GUILayout.Label("Bars", GUILayout.Width(35));
				}
				EditorGUILayout.EndHorizontal();

				for (int i = 0; i < gameData.targetStatus.Length; i++)
				{
					EditorGUILayout.BeginHorizontal();
					{
						GUILayout.Label(gameData.targetStatus[i].nm, GUILayout.Width(60));
						gameData.targetStatus[i].show = EditorGUILayout.Toggle(gameData.targetStatus[i].show);
						gameData.targetStatus[i].name = EditorGUILayout.Toggle(gameData.targetStatus[i].name);
						gameData.targetStatus[i].img = EditorGUILayout.Toggle(gameData.targetStatus[i].img);
						gameData.targetStatus[i].level = EditorGUILayout.Toggle(gameData.targetStatus[i].level);
						gameData.targetStatus[i].bars = EditorGUILayout.Toggle(gameData.targetStatus[i].bars);
					}
					EditorGUILayout.EndHorizontal();
				}

				//UniRPGEdGui.LookLikeControls(130);
				//gameData.showTargetStatus = EditorGUILayout.Toggle("Show Target Status", gameData.showTargetStatus);
				//gameData.showTargetName = EditorGUILayout.Toggle("Show Target Name", gameData.showTargetName);
				//if (gameData.showTargetStatus)
				//{
				//	EditorGUILayout.BeginHorizontal();
				//	{
				//		gameData.showTargetPortrait = EditorGUILayout.Toggle("Show Portrait", gameData.showTargetPortrait);
				//		EditorGUILayout.Space();
				//		if (gameData.showTargetPortrait)
				//		{
				//			UniRPGEdGui.LookLikeControls(80);
				//			gameData.showTargetLevel = EditorGUILayout.Toggle("Show Level", gameData.showTargetLevel);
				//		}
				//		GUILayout.FlexibleSpace();
				//	}
				//	EditorGUILayout.EndHorizontal();

				//	EditorGUILayout.Space();
				//	GUILayout.Label("Show status for...");
				//	EditorGUILayout.BeginHorizontal();
				//	{
				//		gameData.showStatusForFriendly = GUILayout.Toggle(gameData.showStatusForFriendly, " Friendly", GUILayout.Width(100));
				//		gameData.showStatusForNeutral = GUILayout.Toggle(gameData.showStatusForNeutral, " Neutral", GUILayout.Width(100));
				//		gameData.showStatusForHostile = GUILayout.Toggle(gameData.showStatusForHostile, " Hostile", GUILayout.Width(100));
				//		GUILayout.FlexibleSpace();
				//	}
				//	EditorGUILayout.EndHorizontal();
				//	EditorGUILayout.BeginHorizontal();
				//	{
				//		gameData.showStatusForItem = GUILayout.Toggle(gameData.showStatusForItem, " Item", GUILayout.Width(100));
				//		gameData.showStatusForObject = GUILayout.Toggle(gameData.showStatusForObject, " Object", GUILayout.Width(100));
				//		GUILayout.FlexibleSpace();
				//	}
				//	EditorGUILayout.EndHorizontal();

				EditorGUILayout.Space();
				UniRPGEdGui.LookLikeControls();
				EditorGUILayout.BeginHorizontal();
				{
					GUILayout.Label("Show value: ");
					if (GUILayout.Toggle(gameData.targetStatusShowValue == 0, " No")) gameData.targetStatusShowValue = 0;
					if (GUILayout.Toggle(gameData.targetStatusShowValue == 1, " Number")) gameData.targetStatusShowValue = 1;
					if (GUILayout.Toggle(gameData.targetStatusShowValue == 2, " Percentage")) gameData.targetStatusShowValue = 2;
				}
				EditorGUILayout.EndHorizontal();
				EditorGUILayout.Space();
				EditorGUILayout.BeginHorizontal();
				{
					GUILayout.Label("Attributes to Show", UniRPGEdGui.Head4Style);
					EditorGUILayout.Space();
					if (UniRPGEdGui.IconButton("Add", UniRPGEdGui.Icon_Plus, EditorStyles.miniButton))
					{
						gameData.targetStatusBars.Add(new DefaultGameGUIData_StatusBar());
					}
					GUILayout.FlexibleSpace();
				}
				EditorGUILayout.EndHorizontal();
				EditorGUILayout.Space();
				EditorGUILayout.BeginHorizontal();
				{
					GUILayout.Label("Attribute", GUILayout.Width(110));
					EditorGUILayout.Space();
					GUILayout.Label("Texture");
					GUILayout.FlexibleSpace();
				}
				EditorGUILayout.EndHorizontal();
				EditorGUILayout.Space();
				scroll[2] = UniRPGEdGui.BeginScrollView(scroll[2], UniRPGEdGui.ScrollViewNoTLMarginStyle, GUILayout.Height(120));
				{
					DefaultGameGUIData_StatusBar del = null;
					foreach (DefaultGameGUIData_StatusBar bar in gameData.targetStatusBars)
					{
						EditorGUILayout.BeginHorizontal();
						{
							int attribIdx = UniRPGEditorGlobal.DB.GetAttribNameIdx(bar.attribId);
							EditorGUI.BeginChangeCheck();
							attribIdx = EditorGUILayout.Popup(attribIdx, UniRPGEditorGlobal.DB.AttributeNames, GUILayout.Width(110));
							if (EditorGUI.EndChangeCheck() && attribIdx >= 0)
							{
								bar.attribId.Value = UniRPGEditorGlobal.DB.attributes[attribIdx].id.Value;
							}
							bar.texture = (Texture2D)EditorGUILayout.ObjectField(bar.texture, typeof(Texture2D), false, GUILayout.Width(110));
							if (GUILayout.Button("X", UniRPGEdGui.ButtonRightStyle, GUILayout.Width(20))) del = bar;
							GUILayout.FlexibleSpace();
						}
						EditorGUILayout.EndHorizontal();
					}

					if (del != null)
					{
						gameData.targetStatusBars.Remove(del);
						del = null;
					}
				}
				UniRPGEdGui.EndScrollView();
				//}
				//else
				//{
				//	if (gameData.targetStatusBars.Count > 0) gameData.targetStatusBars = new List<DefaultGameGUIData_StatusBar>(0);
				//}
			}
			EditorGUILayout.EndVertical();
			GUILayout.FlexibleSpace();
		}
		EditorGUILayout.EndHorizontal();		
	}
Example #4
0
	private void DrawActionBarSettings(DefaultGameGUIData gameData)
	{
		GUILayout.Space(15);
		GUILayout.Label("Action/Skill Bar", UniRPGEdGui.Head2Style);
		
		EditorGUILayout.BeginHorizontal();
		{
			EditorGUILayout.BeginVertical();	
			{
				UniRPGEdGui.LookLikeControls(170, 30);
				EditorGUILayout.BeginVertical(UniRPGEdGui.BoxStyle, GUILayout.Width(236));
				{
					GUILayout.Label("Settings", UniRPGEdGui.Head4Style);
					EditorGUILayout.Space();
					gameData.actionSlotsCount = EditorGUILayout.IntField("Number of Action Slots", gameData.actionSlotsCount);
				}
				EditorGUILayout.EndVertical();
				EditorGUILayout.Space();
				EditorGUILayout.BeginVertical(UniRPGEdGui.BoxStyle, GUILayout.Width(236));
				{
					UniRPGEdGui.LookLikeControls();
					GUILayout.Label("Position & Size", UniRPGEdGui.Head4Style);
					EditorGUILayout.Space();
					gameData.actionIconWidth = EditorGUILayout.IntField("Icon Size", gameData.actionIconWidth);
					UniRPGEdGui.LookLikeControls(50, 120);
					gameData.trActionBar = ElementTransformField(gameData.trActionBar, null, false, true, true, true, false);
				}
				EditorGUILayout.EndVertical();
				EditorGUILayout.Space();
			}
			EditorGUILayout.EndVertical();
			EditorGUILayout.Space();
			EditorGUILayout.BeginVertical();
			{
				UniRPGEdGui.LookLikeControls(50);
				EditorGUILayout.BeginVertical(UniRPGEdGui.BoxStyle, GUILayout.Width(236));
				{
					GUILayout.Label("Queued Skill Indicator", UniRPGEdGui.Head4Style);
					EditorGUILayout.Space();
					gameData.showSkillQueued = EditorGUILayout.Toggle("Use", gameData.showSkillQueued);
					if (gameData.showSkillQueued)
					{
						gameData.txQueued = EditorGUILayout.ObjectField(gameData.txQueued, typeof(Texture2D), false, GUILayout.Width(50), GUILayout.Height(50)) as Texture2D;
					}
					else gameData.txQueued = null; // make sure the texture is not referenced when this is not used
				}
				EditorGUILayout.EndVertical();
				EditorGUILayout.Space();

				EditorGUILayout.BeginVertical(UniRPGEdGui.BoxStyle, GUILayout.Width(236));
				{
					GUILayout.Label("Out-of-Range Indicator", UniRPGEdGui.Head4Style);
					EditorGUILayout.Space();
					gameData.showWhenCantUseSkill = EditorGUILayout.Toggle("Use", gameData.showWhenCantUseSkill);
					if (gameData.showWhenCantUseSkill)
					{
						gameData.txInvalid = EditorGUILayout.ObjectField(gameData.txInvalid, typeof(Texture2D), false, GUILayout.Width(50), GUILayout.Height(50)) as Texture2D;
					}
					else gameData.txQueued = null; // make sure the texture is not referenced when this is not used				
				}
				EditorGUILayout.EndVertical();
				EditorGUILayout.Space();
			}
			EditorGUILayout.EndVertical();
			GUILayout.FlexibleSpace();
		}
		EditorGUILayout.EndHorizontal();
		EditorGUILayout.Space();

		EditorGUILayout.BeginVertical(UniRPGEdGui.BoxStyle, GUILayout.Width(600));
		{
			GUILayout.Label("Skill Cooldown Animation", UniRPGEdGui.Head4Style);
			EditorGUILayout.Space();
			EditorGUILayout.BeginHorizontal();
			{
				gameData.showSkillCooldown = EditorGUILayout.Toggle("Use", gameData.showSkillCooldown);
				EditorGUILayout.Space();
				if (gameData.showSkillCooldown)
				{
					if (UniRPGEdGui.IconButton("Add Frame", UniRPGEdGui.Icon_Plus, EditorStyles.miniButton))
					{
						if (gameData.txCooldown == null) gameData.txCooldown = new List<Texture2D>();
						gameData.txCooldown.Add(null);
					}
				}
				else gameData.txCooldown = null;
				GUILayout.FlexibleSpace();
			}
			EditorGUILayout.EndHorizontal();

			GUILayout.Space(15);
			if (gameData.showSkillCooldown && gameData.txCooldown != null)
			{
				scroll[1] = EditorGUILayout.BeginScrollView(scroll[1], true, false, UniRPGEdGui.Skin.horizontalScrollbar, UniRPGEdGui.Skin.verticalScrollbar, UniRPGEdGui.ScrollViewNoTLMarginStyle, GUILayout.Height(100));
				{
					EditorGUILayout.BeginHorizontal();
					{
						int del = -1;
						for (int i = 0; i < gameData.txCooldown.Count; i++)
						{
							gameData.txCooldown[i] = EditorGUILayout.ObjectField(gameData.txCooldown[i], typeof(Texture2D), false, GUILayout.Width(50), GUILayout.Height(50)) as Texture2D;
							if (GUILayout.Button("X", EditorStyles.miniButtonRight, GUILayout.Width(20))) del = i;
							EditorGUILayout.Space();
						}
						if (del >= 0) gameData.txCooldown.RemoveAt(del);
						GUILayout.FlexibleSpace();
					}
					EditorGUILayout.EndHorizontal();
				}
				EditorGUILayout.EndScrollView();
			}
		}
		EditorGUILayout.EndVertical();
	}
Example #5
0
	// ================================================================================================================
	#region In-Game

	private void DrawMenuBarOptions(DefaultGameGUIData gameData)
	{
		GUILayout.Space(15);
		GUILayout.Label("Menu Bar", UniRPGEdGui.Head2Style);

		EditorGUILayout.BeginHorizontal();
		{
			EditorGUILayout.BeginVertical(UniRPGEdGui.BoxStyle, GUILayout.Width(300));
			{
				GUILayout.Label("Settings", UniRPGEdGui.Head4Style);
				EditorGUILayout.Space();
				gameData.menuIconWidth = EditorGUILayout.IntField("Icon size", gameData.menuIconWidth);
				EditorGUILayout.Space();
				foreach (DefaultGameGUIData_MenuOption opt in gameData.menuOptions)
				{
					EditorGUILayout.BeginHorizontal();
					{
						opt.active = EditorGUILayout.Toggle(opt.active, GUILayout.Width(15));
						EditorGUILayout.Space();
						GUI.enabled = opt.active;
						GUILayout.Label(opt.showWhat.ToString(), GUILayout.Width(60));
						EditorGUILayout.Space();
						opt.name = EditorGUILayout.TextField(opt.name);
						EditorGUILayout.Space();
						opt.icon = (Texture2D)EditorGUILayout.ObjectField(opt.icon, typeof(Texture2D), false, GUILayout.Width(40), GUILayout.Height(40));
						GUI.enabled = true;
						EditorGUILayout.Space();
					}
					EditorGUILayout.EndHorizontal();
					EditorGUILayout.Space();
				}
			}
			EditorGUILayout.EndVertical();
			EditorGUILayout.Space();
			EditorGUILayout.BeginVertical(UniRPGEdGui.BoxStyle, GUILayout.Width(236));
			{
				UniRPGEdGui.LookLikeControls(50, 120);
				GUILayout.Label("Menu Bar Area", UniRPGEdGui.Head4Style);
				EditorGUILayout.Space();
				gameData.trMenuBar = ElementTransformField(gameData.trMenuBar, null, false, true, true, true, false);
			}
			EditorGUILayout.EndVertical();
			GUILayout.FlexibleSpace();
		}
		EditorGUILayout.EndHorizontal();
	}
Example #6
0
	private void DrawBasicSettings(DefaultMainMenuGUIData menuData, DefaultGameGUIData ingameData)
	{
		UniRPGEdGui.LookLikeControls(50, 120);

		GUILayout.Space(15);
		GUILayout.Label("Basic Settings", UniRPGEdGui.Head2Style);

		EditorGUILayout.BeginVertical(UniRPGEdGui.BoxStyle, GUILayout.MaxWidth(236));
		{
			EditorGUILayout.LabelField("Theme", "Default Fantasy");
			EditorGUILayout.Space();

			EditorGUILayout.BeginHorizontal();
			{
				GUILayout.FlexibleSpace();
				if (GUILayout.Button("Reset Theme", GUILayout.Width(120))) InitDefaults(menuData.gameObject, ingameData.gameObject);
				GUILayout.FlexibleSpace();
			}
			EditorGUILayout.EndHorizontal();
			EditorGUILayout.Space();

			menuData.skin = (GUISkin)EditorGUILayout.ObjectField("Skin", menuData.skin, typeof(GUISkin), false);
			EditorGUILayout.Space();
			UniRPGEdGui.IntVector2Field("Design Size", "width", "height", ref menuData.width, ref menuData.height, 200);

			ingameData.skin = menuData.skin;
			ingameData.width = menuData.width;
			ingameData.height = menuData.height;
		}
		EditorGUILayout.EndVertical();
	}