Implement MVP for the statue decoration minigame (#65)

MVP implemented with:
- placing, removing etc. decorations
- saving the state, displaying it on the map, restoring when game restarts
- saving screenshots to folder on device

Co-authored-by: Michal Pikulski <michal@foolhardyhorizons.com>
Co-authored-by: Michal Pikulski <michal.a.pikulski@gmail.com>
Reviewed-on: #65
This commit is contained in:
2025-11-27 13:21:22 +00:00
parent 5ad84ca3e8
commit 83aa3d5e6d
71 changed files with 6421 additions and 976 deletions

View File

@@ -0,0 +1,39 @@
using UnityEngine;
namespace Minigames.StatueDressup.Data
{
/// <summary>
/// Event data passed with decoration events for VFX/SFX responses
/// </summary>
public class DecorationEventData
{
/// <summary>
/// The decoration data (sprite, id, etc.)
/// </summary>
public DecorationData DecorationData { get; set; }
/// <summary>
/// The GameObject instance of the decoration (if applicable)
/// </summary>
public GameObject Instance { get; set; }
/// <summary>
/// Position where the event occurred (world space)
/// </summary>
public Vector3 Position { get; set; }
/// <summary>
/// Whether this decoration was dragged from the menu or from the statue
/// </summary>
public bool FromStatue { get; set; }
public DecorationEventData(DecorationData data, GameObject instance, Vector3 position, bool fromStatue = false)
{
DecorationData = data;
Instance = instance;
Position = position;
FromStatue = fromStatue;
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 5d9b3e7728c0420c8290986c31d5b738
timeCreated: 1764248890

View File

@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using UnityEngine;
namespace Minigames.StatueDressup.Data
{
/// <summary>
/// Metadata for a single decoration placement
/// </summary>
[Serializable]
public class DecorationPlacement
{
public string decorationId; // Unique ID to load decoration
public Vector2 localPosition; // Position relative to statue
public Vector2 localScale; // Scale relative to statue
public Vector2 sizeDelta; // UI RectTransform size (for UI decorations)
public float rotation; // Z rotation in degrees
public int sortingOrder; // Sprite sorting order
}
/// <summary>
/// Coordinate system type used when saving decoration positions
/// </summary>
public enum CoordinateSystemType
{
WorldSpace, // Regular Transform (world units)
UIRectTransform // UI RectTransform (pixel coordinates)
}
/// <summary>
/// Collection of decoration placements for a statue
/// </summary>
[Serializable]
public class StatueDecorationData
{
public string photoId; // Associated photo ID
public string timestamp; // When captured
public CoordinateSystemType coordinateSystem; // Source coordinate system
public Vector2 sourceStatueSize; // Size of statue in source units (for conversion)
public List<DecorationPlacement> placements = new List<DecorationPlacement>();
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: bde3a2b8ef7247d29967999bb5e9dbd8
timeCreated: 1764163703