first commit

This commit is contained in:
2026-06-04 20:14:47 +03:00
commit a70f7fe2b9
143 changed files with 19543 additions and 0 deletions
+49
View File
@@ -0,0 +1,49 @@
using System;
using UnityEngine;
public enum QuestGoalType
{
CollectItem,
KillEnemy,
TalkToNPC
}
[Serializable]
public class QuestGoal
{
public QuestGoalType goalType;
public ItemData targetItem;
public string enemyType;
public string npcId;
[Min(1)] public int requiredAmount = 1;
public string GetTargetKey()
{
switch (goalType)
{
case QuestGoalType.CollectItem:
return targetItem != null ? targetItem.itemId : string.Empty;
case QuestGoalType.KillEnemy:
return enemyType;
case QuestGoalType.TalkToNPC:
return npcId;
default:
return string.Empty;
}
}
public string GetDisplayName()
{
switch (goalType)
{
case QuestGoalType.CollectItem:
return targetItem != null ? targetItem.itemName : "Unknown item";
case QuestGoalType.KillEnemy:
return string.IsNullOrWhiteSpace(enemyType) ? "Enemy" : enemyType;
case QuestGoalType.TalkToNPC:
return string.IsNullOrWhiteSpace(npcId) ? "NPC" : npcId;
default:
return "Goal";
}
}
}