Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Serializable]
- public class Dialogue
- {
- // NPC Character which says the line
- [SerializeField]
- private NPCharacter npcCharacter;
- public NPCharacter NpcCharacter => npcCharacter;
- // Dialogue line which will be displayed on screen
- [SerializeField, TextArea(3, 5)]
- private string line;
- // Enum flag for easier checking which condition apply for dialogue if any
- [Flags]
- public enum DialogueVariables
- {
- Item = 1 << 1,
- Requirement = 1 << 2,
- SetAfterDialogue = 1 << 3,
- };
- [SerializeField, EnumToggleButtons]
- private DialogueVariables dialogueVariables;
- // Odin Inspector properties for hiding not used properties to remove clutter in inspector
- private bool ShowItemThings => (dialogueVariables & DialogueVariables.Item) == DialogueVariables.Item;
- private bool ShowRequiredThings => (dialogueVariables & DialogueVariables.Requirement) == DialogueVariables.Requirement;
- private bool ShowSetThings => (dialogueVariables & DialogueVariables.SetAfterDialogue) == DialogueVariables.SetAfterDialogue;
- // Item required to be held in hand in order to start this dialogue
- [GUIColor(0.8f, 0.8f, 1f, 1f)]
- [SerializeField, ShowIf("ShowItemThings")]
- private Item requiredItem;
- [GUIColor(0.8f, 0.8f, 1f, 1f)]
- [SerializeField, ShowIf("ShowItemThings")]
- private bool removeItem;
- // Variables required to have desired values to be able to start this dialogue
- [GUIColor(1f, 0.8f, 0.8f, 1f)]
- [SerializeField, ShowIf("ShowRequiredThings")]
- private List<GlobalVariableCompareTemplate> requirementVariables;
- // Variables to be set when dialogue starts
- [GUIColor(0.8f, 1f, 0.8f, 1f)]
- [Space]
- [SerializeField, ShowIf("ShowSetThings")]
- private List<GlobalVariableTemplate> setVariables;
- // Accessors and other methods ommited
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement