Mini demo with all features
This commit is contained in:
@@ -2,10 +2,6 @@ using UnityEngine;
|
||||
|
||||
namespace Unheimlich.Data.DetectiveBoard
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a single clue/evidence node on the detective board.
|
||||
/// Unlocked through various triggers (audio, objects, dialogues, hallucinations, etc.).
|
||||
/// </summary>
|
||||
[CreateAssetMenu(fileName = "ClueData", menuName = "Unheimlich/Detective Board/Clue Data")]
|
||||
public class ClueData : ScriptableObject
|
||||
{
|
||||
@@ -27,15 +23,8 @@ namespace Unheimlich.Data.DetectiveBoard
|
||||
[Tooltip("Color tint for the node")]
|
||||
public Color NodeColor = Color.white;
|
||||
|
||||
[Header("Connection Rules")]
|
||||
[Tooltip("IDs of clues this can connect to")]
|
||||
public string[] PossibleConnections;
|
||||
|
||||
[Header("Meta")]
|
||||
[Tooltip("Category for organization (e.g., 'Evidence', 'Witness', 'Location')")]
|
||||
public string Category;
|
||||
|
||||
[Tooltip("Initial position on the board (normalized 0-1)")]
|
||||
public Vector2 InitialPosition = new Vector2(0.5f, 0.5f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unheimlich.Data.DetectiveBoard
|
||||
{
|
||||
/// <summary>
|
||||
/// Configuration for detective board UI behavior and appearance.
|
||||
/// Defines node visuals, connection rules, and interaction parameters.
|
||||
/// </summary>
|
||||
[CreateAssetMenu(fileName = "DetectiveBoardSettings", menuName = "Unheimlich/Detective Board/Board Settings")]
|
||||
public class DetectiveBoardSettings : ScriptableObject
|
||||
{
|
||||
[Header("Node Visuals")]
|
||||
[Tooltip("Default sprite for nodes (post-it/card)")]
|
||||
public Sprite DefaultNodeSprite;
|
||||
|
||||
[Tooltip("Scale of node objects on the board")]
|
||||
public float NodeScale = 1f;
|
||||
|
||||
[Tooltip("Spacing between nodes when auto-arranged")]
|
||||
public float NodeSpacing = 0.5f;
|
||||
|
||||
[Header("Connection Visuals")]
|
||||
[Tooltip("Line width for connections")]
|
||||
public float ConnectionLineWidth = 0.05f;
|
||||
|
||||
[Tooltip("Color for confirmed connections")]
|
||||
public Color ConfirmedConnectionColor = Color.green;
|
||||
|
||||
[Tooltip("Color for uncertain connections")]
|
||||
public Color UncertainConnectionColor = Color.yellow;
|
||||
|
||||
[Tooltip("Color for eliminated connections")]
|
||||
public Color EliminatedConnectionColor = Color.red;
|
||||
|
||||
[Header("Interaction")]
|
||||
[Tooltip("Distance at which nodes can be interacted with")]
|
||||
public float InteractionRange = 2f;
|
||||
|
||||
[Tooltip("Highlight color when hovering over a node")]
|
||||
public Color HoverHighlightColor = new Color(1f, 1f, 0.5f, 1f);
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f6b20768fe570fb429fcf6a348431232
|
||||
@@ -1,6 +1,7 @@
|
||||
using UnityEngine;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Unheimlich.UI.DetectiveBoard;
|
||||
|
||||
namespace Unheimlich.Data.DetectiveBoard
|
||||
{
|
||||
@@ -9,15 +10,43 @@ namespace Unheimlich.Data.DetectiveBoard
|
||||
{
|
||||
public string NodeID;
|
||||
public Vector2 Position;
|
||||
public float Rotation;
|
||||
public bool IsEliminated;
|
||||
public List<string> ConnectedNodeIDs = new List<string>();
|
||||
public List<ConnectionData> Connections = new List<ConnectionData>();
|
||||
|
||||
public PostItNodeData(string id, Vector2 position)
|
||||
{
|
||||
NodeID = id;
|
||||
Position = position;
|
||||
Rotation = 0f;
|
||||
IsEliminated = false;
|
||||
}
|
||||
|
||||
public List<string> ConnectedNodeIDs
|
||||
{
|
||||
get
|
||||
{
|
||||
List<string> ids = new List<string>();
|
||||
foreach (var conn in Connections)
|
||||
{
|
||||
ids.Add(conn.TargetNodeID);
|
||||
}
|
||||
return ids;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class ConnectionData
|
||||
{
|
||||
public string TargetNodeID;
|
||||
public LineColorState ColorState;
|
||||
|
||||
public ConnectionData(string targetId, LineColorState colorState = LineColorState.Green)
|
||||
{
|
||||
TargetNodeID = targetId;
|
||||
ColorState = colorState;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
|
||||
@@ -16,6 +16,17 @@ namespace Unheimlich.Data.Dialogues
|
||||
[Tooltip("Default scale multiplier for spawned choices (1.0 = normal size)")]
|
||||
public float DefaultScaleMultiplier = 1.0f;
|
||||
|
||||
[Tooltip("Minimum scale variation multiplier (e.g., 0.5 = 50% of base scale)")]
|
||||
[Range(0.1f, 2f)]
|
||||
public float MinScaleVariation = 0.5f;
|
||||
|
||||
[Tooltip("Maximum scale variation multiplier (e.g., 1.5 = 150% of base scale)")]
|
||||
[Range(0.1f, 2f)]
|
||||
public float MaxScaleVariation = 1.5f;
|
||||
|
||||
[Tooltip("Enable random scale variation for each word")]
|
||||
public bool EnableScaleVariation = false;
|
||||
|
||||
[Header("Spawn Settings")]
|
||||
[Tooltip("Radius around anchor where choices spawn")]
|
||||
public float SpawnRadius = 2f;
|
||||
|
||||
@@ -9,6 +9,9 @@ namespace Unheimlich.Data.Dialogues
|
||||
[Header("Choice Content")]
|
||||
[Tooltip("Localized text displayed on the choice button")]
|
||||
public OctoLocalizedTextData ChoiceText;
|
||||
|
||||
[HideInInspector]
|
||||
public string ChoiceTextOverride;
|
||||
|
||||
[Header("Flow")]
|
||||
[Tooltip("Direct reference to the next DialogueNode")]
|
||||
@@ -20,6 +23,9 @@ namespace Unheimlich.Data.Dialogues
|
||||
|
||||
public string GetLocalizedChoiceText()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(ChoiceTextOverride))
|
||||
return ChoiceTextOverride;
|
||||
|
||||
if (ChoiceText != null)
|
||||
return OctoLocalization.GetLocalizedText(ChoiceText);
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using OctoCore.Localization;
|
||||
using Unheimlich.Data.DetectiveBoard;
|
||||
|
||||
namespace Unheimlich.Data.Dialogues
|
||||
{
|
||||
@@ -19,6 +20,10 @@ namespace Unheimlich.Data.Dialogues
|
||||
[Tooltip("For end nodes (no choices), delay in seconds before automatic close. 0 = requires player interaction to close")]
|
||||
public float AutoCloseDelay = 3f;
|
||||
|
||||
[Header("Detective Board Integration")]
|
||||
[Tooltip("Clue to unlock when this node is reached. Useful for end nodes to unlock evidence after a conversation")]
|
||||
public ClueData ClueToUnlock;
|
||||
|
||||
public string GetLocalizedDialogueText()
|
||||
{
|
||||
if (DialogueText != null)
|
||||
|
||||
Reference in New Issue
Block a user