109 lines
3.3 KiB
C#
109 lines
3.3 KiB
C#
using BriarQueen.Data.Identifiers;
|
|
using NaughtyAttributes;
|
|
using UnityEngine;
|
|
|
|
namespace BriarQueen.Framework.Managers.Player.Data
|
|
{
|
|
[CreateAssetMenu(menuName = "Briar Queen/Codex/New Codex Entry", fileName = "New Codex Entry")]
|
|
public class CodexEntrySo : ScriptableObject
|
|
{
|
|
|
|
[Header("Codex Type")]
|
|
[SerializeField]
|
|
private CodexType _codexType;
|
|
|
|
[Header("Codex ID")]
|
|
[SerializeField]
|
|
[ShowIf(nameof(IsBookEntry))]
|
|
private BookEntryID _bookEntryID;
|
|
|
|
[SerializeField]
|
|
[ShowIf(nameof(IsPuzzleClue))]
|
|
private ClueEntryID _clueEntryID;
|
|
|
|
[SerializeField]
|
|
[ShowIf(nameof(IsPhoto))]
|
|
private PhotoEntryID _photoEntryID;
|
|
|
|
|
|
[Header("Display")]
|
|
[SerializeField]
|
|
private string _title;
|
|
|
|
[SerializeField]
|
|
[ShowIf(EConditionOperator.Or, nameof(IsPhoto), nameof(_isPhotoOverride))]
|
|
private Sprite _displayImage;
|
|
|
|
[TextArea(6, 20)]
|
|
[SerializeField]
|
|
[ShowIf(EConditionOperator.Or, nameof(IsBookEntry), nameof(_bodyTextOverride))]
|
|
private string _bodyText;
|
|
|
|
[SerializeField]
|
|
[ShowIf(EConditionOperator.Or, nameof(IsPhoto), nameof(_isPhotoOverride))]
|
|
private string _photoDescription;
|
|
|
|
[SerializeField]
|
|
[ShowIf(EConditionOperator.Or, nameof(IsPhoto), nameof(_isPhotoOverride))]
|
|
private string _polaroidWriting;
|
|
|
|
[Header("Behaviour")]
|
|
[SerializeField]
|
|
private bool _startsUnlocked;
|
|
|
|
[SerializeField]
|
|
private bool _hiddenUntilUnlocked = true;
|
|
|
|
[SerializeField]
|
|
private bool _isPhotoOverride;
|
|
|
|
[SerializeField]
|
|
private bool _bodyTextOverride;
|
|
|
|
[SerializeField]
|
|
private Location _location;
|
|
|
|
public CodexType EntryType => _codexType;
|
|
public Location Location => _location;
|
|
|
|
public bool IsBookEntry => _codexType == CodexType.BookEntry;
|
|
public bool IsPuzzleClue => _codexType == CodexType.PuzzleClue;
|
|
public bool IsPhoto => _codexType == CodexType.Photo;
|
|
|
|
public BookEntryID BookEntryID => _bookEntryID;
|
|
public ClueEntryID ClueEntryID => _clueEntryID;
|
|
public PhotoEntryID PhotoEntryID => _photoEntryID;
|
|
|
|
public string Title => _title;
|
|
public Sprite DisplayImage => _displayImage;
|
|
public string BodyText => _bodyText;
|
|
public string PhotoDescription => _photoDescription;
|
|
public string PolaroidWriting => _polaroidWriting;
|
|
|
|
public bool StartsUnlocked => _startsUnlocked;
|
|
public bool HiddenUntilUnlocked => _hiddenUntilUnlocked;
|
|
public bool IsPhotoOverride => _isPhotoOverride;
|
|
public bool IsBodyTextOverride => _bodyTextOverride;
|
|
|
|
|
|
public string UniqueID
|
|
{
|
|
get
|
|
{
|
|
return _codexType switch
|
|
{
|
|
CodexType.BookEntry when _bookEntryID != BookEntryID.None =>
|
|
CodexEntryIDs.Get(_bookEntryID),
|
|
|
|
CodexType.PuzzleClue when _clueEntryID != ClueEntryID.None =>
|
|
CodexEntryIDs.Get(_clueEntryID),
|
|
|
|
CodexType.Photo when _photoEntryID != PhotoEntryID.None =>
|
|
CodexEntryIDs.Get(_photoEntryID),
|
|
|
|
_ => string.Empty
|
|
};
|
|
}
|
|
}
|
|
}
|
|
} |