コード例 #1
0
	public override void OnGUI(Object actionObj)
	{
		action = actionObj as CreateLootAction;
		if (action == null) { GUILayout.Label("Error: Delete this Action."); return; }

		if (cachedName == null) GetLootName(action);

		UniRPGEdGui.TargetTypeField(this.ed, "Subject", action.subject, TargetTypeHelp);
		EditorGUILayout.Space();

		EditorGUILayout.BeginHorizontal();
		GUILayout.Label("Loot");
		if (GUILayout.Button(cachedName, GUILayout.Width(240))) LootSelectWiz.Show(OnLootSelected, new object[] { action });
		EditorGUILayout.EndHorizontal();
		EditorGUILayout.Space();

		EditorGUILayout.HelpBox("If the Subject is a character (Actor) then the Level of that Actor will be send to the Loot Table. For any other object the Level send to the Loot Table will be set as (0). This only matters if your Loot Table checks 'NPC Level'.", MessageType.Info);
	}
コード例 #2
0
	private void GetLootName(CreateLootAction action)
	{
		cachedName = "-";
		RPGLoot loot = UniRPGEditorGlobal.DB.GetLoot(action.lootId);
		if (loot != null) cachedName = loot.screenName;
	}