Compare commits
48 Commits
e27bb7bfb6
...
update_too
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
32ecbf4dc4 | ||
|
|
4dfe6202fd | ||
|
|
f8805dabe7 | ||
|
|
961da5e729 | ||
|
|
a049c6a750 | ||
|
|
01caca1878 | ||
|
|
7565b189b9 | ||
|
|
c4d356886f | ||
|
|
64d7f19b83 | ||
| ce21e8b02e | |||
| f44f8c5171 | |||
| 9772206362 | |||
|
|
3ebbecc277 | ||
|
|
c99aad49f3 | ||
| 3fe4c6afd9 | |||
| 9c61065947 | |||
|
|
7c09db641a | ||
|
|
e369660a8f | ||
| a6e3413499 | |||
| 7bb992acb8 | |||
|
|
cefa488a92 | ||
| 9344f06886 | |||
| af7e081c9a | |||
|
|
4a6ac7281f | ||
| 861797ba41 | |||
| 98883bd382 | |||
| 474941f421 | |||
|
|
75cd70a18a | ||
| e82ec90723 | |||
|
|
252cb99884 | ||
| 3f548c3ed4 | |||
|
|
0c9a388433 | ||
|
|
a80aed8eb7 | ||
|
|
5d0a9f999a | ||
|
|
eda7361702 | ||
|
|
2ec53629c6 | ||
|
|
0e55248698 | ||
|
|
4d7c48a681 | ||
|
|
6e466cd7aa | ||
| 29d01df3ce | |||
| de0a243b1e | |||
| fdfa4e0e09 | |||
|
|
2127bf37b2 | ||
| ea12766cf7 | |||
| 41c71f07fd | |||
| d2e79f058b | |||
| 1bcb63ffd0 | |||
| de2966fb1e |
@@ -15,7 +15,7 @@ MonoBehaviour:
|
||||
m_DefaultGroup: 6f3207429a65b3e4b83935ac19791077
|
||||
m_currentHash:
|
||||
serializedVersion: 2
|
||||
Hash: f08b6489862aaf7bfceb29f571e2ef6c
|
||||
Hash: 589e22fe6cd2fe0e25d89bd44a35bcbc
|
||||
m_OptimizeCatalogSize: 0
|
||||
m_BuildRemoteCatalog: 0
|
||||
m_CatalogRequestsTimeout: 0
|
||||
|
||||
@@ -18,12 +18,10 @@ MonoBehaviour:
|
||||
- {fileID: 458265635552197097, guid: a77d1e8b2fa8aa945a6f39b312536e0d, type: 3}
|
||||
- {fileID: 552225285624929822, guid: e39992796d5459442be9967c77e27066, type: 3}
|
||||
- {fileID: 7644433920135100480, guid: 12d242e44fe80ab44af852254b7cab0f, type: 3}
|
||||
- {fileID: 1794231825201849485, guid: 6fb0d7fc6faad154b8c3e3cb7abb7c15, type: 3}
|
||||
- {fileID: 6399527186463168339, guid: ac41583865245bc4bb3de6c15929b9fc, type: 3}
|
||||
- {fileID: 2755712733105741372, guid: 70e6fca1164d9a140b271f4261f1f023, type: 3}
|
||||
- {fileID: 5034240524438268576, guid: adbb9bfd5489f3f4995966535ca5f24b, type: 3}
|
||||
- {fileID: 2326026072467672024, guid: c8d9eb8c3ca524b4eb67f6364b455b87, type: 3}
|
||||
- {fileID: 3528960956969533010, guid: 53eea3840d3cde34a9768b8773a3a7e8, type: 3}
|
||||
- {fileID: 9076822654798104907, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
- {fileID: 3863019143023165617, guid: 774e30e3f0b1d0d49bad0c2abf11038a, type: 3}
|
||||
- {fileID: 5034240524438268576, guid: b15ba9d3d508ef244b0eeb76404dc9de, type: 3}
|
||||
- {fileID: 7207007194116694737, guid: 7180ae585f0db8044ba048426f72d995, type: 3}
|
||||
|
||||
@@ -71,7 +71,6 @@ namespace AppleHills.Editor
|
||||
{
|
||||
CardSystemManager.Instance.OnBoosterOpened += OnBoosterOpened;
|
||||
CardSystemManager.Instance.OnCardCollected += OnCardCollected;
|
||||
CardSystemManager.Instance.OnCardRarityUpgraded += OnCardRarityUpgraded;
|
||||
CardSystemManager.Instance.OnBoosterCountChanged += OnBoosterCountChanged;
|
||||
|
||||
isSubscribed = true;
|
||||
@@ -87,7 +86,6 @@ namespace AppleHills.Editor
|
||||
{
|
||||
CardSystemManager.Instance.OnBoosterOpened -= OnBoosterOpened;
|
||||
CardSystemManager.Instance.OnCardCollected -= OnCardCollected;
|
||||
CardSystemManager.Instance.OnCardRarityUpgraded -= OnCardRarityUpgraded;
|
||||
CardSystemManager.Instance.OnBoosterCountChanged -= OnBoosterCountChanged;
|
||||
}
|
||||
|
||||
@@ -109,13 +107,6 @@ namespace AppleHills.Editor
|
||||
Repaint();
|
||||
}
|
||||
|
||||
private void OnCardRarityUpgraded(CardData card)
|
||||
{
|
||||
lastEventMessage = $"Card upgraded: {card.Name} → {card.Rarity}!";
|
||||
RefreshData();
|
||||
Repaint();
|
||||
}
|
||||
|
||||
private void OnBoosterCountChanged(int count)
|
||||
{
|
||||
boosterCount = count;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace Interactions
|
||||
|
||||
829
Assets/Editor/CustomLogWindow.cs
Normal file
829
Assets/Editor/CustomLogWindow.cs
Normal file
@@ -0,0 +1,829 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using Core;
|
||||
|
||||
namespace Editor
|
||||
{
|
||||
/// <summary>
|
||||
/// Custom dockable log window with advanced filtering capabilities.
|
||||
/// Supports filtering by class, method, log level, time range, and text search.
|
||||
/// Multiple instances can be opened with independent filter states.
|
||||
///
|
||||
/// PERFORMANCE NOTE: For large log counts (10,000+), consider implementing virtualized scrolling.
|
||||
/// Only render visible entries within the scroll view to avoid GUI overhead.
|
||||
/// See DrawLogEntries() method for potential optimization location.
|
||||
/// </summary>
|
||||
public class CustomLogWindow : EditorWindow
|
||||
{
|
||||
#region Window State
|
||||
|
||||
private Vector2 scrollPosition;
|
||||
private readonly List<LogEntry> allLogs = new List<LogEntry>();
|
||||
|
||||
#endregion
|
||||
|
||||
#region Filter State
|
||||
|
||||
private HashSet<string> activeClassTags = new HashSet<string>();
|
||||
private HashSet<string> activeMethodTags = new HashSet<string>();
|
||||
private HashSet<string> selectedClassFilters = new HashSet<string>();
|
||||
private HashSet<string> selectedMethodFilters = new HashSet<string>();
|
||||
private HashSet<LogLevel> selectedLevelFilters = new HashSet<LogLevel>
|
||||
{
|
||||
LogLevel.Debug, LogLevel.Info, LogLevel.Warning, LogLevel.Error
|
||||
};
|
||||
private string searchText = "";
|
||||
private bool autoScroll = true;
|
||||
|
||||
// Time range filtering
|
||||
private bool enableTimeFilter = false;
|
||||
private float minTimestamp = 0;
|
||||
private float maxTimestamp = 0;
|
||||
private float currentMaxTimestamp = 0;
|
||||
|
||||
#endregion
|
||||
|
||||
#region UI State
|
||||
|
||||
// Colors for log levels
|
||||
private readonly Color debugColor = Color.white;
|
||||
private readonly Color infoColor = Color.white;
|
||||
private readonly Color warningColor = Color.yellow;
|
||||
private readonly Color errorColor = new Color(1f, 0.3f, 0.3f);
|
||||
|
||||
// Alternating row background colors
|
||||
private readonly Color evenRowColor = new Color(0.22f, 0.22f, 0.22f);
|
||||
private readonly Color oddRowColor = new Color(0.26f, 0.26f, 0.26f);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Menu Items
|
||||
|
||||
[MenuItem("AppleHills/Custom Log Console")]
|
||||
public static void ShowWindow()
|
||||
{
|
||||
var window = GetWindow<CustomLogWindow>("Custom Log");
|
||||
window.Show();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Unity Lifecycle
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
// Subscribe to new log events
|
||||
Logging.OnLogEntryAdded += OnLogAdded;
|
||||
|
||||
// Load existing logs
|
||||
allLogs.AddRange(Logging.GetRecentLogs());
|
||||
|
||||
// Build initial tag lists
|
||||
RebuildTagLists();
|
||||
|
||||
// Initialize time range
|
||||
UpdateTimeRange();
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
Logging.OnLogEntryAdded -= OnLogAdded;
|
||||
}
|
||||
|
||||
private void OnLogAdded(LogEntry entry)
|
||||
{
|
||||
allLogs.Add(entry);
|
||||
|
||||
// Update active tags
|
||||
activeClassTags.Add(entry.ClassName);
|
||||
activeMethodTags.Add(entry.MethodName);
|
||||
|
||||
// Update time range
|
||||
UpdateTimeRange();
|
||||
|
||||
if (autoScroll)
|
||||
scrollPosition.y = float.MaxValue;
|
||||
|
||||
Repaint(); // Redraw window
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region GUI Drawing
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
DrawToolbar();
|
||||
DrawLogEntries();
|
||||
}
|
||||
|
||||
private void DrawToolbar()
|
||||
{
|
||||
EditorGUILayout.BeginHorizontal(EditorStyles.toolbar);
|
||||
|
||||
// Clear button
|
||||
if (GUILayout.Button("Clear", EditorStyles.toolbarButton, GUILayout.Width(50)))
|
||||
{
|
||||
allLogs.Clear();
|
||||
activeClassTags.Clear();
|
||||
activeMethodTags.Clear();
|
||||
Logging.ClearLogs();
|
||||
Repaint();
|
||||
}
|
||||
|
||||
// Auto-scroll toggle
|
||||
autoScroll = GUILayout.Toggle(autoScroll, "Auto-scroll", EditorStyles.toolbarButton, GUILayout.Width(80));
|
||||
|
||||
GUILayout.Space(10);
|
||||
|
||||
// Class Filter Button
|
||||
string classLabel = selectedClassFilters.Count == 0 ? "Classes: All" :
|
||||
selectedClassFilters.Count == activeClassTags.Count ? "Classes: All" :
|
||||
$"Classes: {selectedClassFilters.Count}";
|
||||
if (GUILayout.Button(new GUIContent(classLabel, "Filter by class"), EditorStyles.toolbarDropDown, GUILayout.Width(100)))
|
||||
{
|
||||
ShowClassFilterMenu();
|
||||
}
|
||||
|
||||
// Method Filter Button
|
||||
string methodLabel = selectedMethodFilters.Count == 0 ? "Methods: All" :
|
||||
selectedMethodFilters.Count == activeMethodTags.Count ? "Methods: All" :
|
||||
$"Methods: {selectedMethodFilters.Count}";
|
||||
if (GUILayout.Button(new GUIContent(methodLabel, "Filter by method"), EditorStyles.toolbarDropDown, GUILayout.Width(110)))
|
||||
{
|
||||
ShowMethodFilterMenu();
|
||||
}
|
||||
|
||||
// Log Level Filter Button
|
||||
string levelLabel = selectedLevelFilters.Count == 4 ? "Levels: All" :
|
||||
selectedLevelFilters.Count == 0 ? "Levels: None" :
|
||||
$"Levels: {selectedLevelFilters.Count}";
|
||||
if (GUILayout.Button(new GUIContent(levelLabel, "Filter by log level"), EditorStyles.toolbarDropDown, GUILayout.Width(90)))
|
||||
{
|
||||
ShowLevelFilterMenu();
|
||||
}
|
||||
|
||||
// Time Range Filter Button
|
||||
if (GUILayout.Button(new GUIContent("⏱", "Time range filter"), EditorStyles.toolbarButton, GUILayout.Width(25)))
|
||||
{
|
||||
ShowTimeRangeWindow();
|
||||
}
|
||||
|
||||
GUILayout.FlexibleSpace();
|
||||
|
||||
// Search box
|
||||
GUILayout.Label("Search:", GUILayout.Width(50));
|
||||
searchText = GUILayout.TextField(searchText, EditorStyles.toolbarSearchField, GUILayout.Width(150));
|
||||
|
||||
GUILayout.Space(10);
|
||||
|
||||
// Export button
|
||||
if (GUILayout.Button("Export", EditorStyles.toolbarButton, GUILayout.Width(60)))
|
||||
{
|
||||
ExportLogs();
|
||||
}
|
||||
|
||||
GUILayout.Space(5);
|
||||
|
||||
// Log count
|
||||
var filteredCount = GetFilteredLogs().Count();
|
||||
GUILayout.Label($"{filteredCount}/{allLogs.Count}", GUILayout.Width(80));
|
||||
|
||||
EditorGUILayout.EndHorizontal();
|
||||
}
|
||||
|
||||
private void ShowClassFilterMenu()
|
||||
{
|
||||
ClassFilterWindow.ShowWindow(this, activeClassTags, selectedClassFilters,
|
||||
(newSelection) =>
|
||||
{
|
||||
selectedClassFilters = newSelection;
|
||||
Repaint();
|
||||
});
|
||||
}
|
||||
|
||||
private void ShowMethodFilterMenu()
|
||||
{
|
||||
MethodFilterWindow.ShowWindow(this, activeMethodTags, selectedMethodFilters,
|
||||
(newSelection) =>
|
||||
{
|
||||
selectedMethodFilters = newSelection;
|
||||
Repaint();
|
||||
});
|
||||
}
|
||||
|
||||
private void ShowLevelFilterMenu()
|
||||
{
|
||||
LevelFilterWindow.ShowWindow(this, selectedLevelFilters,
|
||||
(newSelection) =>
|
||||
{
|
||||
selectedLevelFilters = newSelection;
|
||||
Repaint();
|
||||
});
|
||||
}
|
||||
|
||||
private void ShowTimeRangeWindow()
|
||||
{
|
||||
TimeRangeFilterWindow.ShowWindow(this, enableTimeFilter, minTimestamp, maxTimestamp, currentMaxTimestamp,
|
||||
(enabled, min, max) =>
|
||||
{
|
||||
enableTimeFilter = enabled;
|
||||
minTimestamp = min;
|
||||
maxTimestamp = max;
|
||||
Repaint();
|
||||
});
|
||||
}
|
||||
|
||||
private void DrawLogEntries()
|
||||
{
|
||||
// PERFORMANCE NOTE: For 10,000+ logs, consider virtualized scrolling here.
|
||||
// Only render entries visible within the scroll view rect.
|
||||
// Current implementation renders all filtered logs which may cause GUI slowdown.
|
||||
|
||||
scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition);
|
||||
|
||||
var filteredLogs = GetFilteredLogs().ToList();
|
||||
|
||||
for (int i = 0; i < filteredLogs.Count; i++)
|
||||
{
|
||||
DrawLogEntry(filteredLogs[i], i);
|
||||
}
|
||||
|
||||
EditorGUILayout.EndScrollView();
|
||||
}
|
||||
|
||||
private void DrawLogEntry(LogEntry entry, int index)
|
||||
{
|
||||
// Draw alternating row background
|
||||
Color bgColor = (index % 2 == 0) ? evenRowColor : oddRowColor;
|
||||
Rect rowRect = EditorGUILayout.BeginHorizontal();
|
||||
EditorGUI.DrawRect(rowRect, bgColor);
|
||||
|
||||
// Color-code by log level
|
||||
Color color = GetColorForLevel(entry.Level);
|
||||
var originalColor = GUI.contentColor;
|
||||
GUI.contentColor = color;
|
||||
|
||||
// Timestamp
|
||||
GUILayout.Label($"[{entry.Timestamp:F2}s]", GUILayout.Width(80));
|
||||
|
||||
// Level
|
||||
GUILayout.Label($"[{entry.Level}]", GUILayout.Width(70));
|
||||
|
||||
// Class
|
||||
GUILayout.Label($"[{entry.ClassName}]", GUILayout.Width(150));
|
||||
|
||||
// Method
|
||||
GUILayout.Label($"[{entry.MethodName}]", GUILayout.Width(150));
|
||||
|
||||
// Message
|
||||
GUILayout.Label(entry.Message, GUILayout.ExpandWidth(true));
|
||||
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
GUI.contentColor = originalColor;
|
||||
|
||||
// Right-click context menu
|
||||
if (Event.current.type == EventType.ContextClick && rowRect.Contains(Event.current.mousePosition))
|
||||
{
|
||||
GenericMenu menu = new GenericMenu();
|
||||
|
||||
menu.AddItem(new GUIContent("Copy Full Message"), false, () =>
|
||||
{
|
||||
EditorGUIUtility.systemCopyBuffer = entry.FullFormattedMessage;
|
||||
});
|
||||
|
||||
menu.AddItem(new GUIContent("Copy Message Only"), false, () =>
|
||||
{
|
||||
EditorGUIUtility.systemCopyBuffer = entry.Message;
|
||||
});
|
||||
|
||||
menu.AddSeparator("");
|
||||
|
||||
menu.AddItem(new GUIContent("Filter to this Class"), false, () =>
|
||||
{
|
||||
selectedClassFilters.Clear();
|
||||
selectedClassFilters.Add(entry.ClassName);
|
||||
Repaint();
|
||||
});
|
||||
|
||||
menu.AddItem(new GUIContent("Filter to this Method"), false, () =>
|
||||
{
|
||||
selectedMethodFilters.Clear();
|
||||
selectedMethodFilters.Add(entry.MethodName);
|
||||
Repaint();
|
||||
});
|
||||
|
||||
menu.AddItem(new GUIContent("Filter to this Class + Method"), false, () =>
|
||||
{
|
||||
selectedClassFilters.Clear();
|
||||
selectedClassFilters.Add(entry.ClassName);
|
||||
selectedMethodFilters.Clear();
|
||||
selectedMethodFilters.Add(entry.MethodName);
|
||||
Repaint();
|
||||
});
|
||||
|
||||
menu.AddSeparator("");
|
||||
|
||||
menu.AddItem(new GUIContent("Filter to this Log Level"), false, () =>
|
||||
{
|
||||
selectedLevelFilters.Clear();
|
||||
selectedLevelFilters.Add(entry.Level);
|
||||
Repaint();
|
||||
});
|
||||
|
||||
menu.ShowAsContext();
|
||||
Event.current.Use();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Filtering Logic
|
||||
|
||||
private IEnumerable<LogEntry> GetFilteredLogs()
|
||||
{
|
||||
return allLogs.Where(entry =>
|
||||
{
|
||||
// Filter by class (if any selected)
|
||||
if (selectedClassFilters.Count > 0 && !selectedClassFilters.Contains(entry.ClassName))
|
||||
return false;
|
||||
|
||||
// Filter by method (if any selected)
|
||||
if (selectedMethodFilters.Count > 0 && !selectedMethodFilters.Contains(entry.MethodName))
|
||||
return false;
|
||||
|
||||
// Filter by log level
|
||||
if (!selectedLevelFilters.Contains(entry.Level))
|
||||
return false;
|
||||
|
||||
// Filter by time range
|
||||
if (enableTimeFilter)
|
||||
{
|
||||
if (entry.Timestamp < minTimestamp || entry.Timestamp > maxTimestamp)
|
||||
return false;
|
||||
}
|
||||
|
||||
// Filter by search text
|
||||
if (!string.IsNullOrEmpty(searchText))
|
||||
{
|
||||
bool matchesSearch =
|
||||
entry.ClassName.Contains(searchText, StringComparison.OrdinalIgnoreCase) ||
|
||||
entry.MethodName.Contains(searchText, StringComparison.OrdinalIgnoreCase) ||
|
||||
entry.Message.Contains(searchText, StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
if (!matchesSearch)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Helper Methods
|
||||
|
||||
private Color GetColorForLevel(LogLevel level)
|
||||
{
|
||||
return level switch
|
||||
{
|
||||
LogLevel.Debug => debugColor,
|
||||
LogLevel.Info => infoColor,
|
||||
LogLevel.Warning => warningColor,
|
||||
LogLevel.Error => errorColor,
|
||||
_ => infoColor
|
||||
};
|
||||
}
|
||||
|
||||
private void RebuildTagLists()
|
||||
{
|
||||
activeClassTags.Clear();
|
||||
activeMethodTags.Clear();
|
||||
|
||||
foreach (var log in allLogs)
|
||||
{
|
||||
activeClassTags.Add(log.ClassName);
|
||||
activeMethodTags.Add(log.MethodName);
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateTimeRange()
|
||||
{
|
||||
if (allLogs.Count > 0)
|
||||
{
|
||||
currentMaxTimestamp = allLogs.Max(l => l.Timestamp);
|
||||
|
||||
// Initialize time range on first log
|
||||
if (maxTimestamp == 0)
|
||||
{
|
||||
maxTimestamp = currentMaxTimestamp;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Auto-expand max range as new logs come in
|
||||
maxTimestamp = currentMaxTimestamp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ExportLogs()
|
||||
{
|
||||
string defaultFileName = $"logs_{DateTime.Now:yyyy-MM-dd_HH-mm-ss}.txt";
|
||||
string path = EditorUtility.SaveFilePanel("Export Logs", "", defaultFileName, "txt");
|
||||
|
||||
if (!string.IsNullOrEmpty(path))
|
||||
{
|
||||
try
|
||||
{
|
||||
var filteredLogs = GetFilteredLogs().ToList();
|
||||
var lines = filteredLogs.Select(e => e.FullFormattedMessage);
|
||||
File.WriteAllLines(path, lines);
|
||||
|
||||
EditorUtility.DisplayDialog("Export Successful",
|
||||
$"Exported {filteredLogs.Count} log entries to:\n{path}", "OK");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
EditorUtility.DisplayDialog("Export Failed",
|
||||
$"Failed to export logs:\n{ex.Message}", "OK");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Persistent popup window for class filtering with multi-selection support
|
||||
/// </summary>
|
||||
public class ClassFilterWindow : EditorWindow
|
||||
{
|
||||
private HashSet<string> availableTags;
|
||||
private HashSet<string> selectedTags;
|
||||
private System.Action<HashSet<string>> onApply;
|
||||
private Vector2 scrollPosition;
|
||||
private string searchFilter = "";
|
||||
|
||||
public static void ShowWindow(CustomLogWindow parent, HashSet<string> available, HashSet<string> selected,
|
||||
System.Action<HashSet<string>> applyCallback)
|
||||
{
|
||||
var window = CreateInstance<ClassFilterWindow>();
|
||||
window.titleContent = new GUIContent("Class Filter");
|
||||
window.availableTags = available;
|
||||
window.selectedTags = new HashSet<string>(selected);
|
||||
window.onApply = applyCallback;
|
||||
|
||||
var parentRect = parent.position;
|
||||
window.position = new Rect(parentRect.x + 50, parentRect.y + 50, 300, 400);
|
||||
window.ShowUtility();
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
EditorGUILayout.Space(5);
|
||||
|
||||
// Control buttons
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
if (GUILayout.Button("All", GUILayout.Width(60)))
|
||||
{
|
||||
if (availableTags != null)
|
||||
selectedTags = new HashSet<string>(availableTags);
|
||||
}
|
||||
if (GUILayout.Button("None", GUILayout.Width(60)))
|
||||
{
|
||||
selectedTags.Clear();
|
||||
}
|
||||
GUILayout.FlexibleSpace();
|
||||
searchFilter = EditorGUILayout.TextField(searchFilter, EditorStyles.toolbarSearchField, GUILayout.Width(150));
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
EditorGUILayout.Space(5);
|
||||
|
||||
// Scrollable list of toggles
|
||||
scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition);
|
||||
|
||||
if (availableTags != null && availableTags.Count > 0)
|
||||
{
|
||||
var filteredTags = string.IsNullOrEmpty(searchFilter)
|
||||
? availableTags.OrderBy(t => t)
|
||||
: availableTags.Where(t => t.Contains(searchFilter, StringComparison.OrdinalIgnoreCase)).OrderBy(t => t);
|
||||
|
||||
foreach (var tag in filteredTags)
|
||||
{
|
||||
bool isSelected = selectedTags.Contains(tag);
|
||||
bool newSelection = EditorGUILayout.ToggleLeft(tag, isSelected);
|
||||
|
||||
if (newSelection != isSelected)
|
||||
{
|
||||
if (newSelection)
|
||||
selectedTags.Add(tag);
|
||||
else
|
||||
selectedTags.Remove(tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
EditorGUILayout.HelpBox("No classes available", MessageType.Info);
|
||||
}
|
||||
|
||||
EditorGUILayout.EndScrollView();
|
||||
|
||||
EditorGUILayout.Space(5);
|
||||
|
||||
// Apply/Close buttons
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
GUILayout.FlexibleSpace();
|
||||
|
||||
if (GUILayout.Button("Apply", GUILayout.Width(80)))
|
||||
{
|
||||
onApply?.Invoke(selectedTags);
|
||||
Close();
|
||||
}
|
||||
|
||||
if (GUILayout.Button("Close", GUILayout.Width(80)))
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
GUILayout.FlexibleSpace();
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
EditorGUILayout.Space(5);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Persistent popup window for method filtering with multi-selection support
|
||||
/// </summary>
|
||||
public class MethodFilterWindow : EditorWindow
|
||||
{
|
||||
private HashSet<string> availableTags;
|
||||
private HashSet<string> selectedTags;
|
||||
private System.Action<HashSet<string>> onApply;
|
||||
private Vector2 scrollPosition;
|
||||
private string searchFilter = "";
|
||||
|
||||
public static void ShowWindow(CustomLogWindow parent, HashSet<string> available, HashSet<string> selected,
|
||||
System.Action<HashSet<string>> applyCallback)
|
||||
{
|
||||
var window = CreateInstance<MethodFilterWindow>();
|
||||
window.titleContent = new GUIContent("Method Filter");
|
||||
window.availableTags = available;
|
||||
window.selectedTags = new HashSet<string>(selected);
|
||||
window.onApply = applyCallback;
|
||||
|
||||
var parentRect = parent.position;
|
||||
window.position = new Rect(parentRect.x + 50, parentRect.y + 50, 300, 400);
|
||||
window.ShowUtility();
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
EditorGUILayout.Space(5);
|
||||
|
||||
// Control buttons
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
if (GUILayout.Button("All", GUILayout.Width(60)))
|
||||
{
|
||||
if (availableTags != null)
|
||||
selectedTags = new HashSet<string>(availableTags);
|
||||
}
|
||||
if (GUILayout.Button("None", GUILayout.Width(60)))
|
||||
{
|
||||
selectedTags.Clear();
|
||||
}
|
||||
GUILayout.FlexibleSpace();
|
||||
searchFilter = EditorGUILayout.TextField(searchFilter, EditorStyles.toolbarSearchField, GUILayout.Width(150));
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
EditorGUILayout.Space(5);
|
||||
|
||||
// Scrollable list of toggles
|
||||
scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition);
|
||||
|
||||
if (availableTags != null && availableTags.Count > 0)
|
||||
{
|
||||
var filteredTags = string.IsNullOrEmpty(searchFilter)
|
||||
? availableTags.OrderBy(t => t)
|
||||
: availableTags.Where(t => t.Contains(searchFilter, StringComparison.OrdinalIgnoreCase)).OrderBy(t => t);
|
||||
|
||||
foreach (var tag in filteredTags)
|
||||
{
|
||||
bool isSelected = selectedTags.Contains(tag);
|
||||
bool newSelection = EditorGUILayout.ToggleLeft(tag, isSelected);
|
||||
|
||||
if (newSelection != isSelected)
|
||||
{
|
||||
if (newSelection)
|
||||
selectedTags.Add(tag);
|
||||
else
|
||||
selectedTags.Remove(tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
EditorGUILayout.HelpBox("No methods available", MessageType.Info);
|
||||
}
|
||||
|
||||
EditorGUILayout.EndScrollView();
|
||||
|
||||
EditorGUILayout.Space(5);
|
||||
|
||||
// Apply/Close buttons
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
GUILayout.FlexibleSpace();
|
||||
|
||||
if (GUILayout.Button("Apply", GUILayout.Width(80)))
|
||||
{
|
||||
onApply?.Invoke(selectedTags);
|
||||
Close();
|
||||
}
|
||||
|
||||
if (GUILayout.Button("Close", GUILayout.Width(80)))
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
GUILayout.FlexibleSpace();
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
EditorGUILayout.Space(5);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Persistent popup window for log level filtering with multi-selection support
|
||||
/// </summary>
|
||||
public class LevelFilterWindow : EditorWindow
|
||||
{
|
||||
private HashSet<LogLevel> selectedLevels;
|
||||
private System.Action<HashSet<LogLevel>> onApply;
|
||||
|
||||
public static void ShowWindow(CustomLogWindow parent, HashSet<LogLevel> selected,
|
||||
System.Action<HashSet<LogLevel>> applyCallback)
|
||||
{
|
||||
var window = CreateInstance<LevelFilterWindow>();
|
||||
window.titleContent = new GUIContent("Log Level Filter");
|
||||
window.selectedLevels = new HashSet<LogLevel>(selected);
|
||||
window.onApply = applyCallback;
|
||||
|
||||
var parentRect = parent.position;
|
||||
window.position = new Rect(parentRect.x + 50, parentRect.y + 50, 250, 180);
|
||||
window.ShowUtility();
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
EditorGUILayout.Space(5);
|
||||
|
||||
// Control buttons
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
if (GUILayout.Button("All", GUILayout.Width(60)))
|
||||
{
|
||||
selectedLevels = new HashSet<LogLevel>
|
||||
{
|
||||
LogLevel.Debug, LogLevel.Info, LogLevel.Warning, LogLevel.Error
|
||||
};
|
||||
}
|
||||
if (GUILayout.Button("None", GUILayout.Width(60)))
|
||||
{
|
||||
selectedLevels.Clear();
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
EditorGUILayout.Space(10);
|
||||
|
||||
// Log level toggles
|
||||
foreach (LogLevel level in Enum.GetValues(typeof(LogLevel)))
|
||||
{
|
||||
bool isSelected = selectedLevels.Contains(level);
|
||||
bool newSelection = EditorGUILayout.ToggleLeft(level.ToString(), isSelected);
|
||||
|
||||
if (newSelection != isSelected)
|
||||
{
|
||||
if (newSelection)
|
||||
selectedLevels.Add(level);
|
||||
else
|
||||
selectedLevels.Remove(level);
|
||||
}
|
||||
}
|
||||
|
||||
EditorGUILayout.Space(10);
|
||||
|
||||
// Apply/Close buttons
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
GUILayout.FlexibleSpace();
|
||||
|
||||
if (GUILayout.Button("Apply", GUILayout.Width(80)))
|
||||
{
|
||||
onApply?.Invoke(selectedLevels);
|
||||
Close();
|
||||
}
|
||||
|
||||
if (GUILayout.Button("Close", GUILayout.Width(80)))
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
GUILayout.FlexibleSpace();
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
EditorGUILayout.Space(5);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Popup window for configuring time range filters
|
||||
/// </summary>
|
||||
public class TimeRangeFilterWindow : EditorWindow
|
||||
{
|
||||
private bool enableTimeFilter;
|
||||
private float minTimestamp;
|
||||
private float maxTimestamp;
|
||||
private float currentMaxTimestamp;
|
||||
private System.Action<bool, float, float> onApply;
|
||||
|
||||
public static void ShowWindow(CustomLogWindow parent, bool enabled, float min, float max, float currentMax,
|
||||
System.Action<bool, float, float> applyCallback)
|
||||
{
|
||||
var window = CreateInstance<TimeRangeFilterWindow>();
|
||||
window.titleContent = new GUIContent("Time Range Filter");
|
||||
window.enableTimeFilter = enabled;
|
||||
window.minTimestamp = min;
|
||||
window.maxTimestamp = max;
|
||||
window.currentMaxTimestamp = currentMax;
|
||||
window.onApply = applyCallback;
|
||||
|
||||
// Position near the parent window
|
||||
var parentRect = parent.position;
|
||||
window.position = new Rect(parentRect.x + 100, parentRect.y + 100, 350, 120);
|
||||
|
||||
window.ShowUtility();
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
EditorGUILayout.Space(10);
|
||||
|
||||
enableTimeFilter = EditorGUILayout.Toggle("Enable Time Filter", enableTimeFilter);
|
||||
|
||||
EditorGUILayout.Space(5);
|
||||
|
||||
if (enableTimeFilter && currentMaxTimestamp > 0)
|
||||
{
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
EditorGUILayout.LabelField($"Min: {minTimestamp:F2}s", GUILayout.Width(100));
|
||||
EditorGUILayout.LabelField($"Max: {maxTimestamp:F2}s", GUILayout.Width(100));
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
EditorGUILayout.MinMaxSlider(
|
||||
ref minTimestamp,
|
||||
ref maxTimestamp,
|
||||
0,
|
||||
currentMaxTimestamp);
|
||||
|
||||
EditorGUILayout.Space(5);
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
if (GUILayout.Button("Reset Range"))
|
||||
{
|
||||
minTimestamp = 0;
|
||||
maxTimestamp = currentMaxTimestamp;
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
}
|
||||
else if (enableTimeFilter)
|
||||
{
|
||||
EditorGUILayout.HelpBox("No logs available for time filtering", MessageType.Info);
|
||||
}
|
||||
|
||||
EditorGUILayout.Space(10);
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
GUILayout.FlexibleSpace();
|
||||
|
||||
if (GUILayout.Button("Apply", GUILayout.Width(80)))
|
||||
{
|
||||
onApply?.Invoke(enableTimeFilter, minTimestamp, maxTimestamp);
|
||||
Close();
|
||||
}
|
||||
|
||||
if (GUILayout.Button("Cancel", GUILayout.Width(80)))
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
GUILayout.FlexibleSpace();
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
EditorGUILayout.Space(10);
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Editor/CustomLogWindow.cs.meta
Normal file
3
Assets/Editor/CustomLogWindow.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 60a300585fef4ac990c963c8b37c3887
|
||||
timeCreated: 1762814971
|
||||
@@ -181,7 +181,7 @@ namespace Editor
|
||||
string scenePath = AssetDatabase.GUIDToAssetPath(guid);
|
||||
var scene = EditorSceneManager.OpenScene(scenePath, OpenSceneMode.Additive);
|
||||
|
||||
var allComponents = GameObject.FindObjectsOfType<Component>(true);
|
||||
var allComponents = GameObject.FindObjectsByType<Component>(FindObjectsInactive.Include, FindObjectsSortMode.None);
|
||||
foreach (var component in allComponents)
|
||||
{
|
||||
if (component == null || component.gameObject.scene != scene) continue;
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Editor.Lifecycle
|
||||
/// Editor-only bootstrap that ensures OnSceneReady is triggered when playing directly from a scene in Unity Editor.
|
||||
///
|
||||
/// PROBLEM: When you press Play in the editor without going through the scene manager:
|
||||
/// - CustomBoot runs and triggers OnBootCompletionTriggered (which broadcasts OnManagedAwake)
|
||||
/// - CustomBoot runs and triggers OnBootCompletionTriggered (which broadcasts OnManagedStart)
|
||||
/// - But BroadcastSceneReady is NEVER called for the initial scene
|
||||
/// - Components in the scene never receive their OnSceneReady() callback
|
||||
///
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
using UnityEditor;
|
||||
using AppleHills.Core.Settings;
|
||||
using Core;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering.VirtualTexturing;
|
||||
|
||||
namespace AppleHills.Editor
|
||||
{
|
||||
@@ -65,7 +63,7 @@ namespace AppleHills.Editor
|
||||
GetPuzzlePromptRange
|
||||
);
|
||||
|
||||
LogDebugMessage("Editor settings loaded for Scene View use");
|
||||
Logging.Debug("Editor settings loaded for Scene View use");
|
||||
}
|
||||
|
||||
public static void RefreshSceneViews()
|
||||
@@ -102,14 +100,5 @@ namespace AppleHills.Editor
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static void LogDebugMessage(string message)
|
||||
{
|
||||
if (Application.isPlaying &&
|
||||
DeveloperSettingsProvider.Instance.GetSettings<DebugSettings>().settingsLogVerbosity <= LogVerbosity.Debug)
|
||||
{
|
||||
Logging.Debug($"[EditorSettingsProvider] {message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,153 +0,0 @@
|
||||
using Interactions;
|
||||
using PuzzleS;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Editor
|
||||
{
|
||||
public class ItemPrefabEditorWindow : EditorWindow
|
||||
{
|
||||
private GameObject _selectedGameObject;
|
||||
private InteractableBase _interactable;
|
||||
private PickupItemData _pickupData;
|
||||
private PuzzleStepSO _objectiveData;
|
||||
private UnityEditor.Editor _soEditor;
|
||||
private string _pickupSoFolderPath = "Assets/Data/Items";
|
||||
private string _puzzleSoFolderPath = "Assets/Data/Puzzles";
|
||||
|
||||
private enum ItemType { None, Pickup, ItemSlot }
|
||||
private ItemType _itemType = ItemType.None;
|
||||
|
||||
[MenuItem("AppleHills/Item Prefab Editor")]
|
||||
public static void ShowWindow()
|
||||
{
|
||||
var window = GetWindow<ItemPrefabEditorWindow>("Item Prefab Editor");
|
||||
window.minSize = new Vector2(400, 400);
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
Selection.selectionChanged += Repaint;
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
Selection.selectionChanged -= Repaint;
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
_selectedGameObject = null;
|
||||
_interactable = null;
|
||||
if (Selection.activeGameObject != null)
|
||||
{
|
||||
_selectedGameObject = Selection.activeGameObject;
|
||||
_interactable = _selectedGameObject.GetComponent<InteractableBase>();
|
||||
}
|
||||
else if (Selection.activeObject is GameObject go)
|
||||
{
|
||||
_selectedGameObject = go;
|
||||
_interactable = go.GetComponent<InteractableBase>();
|
||||
}
|
||||
|
||||
if (_selectedGameObject == null || _interactable == null)
|
||||
{
|
||||
EditorGUILayout.HelpBox("Select a GameObject or prefab with an InteractableBase component to edit.", MessageType.Info);
|
||||
return;
|
||||
}
|
||||
|
||||
EditorGUILayout.LabelField("Editing: ", _selectedGameObject.name, EditorStyles.boldLabel);
|
||||
EditorGUILayout.Space();
|
||||
|
||||
// Determine current type
|
||||
bool hasPickup = _selectedGameObject.GetComponent<Pickup>() != null;
|
||||
bool hasSlot = _selectedGameObject.GetComponent<ItemSlot>() != null;
|
||||
if (hasSlot) _itemType = ItemType.ItemSlot;
|
||||
else if (hasPickup) _itemType = ItemType.Pickup;
|
||||
else _itemType = ItemType.None;
|
||||
|
||||
// Item type selection
|
||||
var newType = (ItemType)EditorGUILayout.EnumPopup("Item Type", _itemType);
|
||||
if (newType != _itemType)
|
||||
{
|
||||
// Remove both, then add selected
|
||||
PrefabEditorUtility.RemoveComponent<Pickup>(_selectedGameObject);
|
||||
PrefabEditorUtility.RemoveComponent<ItemSlot>(_selectedGameObject);
|
||||
if (newType == ItemType.Pickup)
|
||||
PrefabEditorUtility.AddOrGetComponent<Pickup>(_selectedGameObject);
|
||||
else if (newType == ItemType.ItemSlot)
|
||||
PrefabEditorUtility.AddOrGetComponent<ItemSlot>(_selectedGameObject);
|
||||
_itemType = newType;
|
||||
}
|
||||
|
||||
// ObjectiveStepBehaviour
|
||||
bool hasObjective = _selectedGameObject.GetComponent<ObjectiveStepBehaviour>() != null;
|
||||
bool addObjective = EditorGUILayout.Toggle("ObjectiveStepBehaviour", hasObjective);
|
||||
if (addObjective && !hasObjective)
|
||||
{
|
||||
PrefabEditorUtility.AddOrGetComponent<ObjectiveStepBehaviour>(_selectedGameObject);
|
||||
}
|
||||
else if (!addObjective && hasObjective)
|
||||
{
|
||||
PrefabEditorUtility.RemoveComponent<ObjectiveStepBehaviour>(_selectedGameObject);
|
||||
}
|
||||
|
||||
// Pickup Data (for Pickup or ItemSlot)
|
||||
if (_itemType == ItemType.Pickup || _itemType == ItemType.ItemSlot)
|
||||
{
|
||||
var pickup = _selectedGameObject.GetComponent<Pickup>();
|
||||
_pickupData = pickup.itemData;
|
||||
EditorGUILayout.LabelField("Pickup Data:", EditorStyles.boldLabel);
|
||||
_pickupData = (PickupItemData)EditorGUILayout.ObjectField("PickupItemData", _pickupData, typeof(PickupItemData), false);
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
EditorGUILayout.PrefixLabel("Save To");
|
||||
EditorGUILayout.SelectableLabel(_pickupSoFolderPath, EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
|
||||
if (GUILayout.Button("Select...", GUILayout.Width(80)))
|
||||
{
|
||||
_pickupSoFolderPath = PrefabEditorUtility.SelectFolder(_pickupSoFolderPath, "Data/Items");
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
if (_pickupData == null && GUILayout.Button("Create New PickupItemData"))
|
||||
{
|
||||
_pickupData = PrefabEditorUtility.CreateScriptableAsset<PickupItemData>(_selectedGameObject.name + "_pickup", _pickupSoFolderPath);
|
||||
}
|
||||
if (_pickupData != null)
|
||||
{
|
||||
PrefabEditorUtility.DrawScriptableObjectEditor(ref _soEditor, _pickupData);
|
||||
pickup.itemData = _pickupData;
|
||||
}
|
||||
}
|
||||
|
||||
// Objective Data
|
||||
if (addObjective)
|
||||
{
|
||||
var obj = _selectedGameObject.GetComponent<ObjectiveStepBehaviour>();
|
||||
_objectiveData = obj.stepData;
|
||||
EditorGUILayout.LabelField("Objective Data:", EditorStyles.boldLabel);
|
||||
_objectiveData = (PuzzleStepSO)EditorGUILayout.ObjectField("PuzzleStepSO", _objectiveData, typeof(PuzzleStepSO), false);
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
EditorGUILayout.PrefixLabel("Save To");
|
||||
EditorGUILayout.SelectableLabel(_puzzleSoFolderPath, EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
|
||||
if (GUILayout.Button("Select...", GUILayout.Width(80)))
|
||||
{
|
||||
_puzzleSoFolderPath = PrefabEditorUtility.SelectFolder(_puzzleSoFolderPath, "Data/Puzzles");
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
if (_objectiveData == null && GUILayout.Button("Create New PuzzleStepSO"))
|
||||
{
|
||||
_objectiveData = PrefabEditorUtility.CreateScriptableAsset<PuzzleStepSO>(_selectedGameObject.name + "_puzzle", _puzzleSoFolderPath);
|
||||
}
|
||||
if (_objectiveData != null)
|
||||
{
|
||||
PrefabEditorUtility.DrawScriptableObjectEditor(ref _soEditor, _objectiveData);
|
||||
obj.stepData = _objectiveData;
|
||||
}
|
||||
}
|
||||
if (GUI.changed)
|
||||
{
|
||||
EditorUtility.SetDirty(_selectedGameObject);
|
||||
PrefabUtility.RecordPrefabInstancePropertyModifications(_selectedGameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 943b203cde5343c68a6278c111fce2ed
|
||||
timeCreated: 1757508162
|
||||
@@ -1,168 +0,0 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using System.IO;
|
||||
using Interactions;
|
||||
using PuzzleS;
|
||||
|
||||
namespace Editor
|
||||
{
|
||||
public class PrefabCreatorWindow : EditorWindow
|
||||
{
|
||||
private string _prefabName = "NewPrefab";
|
||||
private string _saveFolderPath = "Assets/Prefabs/Items";
|
||||
private string _pickupSoFolderPath = "Assets/Data/Items";
|
||||
private string _puzzleSoFolderPath = "Assets/Data/Puzzles";
|
||||
private bool _addObjective;
|
||||
|
||||
private PickupItemData _pickupData;
|
||||
private PuzzleStepSO _objectiveData;
|
||||
private UnityEditor.Editor _soEditor;
|
||||
|
||||
private enum ItemType { None, Pickup, ItemSlot }
|
||||
private ItemType _itemType = ItemType.None;
|
||||
|
||||
private bool _createNext = false;
|
||||
|
||||
[MenuItem("AppleHills/Item Prefab Creator")]
|
||||
public static void ShowWindow()
|
||||
{
|
||||
var window = GetWindow<PrefabCreatorWindow>("Prefab Creator");
|
||||
window.minSize = new Vector2(400, 400);
|
||||
// Set default paths if not already set
|
||||
if (string.IsNullOrEmpty(window._saveFolderPath))
|
||||
window._saveFolderPath = "Assets/Prefabs/Items";
|
||||
if (string.IsNullOrEmpty(window._pickupSoFolderPath))
|
||||
window._pickupSoFolderPath = "Assets/Data/Items";
|
||||
if (string.IsNullOrEmpty(window._puzzleSoFolderPath))
|
||||
window._puzzleSoFolderPath = "Assets/Data/Puzzles";
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
EditorGUILayout.LabelField("Prefab Creator", EditorStyles.boldLabel);
|
||||
_prefabName = EditorGUILayout.TextField("Prefab Name", _prefabName);
|
||||
// Prefab save folder
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
EditorGUILayout.PrefixLabel("Save Folder");
|
||||
EditorGUILayout.SelectableLabel(_saveFolderPath, EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
|
||||
if (GUILayout.Button("Select...", GUILayout.Width(80)))
|
||||
{
|
||||
_saveFolderPath = PrefabEditorUtility.SelectFolder(_saveFolderPath, "Prefabs/Items");
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.LabelField("Add Components:", EditorStyles.boldLabel);
|
||||
|
||||
// Item type selection
|
||||
var newType = (ItemType)EditorGUILayout.EnumPopup("Item Type", _itemType);
|
||||
if (newType != _itemType)
|
||||
{
|
||||
_itemType = newType;
|
||||
}
|
||||
bool addObjective = EditorGUILayout.Toggle("ObjectiveStepBehaviour", _addObjective);
|
||||
_addObjective = addObjective;
|
||||
EditorGUILayout.Space();
|
||||
|
||||
// Pickup Data (for Pickup or ItemSlot)
|
||||
if (_itemType == ItemType.Pickup || _itemType == ItemType.ItemSlot)
|
||||
{
|
||||
EditorGUILayout.LabelField("Pickup Data:", EditorStyles.boldLabel);
|
||||
_pickupData = (PickupItemData)EditorGUILayout.ObjectField("PickupItemData", _pickupData, typeof(PickupItemData), false);
|
||||
// Pickup SO save folder
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
EditorGUILayout.PrefixLabel("Save To");
|
||||
EditorGUILayout.SelectableLabel(_pickupSoFolderPath, EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
|
||||
if (GUILayout.Button("Select...", GUILayout.Width(80)))
|
||||
{
|
||||
_pickupSoFolderPath = PrefabEditorUtility.SelectFolder(_pickupSoFolderPath, "Data/Items");
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
if (_pickupData == null && GUILayout.Button("Create New PickupItemData"))
|
||||
{
|
||||
_pickupData = PrefabEditorUtility.CreateScriptableAsset<PickupItemData>(_prefabName + "_pickup", _pickupSoFolderPath);
|
||||
}
|
||||
if (_pickupData != null)
|
||||
{
|
||||
PrefabEditorUtility.DrawScriptableObjectEditor(ref _soEditor, _pickupData);
|
||||
}
|
||||
}
|
||||
// Objective Data
|
||||
if (_addObjective)
|
||||
{
|
||||
EditorGUILayout.LabelField("Objective Data:", EditorStyles.boldLabel);
|
||||
_objectiveData = (PuzzleStepSO)EditorGUILayout.ObjectField("PuzzleStepSO", _objectiveData, typeof(PuzzleStepSO), false);
|
||||
// Puzzle SO save folder
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
EditorGUILayout.PrefixLabel("Save To");
|
||||
EditorGUILayout.SelectableLabel(_puzzleSoFolderPath, EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
|
||||
if (GUILayout.Button("Select...", GUILayout.Width(80)))
|
||||
{
|
||||
_puzzleSoFolderPath = PrefabEditorUtility.SelectFolder(_puzzleSoFolderPath, "Data/Puzzles");
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
if (_objectiveData == null && GUILayout.Button("Create New PuzzleStepSO"))
|
||||
{
|
||||
_objectiveData = PrefabEditorUtility.CreateScriptableAsset<PuzzleStepSO>(_prefabName + "_puzzle", _puzzleSoFolderPath);
|
||||
}
|
||||
if (_objectiveData != null)
|
||||
{
|
||||
PrefabEditorUtility.DrawScriptableObjectEditor(ref _soEditor, _objectiveData);
|
||||
}
|
||||
}
|
||||
GUILayout.FlexibleSpace();
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
GUI.enabled = !string.IsNullOrEmpty(_prefabName) && !string.IsNullOrEmpty(_saveFolderPath);
|
||||
if (GUILayout.Button("Create Prefab", GUILayout.Height(28)))
|
||||
{
|
||||
CreatePrefab();
|
||||
}
|
||||
_createNext = GUILayout.Toggle(_createNext, "Create Next", GUILayout.Width(100), GUILayout.Height(28));
|
||||
GUI.enabled = true;
|
||||
EditorGUILayout.EndHorizontal();
|
||||
}
|
||||
|
||||
private void CreatePrefab()
|
||||
{
|
||||
var go = new GameObject(_prefabName);
|
||||
// Note: No need to add InteractableBase separately - Pickup and ItemSlot inherit from it
|
||||
go.AddComponent<BoxCollider>();
|
||||
int interactableLayer = LayerMask.NameToLayer("Interactable");
|
||||
if (interactableLayer != -1)
|
||||
go.layer = interactableLayer;
|
||||
go.AddComponent<SpriteRenderer>();
|
||||
if (_itemType == ItemType.Pickup)
|
||||
{
|
||||
var pickup = go.AddComponent<Pickup>();
|
||||
pickup.itemData = _pickupData;
|
||||
}
|
||||
else if (_itemType == ItemType.ItemSlot)
|
||||
{
|
||||
var slot = go.AddComponent<ItemSlot>();
|
||||
slot.itemData = _pickupData;
|
||||
}
|
||||
if (_addObjective)
|
||||
{
|
||||
var obj = go.AddComponent<ObjectiveStepBehaviour>();
|
||||
obj.stepData = _objectiveData;
|
||||
}
|
||||
string prefabPath = Path.Combine(_saveFolderPath, _prefabName + ".prefab").Replace("\\", "/");
|
||||
var prefab = PrefabUtility.SaveAsPrefabAsset(go, prefabPath);
|
||||
DestroyImmediate(go);
|
||||
AssetDatabase.Refresh();
|
||||
Selection.activeObject = prefab;
|
||||
EditorGUIUtility.PingObject(prefab);
|
||||
EditorUtility.DisplayDialog("Prefab Created", $"Prefab saved to {prefabPath}", "OK");
|
||||
if (_createNext)
|
||||
{
|
||||
_prefabName = "NewPrefab";
|
||||
_pickupData = null;
|
||||
_objectiveData = null;
|
||||
_itemType = ItemType.None;
|
||||
_addObjective = false;
|
||||
_soEditor = null;
|
||||
GUI.FocusControl(null);
|
||||
Repaint();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f67e06e997f642509ba61ea12b0f793e
|
||||
timeCreated: 1757503955
|
||||
@@ -248,7 +248,9 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 2bd397a60643eed45b586961ae6e3453, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: AppleHillsScripts::PulverAudioController
|
||||
audioSource: {fileID: 887004370483616855}
|
||||
combineAudio: {fileID: 8300000, guid: 768a16f348fe1d94c9cc267dc7ecf3b5, type: 3}
|
||||
itemManager: {fileID: 0}
|
||||
--- !u!82 &4467608046243604209
|
||||
AudioSource:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
267
Assets/Prefabs/Managers/CinematicSprites.prefab
Normal file
267
Assets/Prefabs/Managers/CinematicSprites.prefab
Normal file
@@ -0,0 +1,267 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &3880639403919980708
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 491766053509356801}
|
||||
- component: {fileID: 8990835369174097178}
|
||||
- component: {fileID: 4081412022221009731}
|
||||
- component: {fileID: 7110521945075217718}
|
||||
- component: {fileID: 7238901747877844110}
|
||||
m_Layer: 5
|
||||
m_Name: CinematicSprites
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
--- !u!224 &491766053509356801
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3880639403919980708}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 5590617373016130179}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &8990835369174097178
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3880639403919980708}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &4081412022221009731
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3880639403919980708}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: 521b8943618ee4941a59b55cba521053, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!95 &7110521945075217718
|
||||
Animator:
|
||||
serializedVersion: 7
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3880639403919980708}
|
||||
m_Enabled: 1
|
||||
m_Avatar: {fileID: 0}
|
||||
m_Controller: {fileID: 9100000, guid: e2a3b3586acd1ea4097d75c6f7d0cf0a, type: 2}
|
||||
m_CullingMode: 0
|
||||
m_UpdateMode: 0
|
||||
m_ApplyRootMotion: 0
|
||||
m_LinearVelocityBlending: 0
|
||||
m_StabilizeFeet: 0
|
||||
m_AnimatePhysics: 0
|
||||
m_WarningMessage:
|
||||
m_HasTransformHierarchy: 1
|
||||
m_AllowConstantClipSamplingOptimization: 1
|
||||
m_KeepAnimatorStateOnDisable: 0
|
||||
m_WriteDefaultValuesOnDisable: 0
|
||||
--- !u!114 &7238901747877844110
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3880639403919980708}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5526348c1593f9b43987b0edcaccdd24, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: '::'
|
||||
holdDuration: 1
|
||||
radialProgressBar: {fileID: 7802237016353117620}
|
||||
--- !u!1 &4881325085870413093
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8394866771001925093}
|
||||
- component: {fileID: 6474291411781573184}
|
||||
- component: {fileID: 3495568374332906101}
|
||||
m_Layer: 5
|
||||
m_Name: Image
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &8394866771001925093
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4881325085870413093}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 5590617373016130179}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.2, y: 0.2}
|
||||
m_AnchorMax: {x: 0.8, y: 0.8}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &6474291411781573184
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4881325085870413093}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &3495568374332906101
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4881325085870413093}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: -5941552768301239376, guid: 300528d856c15824989bade57a7e04e4, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!1 &8647185569012928468
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5590617373016130179}
|
||||
- component: {fileID: 5038311757077579968}
|
||||
- component: {fileID: 7802237016353117620}
|
||||
m_Layer: 5
|
||||
m_Name: SkipProgress
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &5590617373016130179
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8647185569012928468}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 8394866771001925093}
|
||||
m_Father: {fileID: 491766053509356801}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 1, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 0}
|
||||
m_AnchoredPosition: {x: -56, y: 64}
|
||||
m_SizeDelta: {x: 250, y: 250}
|
||||
m_Pivot: {x: 1, y: 0}
|
||||
--- !u!222 &5038311757077579968
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8647185569012928468}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &7802237016353117620
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8647185569012928468}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 2758595457390328306, guid: bcd3fab43168dbd43a286294c6cc7838, type: 3}
|
||||
m_Type: 3
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 0
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 774e30e3f0b1d0d49bad0c2abf11038a
|
||||
guid: 28ef853079fd9524f970703cd64bd0c0
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
@@ -11,7 +11,6 @@ GameObject:
|
||||
- component: {fileID: 1965178107275650778}
|
||||
- component: {fileID: 2828019556092814789}
|
||||
- component: {fileID: 3751190220360366860}
|
||||
- component: {fileID: 803378854493527400}
|
||||
m_Layer: 0
|
||||
m_Name: SpilSlut
|
||||
m_TagString: Untagged
|
||||
@@ -93,7 +92,7 @@ MonoBehaviour:
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 136.55
|
||||
m_fontSize: 136.85
|
||||
m_fontSizeBase: 72
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 1
|
||||
@@ -137,95 +136,6 @@ MonoBehaviour:
|
||||
m_hasFontAssetChanged: 0
|
||||
m_baseMaterial: {fileID: 0}
|
||||
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
|
||||
--- !u!114 &803378854493527400
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 663813761358815781}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 86710e43de46f6f4bac7c8e50813a599, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.AspectRatioFitter
|
||||
m_AspectMode: 1
|
||||
m_AspectRatio: 12
|
||||
--- !u!1 &671326379795878693
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4498104668003212261}
|
||||
- component: {fileID: 1384216111310773312}
|
||||
- component: {fileID: 8822046367999630453}
|
||||
m_Layer: 5
|
||||
m_Name: Image
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &4498104668003212261
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 671326379795878693}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 538506048417711235}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.2, y: 0.2}
|
||||
m_AnchorMax: {x: 0.8, y: 0.8}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &1384216111310773312
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 671326379795878693}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &8822046367999630453
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 671326379795878693}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: -5941552768301239376, guid: 300528d856c15824989bade57a7e04e4, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!1 &1519948061307491961
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -498,9 +408,9 @@ RectTransform:
|
||||
m_Children: []
|
||||
m_Father: {fileID: 754661265897109340}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 683.9956, y: -157.62965}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 640.62054, y: 0}
|
||||
m_SizeDelta: {x: 268, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &1768576830901014477
|
||||
@@ -642,8 +552,6 @@ RectTransform:
|
||||
m_LocalScale: {x: 0, y: 0, z: 0}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 4978134902377398530}
|
||||
- {fileID: 5494371867874695937}
|
||||
- {fileID: 5708275729410901669}
|
||||
m_Father: {fileID: 5006436358316225511}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@@ -725,7 +633,6 @@ GameObject:
|
||||
m_Component:
|
||||
- component: {fileID: 5006436358316225511}
|
||||
- component: {fileID: 4093256939237236730}
|
||||
- component: {fileID: 291412605997816487}
|
||||
m_Layer: 0
|
||||
m_Name: CinematicsManager
|
||||
m_TagString: Untagged
|
||||
@@ -761,47 +668,10 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 4e3cd69fd77a22640aa40e691d8d6c26, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: AppleHillsScripts::CinematicsManager
|
||||
cinematicSpritesGameObject: {fileID: 9166576207668444836}
|
||||
cinematicBackground: {fileID: 3837694223035649714}
|
||||
cinematicSpritesGameObject: {fileID: 0}
|
||||
cinematicBackground: {fileID: 0}
|
||||
divingGameOverScreen: {fileID: 7927991410039509668}
|
||||
playableDirector: {fileID: 291412605997816487}
|
||||
--- !u!320 &291412605997816487
|
||||
PlayableDirector:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2755712733105741372}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_PlayableAsset: {fileID: 11400000, guid: 10f0c6cee53c1364198438ae185f38fe, type: 2}
|
||||
m_InitialState: 0
|
||||
m_WrapMode: 2
|
||||
m_DirectorUpdateMode: 2
|
||||
m_InitialTime: 0
|
||||
m_SceneBindings:
|
||||
- key: {fileID: -38993752814118673, guid: bf4679c9d0eb0994d9e0de37c045e99b, type: 2}
|
||||
value: {fileID: 2900690403017929526}
|
||||
- key: {fileID: 7845336411882145130, guid: 99c48feb9d744ba4eb579c3b631b9257, type: 2}
|
||||
value: {fileID: 2900690403017929526}
|
||||
- key: {fileID: -8222318252314758605, guid: bf4679c9d0eb0994d9e0de37c045e99b, type: 2}
|
||||
value: {fileID: 0}
|
||||
- key: {fileID: 7536617106820686252, guid: 10f0c6cee53c1364198438ae185f38fe, type: 2}
|
||||
value: {fileID: 0}
|
||||
- key: {fileID: 8636189198204744120, guid: 10f0c6cee53c1364198438ae185f38fe, type: 2}
|
||||
value: {fileID: 2900690403017929526}
|
||||
- key: {fileID: 139419469794405637, guid: bf4679c9d0eb0994d9e0de37c045e99b, type: 2}
|
||||
value: {fileID: 0}
|
||||
- key: {fileID: 8785081636201331406, guid: 400e13ef8f17b5841acd92120f67a092, type: 2}
|
||||
value: {fileID: 0}
|
||||
- key: {fileID: -446339716597930989, guid: 400e13ef8f17b5841acd92120f67a092, type: 2}
|
||||
value: {fileID: 2900690403017929526}
|
||||
- key: {fileID: -5410086080836277403, guid: 10f0c6cee53c1364198438ae185f38fe, type: 2}
|
||||
value: {fileID: 0}
|
||||
- key: {fileID: -427775867803860694, guid: 10f0c6cee53c1364198438ae185f38fe, type: 2}
|
||||
value: {fileID: 0}
|
||||
m_ExposedReferences:
|
||||
m_References: []
|
||||
playableDirector: {fileID: 0}
|
||||
--- !u!1 &3025814654250773583
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -938,158 +808,6 @@ MonoBehaviour:
|
||||
m_hasFontAssetChanged: 0
|
||||
m_baseMaterial: {fileID: 0}
|
||||
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
|
||||
--- !u!1 &3669323127008070100
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 538506048417711235}
|
||||
- component: {fileID: 1082932495279705792}
|
||||
- component: {fileID: 2786577800096043956}
|
||||
m_Layer: 5
|
||||
m_Name: SkipProgress
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &538506048417711235
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3669323127008070100}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 4498104668003212261}
|
||||
m_Father: {fileID: 5494371867874695937}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 1, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 0}
|
||||
m_AnchoredPosition: {x: -56, y: 64}
|
||||
m_SizeDelta: {x: 250, y: 250}
|
||||
m_Pivot: {x: 1, y: 0}
|
||||
--- !u!222 &1082932495279705792
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3669323127008070100}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &2786577800096043956
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3669323127008070100}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 2758595457390328306, guid: bcd3fab43168dbd43a286294c6cc7838, type: 3}
|
||||
m_Type: 3
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 0
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!1 &3837694223035649714
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4978134902377398530}
|
||||
- component: {fileID: 2314847656825276738}
|
||||
- component: {fileID: 923855569538630903}
|
||||
m_Layer: 5
|
||||
m_Name: CinematicBackground
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
--- !u!224 &4978134902377398530
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3837694223035649714}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 9195361253609918804}
|
||||
m_Father: {fileID: 592992386388815559}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: -0.0025634766, y: -1380.1166}
|
||||
m_SizeDelta: {x: 1920, y: 1399.7874}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2314847656825276738
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3837694223035649714}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &923855569538630903
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3837694223035649714}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!1 &3907121777593230662
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1255,15 +973,15 @@ RectTransform:
|
||||
m_GameObject: {fileID: 3935369085067290987}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_LocalScale: {x: 3, y: 3, z: 3}
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children: []
|
||||
m_Father: {fileID: 754661265897109340}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 174.99854, y: -157.62965}
|
||||
m_SizeDelta: {x: 150, y: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 270.45056, y: 0}
|
||||
m_SizeDelta: {x: 42, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2782310018074465201
|
||||
CanvasRenderer:
|
||||
@@ -1402,15 +1120,15 @@ RectTransform:
|
||||
m_GameObject: {fileID: 4068599104538777648}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_LocalScale: {x: 3, y: 3, z: 3}
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children: []
|
||||
m_Father: {fileID: 754661265897109340}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 1192.9927, y: -157.62965}
|
||||
m_SizeDelta: {x: 150, y: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 1010.7905, y: 0}
|
||||
m_SizeDelta: {x: 42, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &8344156654954553365
|
||||
CanvasRenderer:
|
||||
@@ -1530,7 +1248,6 @@ GameObject:
|
||||
m_Component:
|
||||
- component: {fileID: 754661265897109340}
|
||||
- component: {fileID: 7750609879083104855}
|
||||
- component: {fileID: 5441545775684538830}
|
||||
m_Layer: 0
|
||||
m_Name: Buttons
|
||||
m_TagString: Untagged
|
||||
@@ -1557,8 +1274,8 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.10938991, y: 0.11800001}
|
||||
m_AnchorMax: {x: 0.94400007, y: 0.41016972}
|
||||
m_AnchoredPosition: {x: 0, y: 4}
|
||||
m_SizeDelta: {x: 0, y: -4}
|
||||
m_AnchoredPosition: {x: -0.00024414062, y: 0}
|
||||
m_SizeDelta: {x: -86.75, y: -20.246}
|
||||
m_Pivot: {x: 0.5, y: 0}
|
||||
--- !u!114 &7750609879083104855
|
||||
MonoBehaviour:
|
||||
@@ -1578,214 +1295,11 @@ MonoBehaviour:
|
||||
m_Top: 0
|
||||
m_Bottom: 0
|
||||
m_ChildAlignment: 4
|
||||
m_Spacing: 100
|
||||
m_ChildForceExpandWidth: 1
|
||||
m_ChildForceExpandHeight: 1
|
||||
m_ChildControlWidth: 0
|
||||
m_ChildControlHeight: 0
|
||||
m_Spacing: 215.17
|
||||
m_ChildForceExpandWidth: 0
|
||||
m_ChildForceExpandHeight: 0
|
||||
m_ChildControlWidth: 1
|
||||
m_ChildControlHeight: 1
|
||||
m_ChildScaleWidth: 0
|
||||
m_ChildScaleHeight: 0
|
||||
m_ReverseArrangement: 0
|
||||
--- !u!114 &5441545775684538830
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8262879347725397662}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 86710e43de46f6f4bac7c8e50813a599, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.AspectRatioFitter
|
||||
m_AspectMode: 0
|
||||
m_AspectRatio: 4.3392572
|
||||
--- !u!1 &8938058918530086601
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 9195361253609918804}
|
||||
- component: {fileID: 6918160369029793220}
|
||||
- component: {fileID: 276527935528622190}
|
||||
m_Layer: 5
|
||||
m_Name: Image
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &9195361253609918804
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8938058918530086601}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 4978134902377398530}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 1733.7644}
|
||||
m_SizeDelta: {x: 1920, y: 2057.6729}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &6918160369029793220
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8938058918530086601}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &276527935528622190
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8938058918530086601}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.79215693, g: 0.9294118, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!1 &9166576207668444836
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5494371867874695937}
|
||||
- component: {fileID: 3902696341833554714}
|
||||
- component: {fileID: 8235080513953117507}
|
||||
- component: {fileID: 2900690403017929526}
|
||||
- component: {fileID: 3357796695825044110}
|
||||
m_Layer: 5
|
||||
m_Name: CinematicSprites
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
--- !u!224 &5494371867874695937
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9166576207668444836}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 538506048417711235}
|
||||
m_Father: {fileID: 592992386388815559}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &3902696341833554714
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9166576207668444836}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &8235080513953117507
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9166576207668444836}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: 521b8943618ee4941a59b55cba521053, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!95 &2900690403017929526
|
||||
Animator:
|
||||
serializedVersion: 7
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9166576207668444836}
|
||||
m_Enabled: 1
|
||||
m_Avatar: {fileID: 0}
|
||||
m_Controller: {fileID: 9100000, guid: e2a3b3586acd1ea4097d75c6f7d0cf0a, type: 2}
|
||||
m_CullingMode: 0
|
||||
m_UpdateMode: 0
|
||||
m_ApplyRootMotion: 0
|
||||
m_LinearVelocityBlending: 0
|
||||
m_StabilizeFeet: 0
|
||||
m_AnimatePhysics: 0
|
||||
m_WarningMessage:
|
||||
m_HasTransformHierarchy: 1
|
||||
m_AllowConstantClipSamplingOptimization: 1
|
||||
m_KeepAnimatorStateOnDisable: 0
|
||||
m_WriteDefaultValuesOnDisable: 0
|
||||
--- !u!114 &3357796695825044110
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9166576207668444836}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5526348c1593f9b43987b0edcaccdd24, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: '::'
|
||||
holdDuration: 1
|
||||
radialProgressBar: {fileID: 2786577800096043956}
|
||||
|
||||
1692
Assets/Prefabs/Managers/PlayerHUD.prefab
Normal file
1692
Assets/Prefabs/Managers/PlayerHUD.prefab
Normal file
File diff suppressed because it is too large
Load Diff
7
Assets/Prefabs/Managers/PlayerHUD.prefab.meta
Normal file
7
Assets/Prefabs/Managers/PlayerHUD.prefab.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7180ae585f0db8044ba048426f72d995
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -614,6 +614,7 @@ GameObject:
|
||||
- component: {fileID: 768265498311662326}
|
||||
- component: {fileID: 6338084184716153992}
|
||||
- component: {fileID: 253472492358066383}
|
||||
- component: {fileID: 7628818949793551399}
|
||||
m_Layer: 10
|
||||
m_Name: FakeChoco
|
||||
m_TagString: Untagged
|
||||
@@ -633,7 +634,8 @@ Transform:
|
||||
m_LocalPosition: {x: -6.784, y: -2.901, z: 0}
|
||||
m_LocalScale: {x: 0.7, y: 0.7, z: 0.7}
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children: []
|
||||
m_Children:
|
||||
- {fileID: 2205893234949555645}
|
||||
m_Father: {fileID: 1509867968154593713}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!212 &6338084184716153992
|
||||
@@ -740,6 +742,45 @@ BoxCollider2D:
|
||||
m_AutoTiling: 0
|
||||
m_Size: {x: 6, y: 6}
|
||||
m_EdgeRadius: 0
|
||||
--- !u!114 &7628818949793551399
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2391935521422290070}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 833a4ccef651449e973e623d9107bef5, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: AppleHillsScripts::Interactions.OneClickInteraction
|
||||
isOneTime: 0
|
||||
cooldown: -1
|
||||
characterToInteract: 2
|
||||
interactionStarted:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
interactionInterrupted:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
characterArrived:
|
||||
m_PersistentCalls:
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 5762733430166618195}
|
||||
m_TargetAssemblyTypeName: PicnicBehaviour, AppleHillsScripts
|
||||
m_MethodName: triedToStealChocolate
|
||||
m_Mode: 1
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
interactionComplete:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!1 &2728537141134591410
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1322,6 +1363,104 @@ GameObject:
|
||||
m_CorrespondingSourceObject: {fileID: 5383276844808284485, guid: afbb486e5456a20479aee4cf8bc949b6, type: 3}
|
||||
m_PrefabInstance: {fileID: 3750141998400252915}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1001 &7365721869475958115
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 768265498311662326}
|
||||
m_Modifications:
|
||||
- target: {fileID: 2991221189157356317, guid: f21581740b83b624cac5e6a8fa4d0f47, type: 3}
|
||||
propertyPath: m_LocalScale.x
|
||||
value: 0.3
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2991221189157356317, guid: f21581740b83b624cac5e6a8fa4d0f47, type: 3}
|
||||
propertyPath: m_LocalScale.y
|
||||
value: 0.3
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2991221189157356317, guid: f21581740b83b624cac5e6a8fa4d0f47, type: 3}
|
||||
propertyPath: m_LocalScale.z
|
||||
value: 0.3
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8506461915049351794, guid: f21581740b83b624cac5e6a8fa4d0f47, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: HighlightEffect
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8506461915049351794, guid: f21581740b83b624cac5e6a8fa4d0f47, type: 3}
|
||||
propertyPath: m_IsActive
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8693254833721559262, guid: f21581740b83b624cac5e6a8fa4d0f47, type: 3}
|
||||
propertyPath: m_LocalScale.x
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8693254833721559262, guid: f21581740b83b624cac5e6a8fa4d0f47, type: 3}
|
||||
propertyPath: m_LocalScale.y
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8693254833721559262, guid: f21581740b83b624cac5e6a8fa4d0f47, type: 3}
|
||||
propertyPath: m_LocalScale.z
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8693254833721559262, guid: f21581740b83b624cac5e6a8fa4d0f47, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8693254833721559262, guid: f21581740b83b624cac5e6a8fa4d0f47, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8693254833721559262, guid: f21581740b83b624cac5e6a8fa4d0f47, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8693254833721559262, guid: f21581740b83b624cac5e6a8fa4d0f47, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8693254833721559262, guid: f21581740b83b624cac5e6a8fa4d0f47, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8693254833721559262, guid: f21581740b83b624cac5e6a8fa4d0f47, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8693254833721559262, guid: f21581740b83b624cac5e6a8fa4d0f47, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8693254833721559262, guid: f21581740b83b624cac5e6a8fa4d0f47, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8693254833721559262, guid: f21581740b83b624cac5e6a8fa4d0f47, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8693254833721559262, guid: f21581740b83b624cac5e6a8fa4d0f47, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8693254833721559262, guid: f21581740b83b624cac5e6a8fa4d0f47, type: 3}
|
||||
propertyPath: m_ConstrainProportionsScale
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8998003315986923927, guid: f21581740b83b624cac5e6a8fa4d0f47, type: 3}
|
||||
propertyPath: m_SortingOrder
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: f21581740b83b624cac5e6a8fa4d0f47, type: 3}
|
||||
--- !u!4 &2205893234949555645 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 8693254833721559262, guid: f21581740b83b624cac5e6a8fa4d0f47, type: 3}
|
||||
m_PrefabInstance: {fileID: 7365721869475958115}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1001 &7995402114015427944
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1362,6 +1501,34 @@ PrefabInstance:
|
||||
propertyPath: m_SortingOrder
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2846246689251721816, guid: b3fc964bec385174f85a143f2fcff121, type: 3}
|
||||
propertyPath: interactionComplete.m_PersistentCalls.m_Calls.Array.size
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2846246689251721816, guid: b3fc964bec385174f85a143f2fcff121, type: 3}
|
||||
propertyPath: interactionComplete.m_PersistentCalls.m_Calls.Array.data[0].m_Mode
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2846246689251721816, guid: b3fc964bec385174f85a143f2fcff121, type: 3}
|
||||
propertyPath: interactionComplete.m_PersistentCalls.m_Calls.Array.data[0].m_Target
|
||||
value:
|
||||
objectReference: {fileID: 5762733430166618195}
|
||||
- target: {fileID: 2846246689251721816, guid: b3fc964bec385174f85a143f2fcff121, type: 3}
|
||||
propertyPath: interactionComplete.m_PersistentCalls.m_Calls.Array.data[0].m_CallState
|
||||
value: 2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2846246689251721816, guid: b3fc964bec385174f85a143f2fcff121, type: 3}
|
||||
propertyPath: interactionComplete.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
|
||||
value: destroyFakeChocolate
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2846246689251721816, guid: b3fc964bec385174f85a143f2fcff121, type: 3}
|
||||
propertyPath: interactionComplete.m_PersistentCalls.m_Calls.Array.data[0].m_TargetAssemblyTypeName
|
||||
value: PicnicBehaviour, AppleHillsScripts
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2846246689251721816, guid: b3fc964bec385174f85a143f2fcff121, type: 3}
|
||||
propertyPath: interactionComplete.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName
|
||||
value: UnityEngine.Object, UnityEngine
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3984039030829909690, guid: b3fc964bec385174f85a143f2fcff121, type: 3}
|
||||
propertyPath: m_LocalScale.x
|
||||
value: 0.7
|
||||
|
||||
@@ -135,13 +135,13 @@ AnimatorStateMachine:
|
||||
m_ChildStates:
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: -7925442279578022247}
|
||||
m_Position: {x: 400, y: 370, z: 0}
|
||||
m_Position: {x: 410, y: 370, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: -892202757677891130}
|
||||
m_Position: {x: -20, y: 260, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: 1937208649765278840}
|
||||
m_Position: {x: 489.1548, y: 156.18289, z: 0}
|
||||
m_Position: {x: 490, y: 150, z: 0}
|
||||
m_ChildStateMachines: []
|
||||
m_AnyStateTransitions: []
|
||||
m_EntryTransitions: []
|
||||
|
||||
@@ -120,6 +120,44 @@ MonoBehaviour:
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!1 &879012544333199198
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8293076336493130222}
|
||||
m_Layer: 5
|
||||
m_Name: Rainbows
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &8293076336493130222
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 879012544333199198}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 6108475066390421500}
|
||||
- {fileID: 6717870941799174515}
|
||||
- {fileID: 4136733570236406132}
|
||||
m_Father: {fileID: 1315170081792486277}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!1 &904161782565348054
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -166,7 +204,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 200}
|
||||
m_SizeDelta: {x: 1550, y: 700}
|
||||
m_SizeDelta: {x: 1550, y: 750}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!223 &4291423916360628965
|
||||
Canvas:
|
||||
@@ -252,7 +290,7 @@ MonoBehaviour:
|
||||
m_StartCorner: 0
|
||||
m_StartAxis: 0
|
||||
m_CellSize: {x: 350, y: 350}
|
||||
m_Spacing: {x: 50, y: 0}
|
||||
m_Spacing: {x: 50, y: 50}
|
||||
m_Constraint: 2
|
||||
m_ConstraintCount: 2
|
||||
--- !u!114 &7425566603516801919
|
||||
@@ -279,10 +317,8 @@ GameObject:
|
||||
m_Component:
|
||||
- component: {fileID: 1315170081792486277}
|
||||
- component: {fileID: 6669614972729775195}
|
||||
- component: {fileID: 1702317823502492223}
|
||||
- component: {fileID: 2981106092574900430}
|
||||
- component: {fileID: 8074691980395114238}
|
||||
- component: {fileID: 1630362919770549177}
|
||||
m_Layer: 5
|
||||
m_Name: AppSwitcher
|
||||
m_TagString: Untagged
|
||||
@@ -302,8 +338,7 @@ RectTransform:
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 6108475066390421500}
|
||||
- {fileID: 1495118611075801417}
|
||||
- {fileID: 8293076336493130222}
|
||||
- {fileID: 808554455652734252}
|
||||
- {fileID: 2831878373711017175}
|
||||
m_Father: {fileID: 0}
|
||||
@@ -336,29 +371,6 @@ Canvas:
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
m_TargetDisplay: 0
|
||||
--- !u!114 &1702317823502492223
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1498581815400593087}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.CanvasScaler
|
||||
m_UiScaleMode: 0
|
||||
m_ReferencePixelsPerUnit: 100
|
||||
m_ScaleFactor: 1
|
||||
m_ReferenceResolution: {x: 800, y: 600}
|
||||
m_ScreenMatchMode: 0
|
||||
m_MatchWidthOrHeight: 0
|
||||
m_PhysicalUnit: 3
|
||||
m_FallbackScreenDPI: 96
|
||||
m_DefaultSpriteDPI: 96
|
||||
m_DynamicPixelsPerUnit: 1
|
||||
m_PresetInfoIsWorld: 1
|
||||
--- !u!114 &2981106092574900430
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -388,36 +400,14 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: bac6124b3ada8a048a0b87a729a22312, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: '::'
|
||||
iconIdle: {fileID: 4900000, guid: 50e22b5bb8a496840952f2563758c13c, type: 3}
|
||||
iconEstablish: {fileID: 4900000, guid: 975218623da47f8428c484d886554a6c, type: 3}
|
||||
rainbowEstablish: {fileID: 4900000, guid: 622be2ef9d5e27d45a9deaf7ed805f5f, type: 3}
|
||||
rainbowRemove: {fileID: 4900000, guid: 589505308c5daf449800f30dd4b92ce7, type: 3}
|
||||
rainbow: {fileID: 5382650426034128680}
|
||||
icon: {fileID: 6784053660381911346}
|
||||
PageName:
|
||||
transitionDuration: 0.3
|
||||
rainbowIn: {fileID: 5382650426034128680}
|
||||
rainbowOut: {fileID: 3983328028282460839}
|
||||
gameLayoutContainer: {fileID: 904161782565348054}
|
||||
exitButton: {fileID: 8427602740714176801}
|
||||
--- !u!95 &1630362919770549177
|
||||
Animator:
|
||||
serializedVersion: 7
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1498581815400593087}
|
||||
m_Enabled: 1
|
||||
m_Avatar: {fileID: 0}
|
||||
m_Controller: {fileID: 9100000, guid: fc380d833ededb441a23b106de60bedd, type: 2}
|
||||
m_CullingMode: 0
|
||||
m_UpdateMode: 2
|
||||
m_ApplyRootMotion: 0
|
||||
m_LinearVelocityBlending: 0
|
||||
m_StabilizeFeet: 0
|
||||
m_AnimatePhysics: 0
|
||||
m_WarningMessage:
|
||||
m_HasTransformHierarchy: 1
|
||||
m_AllowConstantClipSamplingOptimization: 1
|
||||
m_KeepAnimatorStateOnDisable: 0
|
||||
m_WriteDefaultValuesOnDisable: 0
|
||||
rectMask: {fileID: 7425566603516801919}
|
||||
slideDuration: 0.6
|
||||
--- !u!1 &2426870979657684456
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -538,6 +528,99 @@ MonoBehaviour:
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!1 &3983328028282460839
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6717870941799174515}
|
||||
- component: {fileID: 6334910097310371923}
|
||||
- component: {fileID: 8821021733826365168}
|
||||
- component: {fileID: 9163925342151684341}
|
||||
m_Layer: 5
|
||||
m_Name: RainbowOut
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &6717870941799174515
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3983328028282460839}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 8293076336493130222}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &6334910097310371923
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3983328028282460839}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &8821021733826365168
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3983328028282460839}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.RawImage
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Texture: {fileID: 0}
|
||||
m_UVRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: -1
|
||||
--- !u!114 &9163925342151684341
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3983328028282460839}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 2fd09147b9e9d42a48d6ddc915ddc3d2, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: SkiaSharp.Unity::SkiaSharp.Unity.SkottiePlayerV2
|
||||
lottieFile: {fileID: 4900000, guid: 589505308c5daf449800f30dd4b92ce7, type: 3}
|
||||
customResolution: 0
|
||||
resWidth: 250
|
||||
resHeight: 250
|
||||
stateName:
|
||||
resetAfterFinished: 0
|
||||
autoPlay: 0
|
||||
loop: 0
|
||||
--- !u!1 &4270065472017787841
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -658,6 +741,81 @@ MonoBehaviour:
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!1 &4404111907760364827
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4136733570236406132}
|
||||
- component: {fileID: 102352512179716898}
|
||||
- component: {fileID: 3911817807614671446}
|
||||
m_Layer: 5
|
||||
m_Name: BackgroundOverlay
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &4136733570236406132
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4404111907760364827}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 8293076336493130222}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &102352512179716898
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4404111907760364827}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &3911817807614671446
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4404111907760364827}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0, g: 0, b: 0, a: 0.5019608}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!1 &5189738780074141096
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -791,7 +949,7 @@ GameObject:
|
||||
- component: {fileID: 7920249735731934357}
|
||||
- component: {fileID: 3566391948883171773}
|
||||
m_Layer: 5
|
||||
m_Name: Rainbow
|
||||
m_Name: RainbowIn
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
@@ -804,12 +962,12 @@ RectTransform:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5382650426034128680}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1315170081792486277}
|
||||
m_Father: {fileID: 8293076336493130222}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
@@ -991,156 +1149,6 @@ MonoBehaviour:
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!1 &6784053660381911346
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1495118611075801417}
|
||||
- component: {fileID: 9118909078554628244}
|
||||
- component: {fileID: 8490254979303535795}
|
||||
- component: {fileID: 4316986085632541161}
|
||||
- component: {fileID: 6597789131808754055}
|
||||
m_Layer: 5
|
||||
m_Name: Icon
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1495118611075801417
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6784053660381911346}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1315170081792486277}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 1, y: 1}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: -50, y: -50}
|
||||
m_SizeDelta: {x: 200, y: 200}
|
||||
m_Pivot: {x: 1, y: 1}
|
||||
--- !u!222 &9118909078554628244
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6784053660381911346}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &8490254979303535795
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6784053660381911346}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.RawImage
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Texture: {fileID: 0}
|
||||
m_UVRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: -1
|
||||
--- !u!114 &4316986085632541161
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6784053660381911346}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 2fd09147b9e9d42a48d6ddc915ddc3d2, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: SkiaSharp.Unity::SkiaSharp.Unity.SkottiePlayerV2
|
||||
lottieFile: {fileID: 4900000, guid: 50e22b5bb8a496840952f2563758c13c, type: 3}
|
||||
customResolution: 0
|
||||
resWidth: 250
|
||||
resHeight: 250
|
||||
stateName: Idle
|
||||
resetAfterFinished: 0
|
||||
autoPlay: 1
|
||||
loop: 1
|
||||
--- !u!114 &6597789131808754055
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6784053660381911346}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Button
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_WrapAround: 0
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_SelectedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 8490254979303535795}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 8074691980395114238}
|
||||
m_TargetAssemblyTypeName: AppSwitcher, AppleHillsScripts
|
||||
m_MethodName: OpenAppSwitcher
|
||||
m_Mode: 1
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
--- !u!1 &7713997083397969887
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1513,6 +1521,7 @@ GameObject:
|
||||
- component: {fileID: 5972191288640444065}
|
||||
- component: {fileID: 236099612463072939}
|
||||
- component: {fileID: 447310668687539451}
|
||||
- component: {fileID: 6704345904811573523}
|
||||
m_Layer: 5
|
||||
m_Name: CloseUIButton
|
||||
m_TagString: Untagged
|
||||
@@ -1623,7 +1632,7 @@ MonoBehaviour:
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 8074691980395114238}
|
||||
m_TargetAssemblyTypeName: AppSwitcher, AppleHillsScripts
|
||||
m_MethodName: CloseAppSwitcher
|
||||
m_MethodName: OnBackPressed
|
||||
m_Mode: 1
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
@@ -1633,3 +1642,15 @@ MonoBehaviour:
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
--- !u!114 &6704345904811573523
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8427602740714176801}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 494d0aedce9744308499355006071138, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: AppleHillsScripts::UI.DummyInput
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -34,7 +34,9 @@ RectTransform:
|
||||
- {fileID: 5027301639700053608}
|
||||
- {fileID: 2081116343754364062}
|
||||
- {fileID: 4830022034953347571}
|
||||
- {fileID: 4247146273316450423}
|
||||
- {fileID: 7968396929263690413}
|
||||
- {fileID: 1477338421424306197}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
@@ -79,7 +81,7 @@ MonoBehaviour:
|
||||
boosterDisappearDuration: 0.5
|
||||
impulseSource: {fileID: 4448843358972162772}
|
||||
openingParticleSystem: {fileID: 0}
|
||||
albumIcon: {fileID: 0}
|
||||
albumIcon: {fileID: 2290549912955623947}
|
||||
--- !u!114 &4448843358972162772
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -214,6 +216,170 @@ MonoBehaviour:
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
curveHeight: 50
|
||||
--- !u!1 &2290549912955623947
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4247146273316450423}
|
||||
- component: {fileID: 5793188825053435727}
|
||||
- component: {fileID: 5726314423424208945}
|
||||
- component: {fileID: 299670167085314888}
|
||||
- component: {fileID: 6513785969721658917}
|
||||
m_Layer: 5
|
||||
m_Name: ScrapbookButton
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &4247146273316450423
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2290549912955623947}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1.06667, y: 1.06667, z: 1.06667}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 5228380266581535650}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 80.000015, y: 79.999985}
|
||||
m_SizeDelta: {x: 241, y: 239}
|
||||
m_Pivot: {x: 0, y: 0}
|
||||
--- !u!222 &5793188825053435727
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2290549912955623947}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &5726314423424208945
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2290549912955623947}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: -4354454609415314374, guid: 1ba1f8cf73f79214190f1432fe1e3bc6, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &299670167085314888
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2290549912955623947}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Button
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_WrapAround: 0
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_SelectedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 5726314423424208945}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!114 &6513785969721658917
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2290549912955623947}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 494d0aedce9744308499355006071138, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: AppleHillsScripts::UI.DummyInput
|
||||
--- !u!1 &2898816812112041854
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1477338421424306197}
|
||||
m_Layer: 0
|
||||
m_Name: GameObject (1)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1477338421424306197
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2898816812112041854}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: -297.3595, y: -196.74738, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 5228380266581535650}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &4303341275909682426
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@@ -61,6 +61,43 @@ MonoBehaviour:
|
||||
targetBottomLeftOffset: {x: 100, y: 100}
|
||||
disappearDuration: 0.8
|
||||
disappearScale: 0.2
|
||||
--- !u!1 &2923535299741790846
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5109945643968698326}
|
||||
m_Layer: 0
|
||||
m_Name: BoosterContainer
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &5109945643968698326
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2923535299741790846}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 4006246129058447062}
|
||||
- {fileID: 3680365639323743419}
|
||||
m_Father: {fileID: 2499229096808986326}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 1}
|
||||
m_AnchorMax: {x: 0.5, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: -300}
|
||||
m_SizeDelta: {x: 750, y: 760}
|
||||
m_Pivot: {x: 0.5, y: 1}
|
||||
--- !u!1 &4323719263405703996
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -211,13 +248,13 @@ RectTransform:
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 2499229096808986326}
|
||||
m_Father: {fileID: 5109945643968698326}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 1}
|
||||
m_AnchorMax: {x: 0.5, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: -250}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 800, y: 800}
|
||||
m_Pivot: {x: 0.5, y: 1}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &5796229481733252802
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -285,9 +322,8 @@ RectTransform:
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 1338508664922812659}
|
||||
- {fileID: 4006246129058447062}
|
||||
- {fileID: 3680365639323743419}
|
||||
- {fileID: 6841858894429745291}
|
||||
- {fileID: 5109945643968698326}
|
||||
m_Father: {fileID: 1966378914653314124}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
@@ -400,13 +436,13 @@ RectTransform:
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 2499229096808986326}
|
||||
m_Father: {fileID: 5109945643968698326}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 1}
|
||||
m_AnchorMax: {x: 0.5, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: -250}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 411, y: 729}
|
||||
m_Pivot: {x: 0.5, y: 1}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &8906420622179058179
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@@ -285,8 +285,8 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 1}
|
||||
m_AnchorMax: {x: 0.5, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 173}
|
||||
m_SizeDelta: {x: 600, y: 150}
|
||||
m_AnchoredPosition: {x: 0, y: 125}
|
||||
m_SizeDelta: {x: 600, y: 120}
|
||||
m_Pivot: {x: 0.5, y: 1}
|
||||
--- !u!222 &5545241165728741220
|
||||
CanvasRenderer:
|
||||
@@ -343,8 +343,8 @@ MonoBehaviour:
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 150
|
||||
m_fontSizeBase: 150
|
||||
m_fontSize: 125
|
||||
m_fontSizeBase: 125
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
@@ -1053,6 +1053,10 @@ PrefabInstance:
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4925415087786595420, guid: 1d8cc8d9238eec34b8e600e7050e2979, type: 3}
|
||||
propertyPath: m_fontSize
|
||||
value: 54.45
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5378230129755544441, guid: 1d8cc8d9238eec34b8e600e7050e2979, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
138
Assets/Prefabs/UI/IntroSequence.prefab
Normal file
138
Assets/Prefabs/UI/IntroSequence.prefab
Normal file
@@ -0,0 +1,138 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &5026598641267297246
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 499805009927302532}
|
||||
- component: {fileID: 8952193833593986238}
|
||||
- component: {fileID: 1768742023768591015}
|
||||
- component: {fileID: 4794855098771415437}
|
||||
- component: {fileID: 1827255458430098390}
|
||||
- component: {fileID: 1619383145738161903}
|
||||
m_Layer: 5
|
||||
m_Name: IntroSequence
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &499805009927302532
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5026598641267297246}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 1920, y: 1080}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &8952193833593986238
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5026598641267297246}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: c119ffb87b2a16d4f925ff5d5ffd7092, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
shouldPlayIntro: 0
|
||||
--- !u!222 &1768742023768591015
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5026598641267297246}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &4794855098771415437
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5026598641267297246}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!320 &1827255458430098390
|
||||
PlayableDirector:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5026598641267297246}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_PlayableAsset: {fileID: 11400000, guid: bf4679c9d0eb0994d9e0de37c045e99b, type: 2}
|
||||
m_InitialState: 0
|
||||
m_WrapMode: 2
|
||||
m_DirectorUpdateMode: 1
|
||||
m_InitialTime: 0
|
||||
m_SceneBindings:
|
||||
- key: {fileID: -38993752814118673, guid: bf4679c9d0eb0994d9e0de37c045e99b, type: 2}
|
||||
value: {fileID: 1619383145738161903}
|
||||
- key: {fileID: -8222318252314758605, guid: bf4679c9d0eb0994d9e0de37c045e99b, type: 2}
|
||||
value: {fileID: 0}
|
||||
- key: {fileID: 139419469794405637, guid: bf4679c9d0eb0994d9e0de37c045e99b, type: 2}
|
||||
value: {fileID: 0}
|
||||
m_ExposedReferences:
|
||||
m_References: []
|
||||
--- !u!95 &1619383145738161903
|
||||
Animator:
|
||||
serializedVersion: 7
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5026598641267297246}
|
||||
m_Enabled: 1
|
||||
m_Avatar: {fileID: 0}
|
||||
m_Controller: {fileID: 9100000, guid: 052a4fbd53390314ba2bb3878a81b01e, type: 2}
|
||||
m_CullingMode: 0
|
||||
m_UpdateMode: 0
|
||||
m_ApplyRootMotion: 0
|
||||
m_LinearVelocityBlending: 0
|
||||
m_StabilizeFeet: 0
|
||||
m_AnimatePhysics: 0
|
||||
m_WarningMessage:
|
||||
m_HasTransformHierarchy: 1
|
||||
m_AllowConstantClipSamplingOptimization: 1
|
||||
m_KeepAnimatorStateOnDisable: 0
|
||||
m_WriteDefaultValuesOnDisable: 0
|
||||
7
Assets/Prefabs/UI/IntroSequence.prefab.meta
Normal file
7
Assets/Prefabs/UI/IntroSequence.prefab.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d1074dd38c3c50f4ca1454dbd60e44f6
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6fb0d7fc6faad154b8c3e3cb7abb7c15
|
||||
guid: fe049e0d73eadd7479140c8e7bd10efe
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,50 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &3863019143023165617
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 272997100784137721}
|
||||
- component: {fileID: 497632815361153787}
|
||||
m_Layer: 5
|
||||
m_Name: UIPageController
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &272997100784137721
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3863019143023165617}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 100, y: 100}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &497632815361153787
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3863019143023165617}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: b1ae6c1745e44e22a0fa9209ebe45ee3, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: AppleHillsScripts::UI.Core.UIPageController
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -453761,6 +453761,10 @@ PrefabInstance:
|
||||
propertyPath: m_PlayOnAwake
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8545106365577783398, guid: ead4e790fa3a1924ebd1586c93cd5479, type: 3}
|
||||
propertyPath: isOneTime
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
|
||||
@@ -305,6 +305,7 @@ RectTransform:
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 1224833349}
|
||||
- {fileID: 471921060}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
@@ -418,16 +419,16 @@ LineRenderer:
|
||||
m_SortingOrder: 0
|
||||
m_Positions:
|
||||
- {x: -0.15602553, y: 4.074945, z: 0}
|
||||
- {x: -0.1566351, y: 3.9736383, z: 0}
|
||||
- {x: -0.1572447, y: 3.8729858, z: 0}
|
||||
- {x: -0.1566351, y: 3.973638, z: 0}
|
||||
- {x: -0.1572447, y: 3.8729856, z: 0}
|
||||
- {x: -0.15785426, y: 3.7729874, z: 0}
|
||||
- {x: -0.15846384, y: 3.673644, z: 0}
|
||||
- {x: -0.15907341, y: 3.5749543, z: 0}
|
||||
- {x: -0.15968299, y: 3.4769197, z: 0}
|
||||
- {x: -0.15846384, y: 3.6736436, z: 0}
|
||||
- {x: -0.15907341, y: 3.574954, z: 0}
|
||||
- {x: -0.15968299, y: 3.4769192, z: 0}
|
||||
- {x: -0.16029257, y: 3.3795385, z: 0}
|
||||
- {x: -0.16090216, y: 3.2828126, z: 0}
|
||||
- {x: -0.16151173, y: 3.1867406, z: 0}
|
||||
- {x: -0.16212131, y: 3.0913231, z: 0}
|
||||
- {x: -0.16151173, y: 3.1867409, z: 0}
|
||||
- {x: -0.16212131, y: 3.0913236, z: 0}
|
||||
m_Parameters:
|
||||
serializedVersion: 3
|
||||
widthMultiplier: 1
|
||||
@@ -1098,6 +1099,112 @@ Animator:
|
||||
m_AllowConstantClipSamplingOptimization: 1
|
||||
m_KeepAnimatorStateOnDisable: 0
|
||||
m_WriteDefaultValuesOnDisable: 0
|
||||
--- !u!1001 &471921059
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 116234201}
|
||||
m_Modifications:
|
||||
- target: {fileID: 1439929750438628637, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: MiniGameBoosterGiver
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
|
||||
propertyPath: m_Pivot.x
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
|
||||
propertyPath: m_Pivot.y
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
|
||||
propertyPath: m_AnchorMin.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8617171489468030463, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
|
||||
propertyPath: m_IsActive
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
|
||||
--- !u!224 &471921060 stripped
|
||||
RectTransform:
|
||||
m_CorrespondingSourceObject: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
|
||||
m_PrefabInstance: {fileID: 471921059}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1 &730962732
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1455,7 +1562,7 @@ AudioSource:
|
||||
OutputAudioMixerGroup: {fileID: 3533147658878909314, guid: 727a7e4b6df4b0d47897f7d8ee7fa323, type: 2}
|
||||
m_audioClip: {fileID: 0}
|
||||
m_Resource: {fileID: 0}
|
||||
m_PlayOnAwake: 1
|
||||
m_PlayOnAwake: 0
|
||||
m_Volume: 1
|
||||
m_Pitch: 1
|
||||
Loop: 0
|
||||
@@ -1783,14 +1890,14 @@ LineRenderer:
|
||||
- {x: -0.15602553, y: 4.0749445, z: 0}
|
||||
- {x: -0.11662118, y: 3.879622, z: 0}
|
||||
- {x: -0.07721684, y: 3.7057445, z: 0}
|
||||
- {x: -0.03781248, y: 3.5533104, z: 0}
|
||||
- {x: 0.0015918687, y: 3.4223213, z: 0}
|
||||
- {x: 0.040996216, y: 3.312776, z: 0}
|
||||
- {x: 0.08040057, y: 3.2246757, z: 0}
|
||||
- {x: 0.11980491, y: 3.1580195, z: 0}
|
||||
- {x: 0.15920927, y: 3.1128078, z: 0}
|
||||
- {x: 0.1986136, y: 3.0890403, z: 0}
|
||||
- {x: 0.23801796, y: 3.0867171, z: 0}
|
||||
- {x: -0.03781248, y: 3.5533106, z: 0}
|
||||
- {x: 0.0015918687, y: 3.4223216, z: 0}
|
||||
- {x: 0.040996216, y: 3.3127766, z: 0}
|
||||
- {x: 0.08040057, y: 3.2246761, z: 0}
|
||||
- {x: 0.11980491, y: 3.15802, z: 0}
|
||||
- {x: 0.15920927, y: 3.1128082, z: 0}
|
||||
- {x: 0.1986136, y: 3.0890405, z: 0}
|
||||
- {x: 0.23801796, y: 3.0867176, z: 0}
|
||||
m_Parameters:
|
||||
serializedVersion: 3
|
||||
widthMultiplier: 1
|
||||
@@ -2503,14 +2610,14 @@ LineRenderer:
|
||||
- {x: -0.15602553, y: 4.0749445, z: 0}
|
||||
- {x: -0.18956745, y: 3.8764973, z: 0}
|
||||
- {x: -0.22310936, y: 3.7000232, z: 0}
|
||||
- {x: -0.25665125, y: 3.54552, z: 0}
|
||||
- {x: -0.29019317, y: 3.4129906, z: 0}
|
||||
- {x: -0.32373506, y: 3.302433, z: 0}
|
||||
- {x: -0.35727698, y: 3.213848, z: 0}
|
||||
- {x: -0.39081886, y: 3.1472354, z: 0}
|
||||
- {x: -0.4243608, y: 3.1025953, z: 0}
|
||||
- {x: -0.45790267, y: 3.0799277, z: 0}
|
||||
- {x: -0.4914446, y: 3.0792325, z: 0}
|
||||
- {x: -0.25665125, y: 3.5455203, z: 0}
|
||||
- {x: -0.29019317, y: 3.412991, z: 0}
|
||||
- {x: -0.32373506, y: 3.3024335, z: 0}
|
||||
- {x: -0.35727698, y: 3.2138484, z: 0}
|
||||
- {x: -0.39081886, y: 3.1472359, z: 0}
|
||||
- {x: -0.4243608, y: 3.1025958, z: 0}
|
||||
- {x: -0.45790267, y: 3.0799282, z: 0}
|
||||
- {x: -0.4914446, y: 3.079233, z: 0}
|
||||
m_Parameters:
|
||||
serializedVersion: 3
|
||||
widthMultiplier: 1
|
||||
@@ -3358,7 +3465,7 @@ Transform:
|
||||
m_GameObject: {fileID: 2106431001}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -0.165, y: 2.697517, z: 0}
|
||||
m_LocalPosition: {x: -0.165, y: 2.6975174, z: 0}
|
||||
m_LocalScale: {x: 0.57574, y: 0.57574, z: 0.57574}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
@@ -3526,6 +3633,18 @@ PrefabInstance:
|
||||
propertyPath: m_Name
|
||||
value: Tutorial
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4267886887244421663, guid: a4dd78ff48942854ebb4c65025a8dc36, type: 3}
|
||||
propertyPath: introVO
|
||||
value:
|
||||
objectReference: {fileID: 8300000, guid: fca641cdc8dcd074483fad3db1cbe24c, type: 3}
|
||||
- target: {fileID: 4267886887244421663, guid: a4dd78ff48942854ebb4c65025a8dc36, type: 3}
|
||||
propertyPath: playTutorial
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4267886887244421663, guid: a4dd78ff48942854ebb4c65025a8dc36, type: 3}
|
||||
propertyPath: bottleAudioPlayer
|
||||
value:
|
||||
objectReference: {fileID: 747976408}
|
||||
- target: {fileID: 8452897808363562605, guid: a4dd78ff48942854ebb4c65025a8dc36, type: 3}
|
||||
propertyPath: m_Sprite
|
||||
value:
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -56,7 +56,7 @@ public class BirdEyesBehavior : ManagedBehaviour
|
||||
_statemachine.ChangeState("BirdSpawned");
|
||||
}
|
||||
|
||||
protected override void OnSceneRestoreRequested(string serializedData)
|
||||
internal override void OnSceneRestoreRequested(string serializedData)
|
||||
{
|
||||
base.OnSceneRestoreRequested(serializedData);
|
||||
|
||||
@@ -75,7 +75,7 @@ public class BirdEyesBehavior : ManagedBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
protected override string OnSceneSaveRequested()
|
||||
internal override string OnSceneSaveRequested()
|
||||
{
|
||||
return _wolterisoutTriggered.ToString();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using AppleHills.Core.Settings;
|
||||
using UnityEngine;
|
||||
using Core;
|
||||
@@ -33,11 +33,9 @@ namespace Bootstrap
|
||||
// Run very early - need to set up loading screen before other systems initialize
|
||||
public override int ManagedAwakePriority => 5;
|
||||
|
||||
protected override void Awake()
|
||||
internal override void OnManagedAwake()
|
||||
{
|
||||
base.Awake(); // Register with LifecycleManager
|
||||
|
||||
LogDebugMessage("BootSceneController.Awake() - Initializing loading screen DURING bootstrap");
|
||||
Logging.Debug("BootSceneController.Awake() - Initializing loading screen DURING bootstrap");
|
||||
|
||||
// Validate loading screen exists
|
||||
if (initialLoadingScreen == null)
|
||||
@@ -56,7 +54,13 @@ namespace Bootstrap
|
||||
// Subscribe to boot progress for real-time updates during bootstrap
|
||||
CustomBoot.OnBootProgressChanged += OnBootProgressChanged;
|
||||
|
||||
_logVerbosity = DeveloperSettingsProvider.Instance.GetSettings<DebugSettings>().bootstrapLogVerbosity;
|
||||
#if UNITY_EDITOR
|
||||
_logVerbosity = DeveloperSettingsProvider.Instance.GetSettings<DebugSettings>().bootstrapLogVerbosity;
|
||||
#elif DEVELOPMENT_BUILD
|
||||
_logVerbosity = LogVerbosity.Debug;
|
||||
#elif RELEASE_BUILD
|
||||
_logVerbosity = LogVerbosity.Warning;
|
||||
#endif
|
||||
|
||||
// In debug mode, log additional information
|
||||
if (debugMode)
|
||||
@@ -65,11 +69,11 @@ namespace Bootstrap
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnManagedAwake()
|
||||
internal override void OnManagedStart()
|
||||
{
|
||||
LogDebugMessage("BootSceneController.OnManagedAwake() - Boot is GUARANTEED complete, starting scene loading");
|
||||
Logging.Debug("BootSceneController.OnManagedStart() - Boot is GUARANTEED complete, starting scene loading");
|
||||
|
||||
// Boot is GUARANTEED complete at this point - that's the whole point of OnManagedAwake!
|
||||
// Boot is GUARANTEED complete at this point - that's the whole point of OnManagedStart!
|
||||
// No need to subscribe to OnBootCompleted or check CustomBoot.Initialised
|
||||
_bootComplete = true;
|
||||
_currentPhase = LoadingPhase.SceneLoading;
|
||||
@@ -96,16 +100,18 @@ namespace Bootstrap
|
||||
/// </summary>
|
||||
private void OnInitialLoadingComplete()
|
||||
{
|
||||
LogDebugMessage("Initial loading screen fully hidden, boot sequence completed");
|
||||
Logging.Debug("Initial loading screen fully hidden, boot sequence completed");
|
||||
|
||||
// Play the intro cinematic if available
|
||||
if (CinematicsManager.Instance != null)
|
||||
{
|
||||
LogDebugMessage("Attempting to play intro cinematic");
|
||||
|
||||
Logging.Debug("Attempting to play intro cinematic");
|
||||
|
||||
// Use LoadAndPlayCinematic to play the intro sequence
|
||||
CinematicsManager.Instance.LoadAndPlayCinematic("IntroSequence");
|
||||
|
||||
CinematicsManager.Instance.LoadAndPlayCinematic("IntroSequence", false);
|
||||
CinematicsManager.Instance.ChangeCinematicBackgroundColour(new Color(0f, 0f, 0f, 1f));
|
||||
//PlayerHudManager.Instance.ResizeCinematicPlayer();
|
||||
|
||||
// Immediately unload the StartingScene - no need to wait for cinematic to finish
|
||||
// since CinematicsManager is bootstrapped and won't be unloaded
|
||||
UnloadStartingScene();
|
||||
@@ -141,13 +147,13 @@ namespace Bootstrap
|
||||
{
|
||||
if (debugMode)
|
||||
{
|
||||
LogDebugMessage($"Bootstrap progress: {progress:P0}, Combined: {GetCombinedProgress():P0}");
|
||||
Logging.Debug($"Bootstrap progress: {progress:P0}, Combined: {GetCombinedProgress():P0}");
|
||||
}
|
||||
}
|
||||
|
||||
private void LogDebugInfo()
|
||||
{
|
||||
LogDebugMessage($"Debug - Phase: {_currentPhase}, Bootstrap: {CustomBoot.CurrentProgress:P0}, " +
|
||||
Logging.Debug($"Debug - Phase: {_currentPhase}, Bootstrap: {CustomBoot.CurrentProgress:P0}, " +
|
||||
$"Scene: {_sceneLoadingProgress:P0}, Combined: {GetCombinedProgress():P0}, Boot Complete: {_bootComplete}");
|
||||
}
|
||||
|
||||
@@ -164,7 +170,7 @@ namespace Bootstrap
|
||||
|
||||
private async void LoadMainScene()
|
||||
{
|
||||
LogDebugMessage($"Loading main menu scene: {mainSceneName}");
|
||||
Logging.Debug($"Loading main menu scene: {mainSceneName}");
|
||||
|
||||
try
|
||||
{
|
||||
@@ -178,7 +184,7 @@ namespace Bootstrap
|
||||
|
||||
if (debugMode)
|
||||
{
|
||||
LogDebugMessage($"Scene loading raw: {value:P0}, Combined: {GetCombinedProgress():P0}");
|
||||
Logging.Debug($"Scene loading raw: {value:P0}, Combined: {GetCombinedProgress():P0}");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -202,13 +208,13 @@ namespace Bootstrap
|
||||
_sceneLoadingProgress = 1f;
|
||||
|
||||
// CRITICAL: Broadcast lifecycle events so components get their OnSceneReady callbacks
|
||||
LogDebugMessage($"Broadcasting OnSceneReady for: {mainSceneName}");
|
||||
Logging.Debug($"Broadcasting OnSceneReady for: {mainSceneName}");
|
||||
LifecycleManager.Instance?.BroadcastSceneReady(mainSceneName);
|
||||
|
||||
// Restore scene data for the main menu
|
||||
if (SaveLoadManager.Instance != null)
|
||||
{
|
||||
LogDebugMessage($"Restoring scene data for: {mainSceneName}");
|
||||
Logging.Debug($"Restoring scene data for: {mainSceneName}");
|
||||
SaveLoadManager.Instance.RestoreSceneData();
|
||||
}
|
||||
|
||||
@@ -238,7 +244,7 @@ namespace Bootstrap
|
||||
Scene currentScene = SceneManager.GetActiveScene();
|
||||
string startingSceneName = currentScene.name;
|
||||
|
||||
LogDebugMessage($"Unloading StartingScene: {startingSceneName}");
|
||||
Logging.Debug($"Unloading StartingScene: {startingSceneName}");
|
||||
|
||||
// Unload the StartingScene
|
||||
await SceneManager.UnloadSceneAsync(startingSceneName);
|
||||
@@ -247,14 +253,14 @@ namespace Bootstrap
|
||||
Scene mainMenuScene = SceneManager.GetSceneByName(mainSceneName);
|
||||
SceneManager.SetActiveScene(mainMenuScene);
|
||||
|
||||
LogDebugMessage($"Transition complete: {startingSceneName} unloaded, {mainSceneName} is now active");
|
||||
Logging.Debug($"Transition complete: {startingSceneName} unloaded, {mainSceneName} is now active");
|
||||
|
||||
// Destroy the boot scene controller since its job is done
|
||||
Destroy(gameObject);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logging.Warning($"[BootSceneController] Error unloading StartingScene: {e.Message}");
|
||||
Logging.Warning($"Error unloading StartingScene: {e.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -275,13 +281,5 @@ namespace Bootstrap
|
||||
_progressAction?.Invoke(value);
|
||||
}
|
||||
}
|
||||
|
||||
private void LogDebugMessage(string message)
|
||||
{
|
||||
if ( _logVerbosity <= LogVerbosity.Debug)
|
||||
{
|
||||
Logging.Debug($"[BootSceneController] {message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using AppleHills.Core.Settings;
|
||||
using Core;
|
||||
using Core.Lifecycle;
|
||||
using UnityEngine;
|
||||
@@ -105,7 +104,7 @@ namespace Bootstrap
|
||||
// Notify the LifecycleManager that boot is complete
|
||||
if (Application.isPlaying)
|
||||
{
|
||||
LogDebugMessage("Calling LifecycleManager.OnBootCompletionTriggered()");
|
||||
Logging.Debug("Calling LifecycleManager.OnBootCompletionTriggered()");
|
||||
if (LifecycleManager.Instance != null)
|
||||
{
|
||||
LifecycleManager.Instance.OnBootCompletionTriggered();
|
||||
@@ -127,7 +126,7 @@ namespace Bootstrap
|
||||
// Notify the LifecycleManager that boot is complete
|
||||
if (Application.isPlaying)
|
||||
{
|
||||
LogDebugMessage("Calling LifecycleManager.OnBootCompletionTriggered()");
|
||||
Logging.Debug("Calling LifecycleManager.OnBootCompletionTriggered()");
|
||||
if (LifecycleManager.Instance != null)
|
||||
{
|
||||
LifecycleManager.Instance.OnBootCompletionTriggered();
|
||||
@@ -238,16 +237,7 @@ namespace Bootstrap
|
||||
{
|
||||
CurrentProgress = Mathf.Clamp01(progress);
|
||||
OnBootProgressChanged?.Invoke(CurrentProgress);
|
||||
LogDebugMessage($"Progress: {CurrentProgress:P0}");
|
||||
}
|
||||
|
||||
private static void LogDebugMessage(string message)
|
||||
{
|
||||
if (DeveloperSettingsProvider.Instance.GetSettings<DebugSettings>().bootstrapLogVerbosity <=
|
||||
LogVerbosity.Debug)
|
||||
{
|
||||
Logging.Debug($"[CustomBoot] {message}");
|
||||
}
|
||||
Logging.Debug($"Progress: {CurrentProgress:P0}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -138,7 +138,7 @@ namespace Bootstrap
|
||||
float displayProgress = Mathf.Min(steadyProgress, actualProgress);
|
||||
|
||||
// Log the progress values for debugging
|
||||
LogDebugMessage($"Progress - Default: {steadyProgress:F2}, Actual: {actualProgress:F2}, Display: {displayProgress:F2}");
|
||||
Logging.Debug($"Progress - Default: {steadyProgress:F2}, Actual: {actualProgress:F2}, Display: {displayProgress:F2}");
|
||||
|
||||
// Directly set the progress bar fill amount without smoothing
|
||||
if (progressBarImage != null)
|
||||
@@ -151,7 +151,7 @@ namespace Bootstrap
|
||||
if (steadyProgress >= 1.0f && displayProgress >= 1.0f)
|
||||
{
|
||||
_animationComplete = true;
|
||||
LogDebugMessage("Animation complete");
|
||||
Logging.Debug("Animation complete");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ namespace Bootstrap
|
||||
if (progressBarImage != null)
|
||||
{
|
||||
progressBarImage.fillAmount = 1.0f;
|
||||
LogDebugMessage("Final progress set to 1.0");
|
||||
Logging.Debug("Final progress set to 1.0");
|
||||
}
|
||||
|
||||
// Hide the screen if loading is also complete
|
||||
@@ -172,7 +172,7 @@ namespace Bootstrap
|
||||
if (loadingScreenContainer != null)
|
||||
{
|
||||
loadingScreenContainer.SetActive(false);
|
||||
LogDebugMessage("Animation AND loading complete, hiding screen");
|
||||
Logging.Debug("Animation AND loading complete, hiding screen");
|
||||
|
||||
// Invoke the callback when fully hidden
|
||||
_onLoadingScreenFullyHidden?.Invoke();
|
||||
@@ -189,7 +189,7 @@ namespace Bootstrap
|
||||
/// </summary>
|
||||
public void HideLoadingScreen()
|
||||
{
|
||||
LogDebugMessage("Loading complete, marking loading as finished");
|
||||
Logging.Debug("Loading complete, marking loading as finished");
|
||||
|
||||
// Mark that loading is complete
|
||||
_loadingComplete = true;
|
||||
@@ -200,7 +200,7 @@ namespace Bootstrap
|
||||
if (loadingScreenContainer != null)
|
||||
{
|
||||
loadingScreenContainer.SetActive(false);
|
||||
LogDebugMessage("Animation already complete, hiding screen immediately");
|
||||
Logging.Debug("Animation already complete, hiding screen immediately");
|
||||
|
||||
// Invoke the callback when fully hidden
|
||||
_onLoadingScreenFullyHidden?.Invoke();
|
||||
@@ -210,7 +210,7 @@ namespace Bootstrap
|
||||
}
|
||||
else
|
||||
{
|
||||
LogDebugMessage("Animation still in progress, waiting for it to complete");
|
||||
Logging.Debug("Animation still in progress, waiting for it to complete");
|
||||
// The coroutine will handle hiding when animation completes
|
||||
}
|
||||
}
|
||||
@@ -244,13 +244,5 @@ namespace Bootstrap
|
||||
|
||||
return tcs.Task;
|
||||
}
|
||||
|
||||
private void LogDebugMessage(string message)
|
||||
{
|
||||
if ( _logVerbosity <= LogVerbosity.Debug)
|
||||
{
|
||||
Logging.Debug($"[InitialLoadingScreen] {message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,15 +39,13 @@ namespace Cinematics
|
||||
|
||||
public override int ManagedAwakePriority => 170; // Cinematic systems
|
||||
|
||||
private new void Awake()
|
||||
internal override void OnManagedAwake()
|
||||
{
|
||||
base.Awake(); // CRITICAL: Register with LifecycleManager!
|
||||
|
||||
// Set instance immediately so it's available before OnManagedAwake() is called
|
||||
// Set instance immediately (early initialization)
|
||||
_instance = this;
|
||||
}
|
||||
|
||||
protected override void OnManagedAwake()
|
||||
internal override void OnManagedStart()
|
||||
{
|
||||
Logging.Debug("[CinematicsManager] Initialized");
|
||||
}
|
||||
@@ -81,28 +79,30 @@ namespace Cinematics
|
||||
// Initialize PlayableDirector if not set
|
||||
if (playableDirector == null)
|
||||
{
|
||||
playableDirector = GetComponent<PlayableDirector>();
|
||||
playableDirector = PlayerHudManager.Instance.playableDirector;
|
||||
|
||||
// If still null, try to add the component
|
||||
if (playableDirector == null)
|
||||
{
|
||||
playableDirector = gameObject.AddComponent<PlayableDirector>();
|
||||
Debug.Log("[CinematicsManager] Added missing PlayableDirector component");
|
||||
Logging.Debug("[CinematicsManager] Could not find Playable Director on the PlayerHudManager");
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize _cinematicSprites if not set
|
||||
if (_cinematicSprites == null)
|
||||
{
|
||||
// First try to find in children
|
||||
_cinematicSprites = GetComponentInChildren<Image>(true);
|
||||
// First try to find in children in the PlayerHud
|
||||
_cinematicSprites = PlayerHudManager.Instance.cinematicSprites;
|
||||
|
||||
// If still null, create a new UI Image for cinematics
|
||||
// If still null, return error
|
||||
if (_cinematicSprites == null)
|
||||
{
|
||||
Debug.LogWarning("[CinematicsManager] No Image found for cinematics display. Cinematics may not display correctly.");
|
||||
Logging.Warning("[CinematicsManager] No Image found for cinematics display. Cinematics may not display correctly.");
|
||||
}
|
||||
}
|
||||
|
||||
cinematicSpritesGameObject = PlayerHudManager.Instance.currentCinematicPlayer;
|
||||
cinematicBackground = PlayerHudManager.Instance.CinematicBackground;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -118,6 +118,7 @@ namespace Cinematics
|
||||
_cinematicSprites.enabled = true;
|
||||
cinematicSpritesGameObject.SetActive(true);
|
||||
}
|
||||
cinematicBackground.SetActive(true);
|
||||
|
||||
playableDirector.stopped += OnPlayableDirectorStopped;
|
||||
playableDirector.Play(assetToPlay);
|
||||
@@ -142,8 +143,10 @@ namespace Cinematics
|
||||
/// <summary>
|
||||
/// Loads a playable from an asset path and plays it as a cinematic
|
||||
/// </summary>
|
||||
public PlayableDirector LoadAndPlayCinematic(string key)
|
||||
public PlayableDirector LoadAndPlayCinematic(string key, bool playPortraitMode)
|
||||
{
|
||||
InitializeComponents();
|
||||
|
||||
// Load the asset via addressables
|
||||
var handle = Addressables.LoadAssetAsync<PlayableAsset>(key);
|
||||
var result = handle.WaitForCompletion();
|
||||
@@ -153,6 +156,7 @@ namespace Cinematics
|
||||
|
||||
Logging.Debug($"[CinematicsManager] Loaded addressable cinematic: {key}");
|
||||
|
||||
PlayerHudManager.Instance.SetPortraitMode(playPortraitMode);
|
||||
return PlayCinematic(result);
|
||||
}
|
||||
|
||||
@@ -198,11 +202,14 @@ namespace Cinematics
|
||||
|
||||
public void ShowCinematicBackground(bool shouldBeActive)
|
||||
{
|
||||
cinematicBackground.SetActive(shouldBeActive);
|
||||
cinematicBackground.SetActive(shouldBeActive);
|
||||
}
|
||||
|
||||
public void ShowGameOverScreen()
|
||||
{
|
||||
{
|
||||
// Diagnostic: log time and call stack to track when/why game over is triggered
|
||||
Logging.Debug($"[CinematicsManager] ShowGameOverScreen called at time={Time.time:F2}");
|
||||
|
||||
if (divingGameOverScreen != null && UIPageController.Instance != null)
|
||||
{
|
||||
UIPageController.Instance.PushPage(divingGameOverScreen);
|
||||
@@ -218,5 +225,12 @@ namespace Cinematics
|
||||
Logging.Warning("[CinematicsManager] DivingGameOverScreen reference is not set!");
|
||||
}
|
||||
}
|
||||
|
||||
public void ChangeCinematicBackgroundColour(Color clr)
|
||||
{
|
||||
PlayerHudManager.Instance.cinematicBackgroundSprites.color = clr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -15,11 +15,10 @@ namespace Cinematics
|
||||
private float _holdStartTime;
|
||||
private bool _isHolding;
|
||||
private bool _skipPerformed;
|
||||
private bool _initialized = false;
|
||||
|
||||
public override int ManagedAwakePriority => 180; // Cinematic UI
|
||||
|
||||
protected override void OnManagedAwake()
|
||||
internal override void OnManagedStart()
|
||||
{
|
||||
// Reset the progress bar
|
||||
if (radialProgressBar != null)
|
||||
|
||||
@@ -37,14 +37,12 @@ namespace Core
|
||||
// ManagedBehaviour configuration
|
||||
public override int ManagedAwakePriority => 10; // Core infrastructure - runs early
|
||||
|
||||
private new void Awake()
|
||||
internal override void OnManagedAwake()
|
||||
{
|
||||
base.Awake(); // CRITICAL: Register with LifecycleManager!
|
||||
|
||||
// Set instance immediately so it's available before OnManagedAwake() is called
|
||||
// Set instance immediately (early initialization)
|
||||
_instance = this;
|
||||
|
||||
// Create settings providers - must happen in Awake so other managers can access settings in their ManagedAwake
|
||||
// Create settings providers - must happen in OnManagedAwake so other managers can access settings in their ManagedStart
|
||||
SettingsProvider.Instance.gameObject.name = "Settings Provider";
|
||||
DeveloperSettingsProvider.Instance.gameObject.name = "Developer Settings Provider";
|
||||
|
||||
@@ -57,9 +55,9 @@ namespace Core
|
||||
_managerLogVerbosity = DeveloperSettingsProvider.Instance.GetSettings<DebugSettings>().gameManagerLogVerbosity;
|
||||
}
|
||||
|
||||
protected override void OnManagedAwake()
|
||||
internal override void OnManagedStart()
|
||||
{
|
||||
// Settings are already initialized in Awake()
|
||||
// Settings are already initialized in OnManagedAwake()
|
||||
// This is available for future initialization that depends on other managers
|
||||
}
|
||||
|
||||
@@ -79,7 +77,7 @@ namespace Core
|
||||
component.Pause();
|
||||
}
|
||||
|
||||
LogDebugMessage($"Registered pausable component: {(component as MonoBehaviour)?.name ?? "Unknown"}");
|
||||
Logging.Debug($"Registered pausable component: {(component as MonoBehaviour)?.name ?? "Unknown"}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +90,7 @@ namespace Core
|
||||
if (component != null && _pausableComponents.Contains(component))
|
||||
{
|
||||
_pausableComponents.Remove(component);
|
||||
LogDebugMessage($"Unregistered pausable component: {(component as MonoBehaviour)?.name ?? "Unknown"}");
|
||||
Logging.Debug($"Unregistered pausable component: {(component as MonoBehaviour)?.name ?? "Unknown"}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,7 +106,7 @@ namespace Core
|
||||
ApplyPause(true);
|
||||
}
|
||||
|
||||
LogDebugMessage($"Pause requested by {requester?.ToString() ?? "Unknown"}. pauseCount = {_pauseCount}");
|
||||
Logging.Debug($"Pause requested by {requester?.ToString() ?? "Unknown"}. pauseCount = {_pauseCount}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -123,7 +121,7 @@ namespace Core
|
||||
ApplyPause(false);
|
||||
}
|
||||
|
||||
LogDebugMessage($"Pause released by {requester?.ToString() ?? "Unknown"}. pauseCount = {_pauseCount}");
|
||||
Logging.Debug($"Pause released by {requester?.ToString() ?? "Unknown"}. pauseCount = {_pauseCount}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -162,12 +160,12 @@ namespace Core
|
||||
OnGameResumed?.Invoke();
|
||||
}
|
||||
|
||||
LogDebugMessage($"Game {(shouldPause ? "paused" : "resumed")}. Paused {_pausableComponents.Count} components.");
|
||||
Logging.Debug($"Game {(shouldPause ? "paused" : "resumed")}. Paused {_pausableComponents.Count} components.");
|
||||
}
|
||||
|
||||
private void InitializeSettings()
|
||||
{
|
||||
LogDebugMessage("Starting settings initialization...", "SettingsInitialization", _settingsLogVerbosity);
|
||||
Logging.Debug("Starting settings initialization...");
|
||||
|
||||
// Load settings synchronously
|
||||
var playerSettings = SettingsProvider.Instance.LoadSettingsSynchronous<PlayerFollowerSettings>();
|
||||
@@ -178,7 +176,7 @@ namespace Core
|
||||
if (playerSettings != null)
|
||||
{
|
||||
ServiceLocator.Register<IPlayerFollowerSettings>(playerSettings);
|
||||
LogDebugMessage("PlayerFollowerSettings registered successfully", "SettingsInitialization", _settingsLogVerbosity);
|
||||
Logging.Debug("PlayerFollowerSettings registered successfully");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -188,7 +186,7 @@ namespace Core
|
||||
if (interactionSettings != null)
|
||||
{
|
||||
ServiceLocator.Register<IInteractionSettings>(interactionSettings);
|
||||
LogDebugMessage("InteractionSettings registered successfully", "SettingsInitialization", _settingsLogVerbosity);
|
||||
Logging.Debug("InteractionSettings registered successfully");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -198,7 +196,7 @@ namespace Core
|
||||
if (minigameSettings != null)
|
||||
{
|
||||
ServiceLocator.Register<IDivingMinigameSettings>(minigameSettings);
|
||||
LogDebugMessage("MinigameSettings registered successfully", "SettingsInitialization", _settingsLogVerbosity);
|
||||
Logging.Debug("MinigameSettings registered successfully");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -209,7 +207,7 @@ namespace Core
|
||||
_settingsLoaded = playerSettings != null && interactionSettings != null && minigameSettings != null;
|
||||
if (_settingsLoaded)
|
||||
{
|
||||
LogDebugMessage("All settings loaded and registered with ServiceLocator", "SettingsInitialization", _settingsLogVerbosity);
|
||||
Logging.Debug("All settings loaded and registered with ServiceLocator");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -222,7 +220,7 @@ namespace Core
|
||||
/// </summary>
|
||||
private void InitializeDeveloperSettings()
|
||||
{
|
||||
LogDebugMessage("Starting developer settings initialization...", "SettingsInitialization", _settingsLogVerbosity);
|
||||
Logging.Debug("Starting developer settings initialization...");
|
||||
|
||||
// Load developer settings
|
||||
var divingDevSettings = DeveloperSettingsProvider.Instance.GetSettings<DivingDeveloperSettings>();
|
||||
@@ -232,7 +230,7 @@ namespace Core
|
||||
|
||||
if (_developerSettingsLoaded)
|
||||
{
|
||||
LogDebugMessage("All developer settings loaded successfully", "SettingsInitialization", _settingsLogVerbosity);
|
||||
Logging.Debug("All developer settings loaded successfully");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -266,19 +264,6 @@ namespace Core
|
||||
{
|
||||
return DeveloperSettingsProvider.Instance?.GetSettings<T>();
|
||||
}
|
||||
|
||||
private void LogDebugMessage(string message, string prefix = "GameManager", LogVerbosity verbosity = LogVerbosity.None)
|
||||
{
|
||||
if (verbosity == LogVerbosity.None)
|
||||
{
|
||||
verbosity = _managerLogVerbosity;
|
||||
}
|
||||
|
||||
if ( verbosity <= LogVerbosity.Debug)
|
||||
{
|
||||
Logging.Debug($"[{prefix}] {message}");
|
||||
}
|
||||
}
|
||||
|
||||
// LEFTOVER LEGACY SETTINGS
|
||||
public float PlayerStopDistance => GetSettings<IInteractionSettings>()?.PlayerStopDistance ?? 6.0f;
|
||||
|
||||
@@ -50,20 +50,18 @@ namespace Core
|
||||
|
||||
public override int ManagedAwakePriority => 75; // Item registry
|
||||
|
||||
private new void Awake()
|
||||
internal override void OnManagedAwake()
|
||||
{
|
||||
base.Awake(); // CRITICAL: Register with LifecycleManager!
|
||||
|
||||
// Set instance immediately so it's available before OnManagedAwake() is called
|
||||
// Set instance immediately (early initialization)
|
||||
_instance = this;
|
||||
}
|
||||
|
||||
protected override void OnManagedAwake()
|
||||
internal override void OnManagedStart()
|
||||
{
|
||||
Logging.Debug("[ItemManager] Initialized");
|
||||
}
|
||||
|
||||
protected override void OnSceneReady()
|
||||
internal override void OnSceneReady()
|
||||
{
|
||||
// Replaces SceneLoadStarted subscription for clearing registrations
|
||||
ClearAllRegistrations();
|
||||
@@ -144,7 +142,6 @@ namespace Core
|
||||
{
|
||||
s.OnCorrectItemSlotted -= ItemSlot_OnCorrectItemSlotted;
|
||||
s.OnIncorrectItemSlotted -= ItemSlot_OnIncorrectItemSlotted;
|
||||
s.OnForbiddenItemSlotted -= ItemSlot_OnForbiddenItemSlotted;
|
||||
s.OnItemSlotRemoved -= ItemSlot_OnItemSlotRemoved;
|
||||
}
|
||||
}
|
||||
@@ -191,7 +188,6 @@ namespace Core
|
||||
// Subscribe to all slot events
|
||||
slot.OnCorrectItemSlotted += ItemSlot_OnCorrectItemSlotted;
|
||||
slot.OnIncorrectItemSlotted += ItemSlot_OnIncorrectItemSlotted;
|
||||
slot.OnForbiddenItemSlotted += ItemSlot_OnForbiddenItemSlotted;
|
||||
slot.OnItemSlotRemoved += ItemSlot_OnItemSlotRemoved;
|
||||
}
|
||||
}
|
||||
@@ -204,7 +200,6 @@ namespace Core
|
||||
// Unsubscribe from all slot events
|
||||
slot.OnCorrectItemSlotted -= ItemSlot_OnCorrectItemSlotted;
|
||||
slot.OnIncorrectItemSlotted -= ItemSlot_OnIncorrectItemSlotted;
|
||||
slot.OnForbiddenItemSlotted -= ItemSlot_OnForbiddenItemSlotted;
|
||||
slot.OnItemSlotRemoved -= ItemSlot_OnItemSlotRemoved;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Core.Lifecycle
|
||||
{
|
||||
if (_instance != null)
|
||||
{
|
||||
Debug.LogWarning("[LifecycleManager] Instance already exists");
|
||||
Logging.Warning("[LifecycleManager] Instance already exists");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace Core.Lifecycle
|
||||
_instance = go.AddComponent<LifecycleManager>();
|
||||
DontDestroyOnLoad(go);
|
||||
|
||||
Debug.Log("[LifecycleManager] Instance created");
|
||||
Logging.Debug("[LifecycleManager] Instance created");
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -85,7 +85,7 @@ namespace Core.Lifecycle
|
||||
}
|
||||
else if (_instance != this)
|
||||
{
|
||||
Debug.LogWarning("[LifecycleManager] Duplicate instance detected. Destroying.");
|
||||
Logging.Warning("[LifecycleManager] Duplicate instance detected. Destroying.");
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
@@ -111,7 +111,7 @@ namespace Core.Lifecycle
|
||||
{
|
||||
if (component == null)
|
||||
{
|
||||
Debug.LogWarning("[LifecycleManager] Attempted to register null component");
|
||||
Logging.Warning("[LifecycleManager] Attempted to register null component");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -123,7 +123,24 @@ namespace Core.Lifecycle
|
||||
// ALWAYS add to managedAwakeList - this is the master list used for save/load
|
||||
InsertSorted(managedAwakeList, component, component.ManagedAwakePriority);
|
||||
|
||||
// Handle ManagedAwake timing based on boot state
|
||||
// Register for all scene lifecycle hooks
|
||||
InsertSorted(sceneUnloadingList, component, component.SceneUnloadingPriority);
|
||||
InsertSorted(sceneReadyList, component, component.SceneReadyPriority);
|
||||
InsertSorted(saveRequestedList, component, component.SavePriority);
|
||||
InsertSorted(restoreRequestedList, component, component.RestorePriority);
|
||||
InsertSorted(destroyList, component, component.DestroyPriority);
|
||||
|
||||
// Call OnManagedAwake immediately after registration (early initialization hook)
|
||||
try
|
||||
{
|
||||
component.OnManagedAwake();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogError($"[LifecycleManager] Error in OnManagedAwake for {component.gameObject.name}: {ex}");
|
||||
}
|
||||
|
||||
// Handle OnManagedStart timing based on boot state
|
||||
if (isBootComplete)
|
||||
{
|
||||
// Check if we're currently loading a scene
|
||||
@@ -136,27 +153,20 @@ namespace Core.Lifecycle
|
||||
else
|
||||
{
|
||||
// Truly late registration (component enabled after scene is ready)
|
||||
// Call OnManagedAwake immediately since boot already completed
|
||||
LogDebug($"Late registration: Calling OnManagedAwake immediately for {component.gameObject.name}");
|
||||
// Call OnManagedStart immediately since boot already completed
|
||||
LogDebug($"Late registration: Calling OnManagedStart immediately for {component.gameObject.name}");
|
||||
try
|
||||
{
|
||||
component.InvokeManagedAwake();
|
||||
component.OnManagedStart();
|
||||
HandleAutoRegistrations(component);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogError($"[LifecycleManager] Error in OnManagedAwake for {component.gameObject.name}: {ex}");
|
||||
Debug.LogError($"[LifecycleManager] Error in OnManagedStart for {component.gameObject.name}: {ex}");
|
||||
}
|
||||
}
|
||||
}
|
||||
// If boot not complete, component stays in list and will be processed by BroadcastManagedAwake()
|
||||
|
||||
// Register for all scene lifecycle hooks
|
||||
InsertSorted(sceneUnloadingList, component, component.SceneUnloadingPriority);
|
||||
InsertSorted(sceneReadyList, component, component.SceneReadyPriority);
|
||||
InsertSorted(saveRequestedList, component, component.SavePriority);
|
||||
InsertSorted(restoreRequestedList, component, component.RestorePriority);
|
||||
InsertSorted(destroyList, component, component.DestroyPriority);
|
||||
// If boot not complete, component stays in list and will be processed by BroadcastManagedStart()
|
||||
|
||||
// If this scene is already ready (and we're not in loading mode), call OnSceneReady immediately
|
||||
if (!isLoadingScene && currentSceneReady == sceneName)
|
||||
@@ -164,7 +174,7 @@ namespace Core.Lifecycle
|
||||
LogDebug($"Late registration: Calling OnSceneReady immediately for {component.gameObject.name}");
|
||||
try
|
||||
{
|
||||
component.InvokeSceneReady();
|
||||
component.OnSceneReady();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -202,7 +212,7 @@ namespace Core.Lifecycle
|
||||
|
||||
/// <summary>
|
||||
/// Called by CustomBoot when boot completes.
|
||||
/// Broadcasts ManagedAwake to all registered components.
|
||||
/// Broadcasts ManagedStart to all registered components.
|
||||
/// </summary>
|
||||
public void OnBootCompletionTriggered()
|
||||
{
|
||||
@@ -210,16 +220,16 @@ namespace Core.Lifecycle
|
||||
return;
|
||||
|
||||
LogDebug("=== Boot Completion Triggered ===");
|
||||
BroadcastManagedAwake();
|
||||
BroadcastManagedStart();
|
||||
isBootComplete = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Broadcast OnManagedAwake to all registered components (priority ordered).
|
||||
/// Broadcast OnManagedStart to all registered components (priority ordered).
|
||||
/// </summary>
|
||||
private void BroadcastManagedAwake()
|
||||
private void BroadcastManagedStart()
|
||||
{
|
||||
LogDebug($"Broadcasting ManagedAwake to {managedAwakeList.Count} components");
|
||||
LogDebug($"Broadcasting ManagedStart to {managedAwakeList.Count} components");
|
||||
|
||||
// Create a copy to avoid collection modification during iteration
|
||||
var componentsCopy = new List<ManagedBehaviour>(managedAwakeList);
|
||||
@@ -230,12 +240,12 @@ namespace Core.Lifecycle
|
||||
|
||||
try
|
||||
{
|
||||
component.InvokeManagedAwake();
|
||||
component.OnManagedStart();
|
||||
HandleAutoRegistrations(component);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogError($"[LifecycleManager] Error in OnManagedAwake for {component.gameObject.name}: {ex}");
|
||||
Debug.LogError($"[LifecycleManager] Error in OnManagedStart for {component.gameObject.name}: {ex}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -275,20 +285,20 @@ namespace Core.Lifecycle
|
||||
// Sort by ManagedAwake priority (lower values first)
|
||||
pendingSceneComponents.Sort((a, b) => a.ManagedAwakePriority.CompareTo(b.ManagedAwakePriority));
|
||||
|
||||
// Call OnManagedAwake in priority order
|
||||
// Call OnManagedStart in priority order
|
||||
foreach (var component in pendingSceneComponents)
|
||||
{
|
||||
if (component == null) continue;
|
||||
|
||||
try
|
||||
{
|
||||
component.InvokeManagedAwake();
|
||||
component.OnManagedStart();
|
||||
HandleAutoRegistrations(component);
|
||||
LogDebug($"Processed batched component: {component.gameObject.name} (Priority: {component.ManagedAwakePriority})");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogError($"[LifecycleManager] Error in OnManagedAwake for batched component {component.gameObject.name}: {ex}");
|
||||
Debug.LogError($"[LifecycleManager] Error in OnManagedStart for batched component {component.gameObject.name}: {ex}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -315,7 +325,7 @@ namespace Core.Lifecycle
|
||||
{
|
||||
try
|
||||
{
|
||||
component.InvokeSceneUnloading();
|
||||
component.OnSceneUnloading();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -351,7 +361,7 @@ namespace Core.Lifecycle
|
||||
{
|
||||
try
|
||||
{
|
||||
component.InvokeSceneReady();
|
||||
component.OnSceneReady();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -379,7 +389,7 @@ namespace Core.Lifecycle
|
||||
|
||||
try
|
||||
{
|
||||
string serializedData = component.InvokeSceneSaveRequested();
|
||||
string serializedData = component.OnSceneSaveRequested();
|
||||
if (!string.IsNullOrEmpty(serializedData))
|
||||
{
|
||||
string saveId = component.SaveId;
|
||||
@@ -415,7 +425,7 @@ namespace Core.Lifecycle
|
||||
|
||||
try
|
||||
{
|
||||
string serializedData = component.InvokeGlobalSaveRequested();
|
||||
string serializedData = component.OnGlobalSaveRequested();
|
||||
if (!string.IsNullOrEmpty(serializedData))
|
||||
{
|
||||
saveData[component.SaveId] = serializedData;
|
||||
@@ -455,7 +465,7 @@ namespace Core.Lifecycle
|
||||
{
|
||||
try
|
||||
{
|
||||
component.InvokeSceneRestoreRequested(serializedData);
|
||||
component.OnSceneRestoreRequested(serializedData);
|
||||
restoredCount++;
|
||||
LogDebug($"Restored scene data to: {component.SaveId}");
|
||||
}
|
||||
@@ -469,6 +479,34 @@ namespace Core.Lifecycle
|
||||
LogDebug($"Restored scene data to {restoredCount} components");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Broadcasts scene restore completed event to all registered components.
|
||||
/// Called AFTER all OnSceneRestoreRequested calls complete.
|
||||
/// </summary>
|
||||
public void BroadcastSceneRestoreCompleted()
|
||||
{
|
||||
LogDebug("Broadcasting SceneRestoreCompleted");
|
||||
|
||||
// Create a copy to avoid collection modification during iteration
|
||||
var componentsCopy = new List<ManagedBehaviour>(managedAwakeList);
|
||||
|
||||
foreach (var component in componentsCopy)
|
||||
{
|
||||
if (component == null) continue;
|
||||
|
||||
try
|
||||
{
|
||||
component.OnSceneRestoreCompleted();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogError($"[LifecycleManager] Exception during scene restore completed for {component.SaveId}: {ex}");
|
||||
}
|
||||
}
|
||||
|
||||
LogDebug("SceneRestoreCompleted broadcast complete");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Broadcasts global restore request to all registered components that opt-in.
|
||||
/// Distributes serialized data to matching components by SaveId.
|
||||
@@ -491,7 +529,7 @@ namespace Core.Lifecycle
|
||||
{
|
||||
try
|
||||
{
|
||||
component.InvokeGlobalRestoreRequested(serializedData);
|
||||
component.OnGlobalRestoreRequested(serializedData);
|
||||
restoredCount++;
|
||||
LogDebug($"Restored global data to: {component.SaveId}");
|
||||
}
|
||||
@@ -523,7 +561,7 @@ namespace Core.Lifecycle
|
||||
|
||||
try
|
||||
{
|
||||
component.InvokeGlobalLoadCompleted();
|
||||
component.OnGlobalLoadCompleted();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -550,7 +588,7 @@ namespace Core.Lifecycle
|
||||
|
||||
try
|
||||
{
|
||||
component.InvokeGlobalSaveStarted();
|
||||
component.OnGlobalSaveStarted();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -627,7 +665,7 @@ namespace Core.Lifecycle
|
||||
{
|
||||
if (enableDebugLogging)
|
||||
{
|
||||
Debug.Log($"[LifecycleManager] {message}");
|
||||
Logging.Debug($"[LifecycleManager] {message}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Core.Lifecycle
|
||||
{
|
||||
@@ -12,7 +11,7 @@ namespace Core.Lifecycle
|
||||
#region Priority Properties
|
||||
|
||||
/// <summary>
|
||||
/// Priority for OnManagedAwake (lower values execute first).
|
||||
/// Priority for OnManagedStart (lower values execute first).
|
||||
/// Default: 100
|
||||
/// </summary>
|
||||
public virtual int ManagedAwakePriority => 100;
|
||||
@@ -81,22 +80,6 @@ namespace Core.Lifecycle
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Accessors (for LifecycleManager)
|
||||
|
||||
// Public wrappers to invoke protected lifecycle methods
|
||||
public void InvokeManagedAwake() => OnManagedAwake();
|
||||
public void InvokeSceneUnloading() => OnSceneUnloading();
|
||||
public void InvokeSceneReady() => OnSceneReady();
|
||||
public string InvokeSceneSaveRequested() => OnSceneSaveRequested();
|
||||
public void InvokeSceneRestoreRequested(string data) => OnSceneRestoreRequested(data);
|
||||
public string InvokeGlobalSaveRequested() => OnGlobalSaveRequested();
|
||||
public void InvokeGlobalRestoreRequested(string data) => OnGlobalRestoreRequested(data);
|
||||
public void InvokeManagedDestroy() => OnManagedDestroy();
|
||||
public void InvokeGlobalLoadCompleted() => OnGlobalLoadCompleted();
|
||||
public void InvokeGlobalSaveStarted() => OnGlobalSaveStarted();
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private bool _isRegistered;
|
||||
@@ -107,9 +90,9 @@ namespace Core.Lifecycle
|
||||
|
||||
/// <summary>
|
||||
/// Unity Awake - automatically registers with LifecycleManager.
|
||||
/// IMPORTANT: Derived classes that override Awake MUST call base.Awake()
|
||||
/// SEALED: Cannot be overridden. Use OnManagedAwake() for early initialization or OnManagedStart() for late initialization.
|
||||
/// </summary>
|
||||
protected virtual void Awake()
|
||||
private void Awake()
|
||||
{
|
||||
if (LifecycleManager.Instance != null)
|
||||
{
|
||||
@@ -118,7 +101,7 @@ namespace Core.Lifecycle
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"[ManagedBehaviour] LifecycleManager not found for {gameObject.name}. Component will not receive lifecycle callbacks.");
|
||||
Logging.Warning($"[ManagedBehaviour] LifecycleManager not found for {gameObject.name}. Component will not receive lifecycle callbacks.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,14 +134,27 @@ namespace Core.Lifecycle
|
||||
|
||||
#region Managed Lifecycle Hooks
|
||||
|
||||
/// <summary>
|
||||
/// Called immediately during registration (during Awake).
|
||||
/// Use for early initialization such as setting singleton instances.
|
||||
/// TIMING: Fires during component's Awake(), no execution order guarantees between components.
|
||||
/// NOT priority-ordered - fires whenever Unity calls this component's Awake().
|
||||
/// NOTE: Internal visibility allows LifecycleManager to call directly. Override in derived classes.
|
||||
/// </summary>
|
||||
internal virtual void OnManagedAwake()
|
||||
{
|
||||
// Override in derived classes
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called once per component after bootstrap completes.
|
||||
/// GUARANTEE: Bootstrap resources are available, all managers are initialized.
|
||||
/// For boot-time components: Called during LifecycleManager.BroadcastManagedAwake (priority ordered).
|
||||
/// For boot-time components: Called during LifecycleManager.BroadcastManagedStart (priority ordered).
|
||||
/// For late-registered components: Called immediately upon registration (bootstrap already complete).
|
||||
/// Replaces the old Awake + InitializePostBoot pattern.
|
||||
/// Use for initialization that depends on other systems.
|
||||
/// NOTE: Internal visibility allows LifecycleManager to call directly. Override in derived classes.
|
||||
/// </summary>
|
||||
protected virtual void OnManagedAwake()
|
||||
internal virtual void OnManagedStart()
|
||||
{
|
||||
// Override in derived classes
|
||||
}
|
||||
@@ -167,8 +163,9 @@ namespace Core.Lifecycle
|
||||
/// Called before the scene this component belongs to is unloaded.
|
||||
/// Called in REVERSE priority order (higher values execute first).
|
||||
/// Use for scene-specific cleanup.
|
||||
/// NOTE: Internal visibility allows LifecycleManager to call directly. Override in derived classes.
|
||||
/// </summary>
|
||||
protected virtual void OnSceneUnloading()
|
||||
internal virtual void OnSceneUnloading()
|
||||
{
|
||||
// Override in derived classes
|
||||
}
|
||||
@@ -177,8 +174,9 @@ namespace Core.Lifecycle
|
||||
/// Called after the scene this component belongs to has finished loading.
|
||||
/// Called in priority order (lower values execute first).
|
||||
/// Use for scene-specific initialization.
|
||||
/// NOTE: Internal visibility allows LifecycleManager to call directly. Override in derived classes.
|
||||
/// </summary>
|
||||
protected virtual void OnSceneReady()
|
||||
internal virtual void OnSceneReady()
|
||||
{
|
||||
// Override in derived classes
|
||||
}
|
||||
@@ -192,8 +190,10 @@ namespace Core.Lifecycle
|
||||
/// - Called BEFORE scene unload during scene transitions
|
||||
/// - Frequency: Every scene transition
|
||||
/// - Use for: Level progress, object positions, puzzle states
|
||||
///
|
||||
/// NOTE: Internal visibility allows LifecycleManager to call directly. Override in derived classes.
|
||||
/// </summary>
|
||||
protected virtual string OnSceneSaveRequested()
|
||||
internal virtual string OnSceneSaveRequested()
|
||||
{
|
||||
return null; // Default: no data to save
|
||||
}
|
||||
@@ -202,12 +202,43 @@ namespace Core.Lifecycle
|
||||
/// Called during scene transitions to restore scene-specific state.
|
||||
/// Receives previously serialized data (from OnSceneSaveRequested).
|
||||
///
|
||||
/// IMPORTANT: This method MUST be synchronous. Do not use coroutines or async/await.
|
||||
/// OnSceneRestoreCompleted is called immediately after all restore calls complete,
|
||||
/// so any async operations would still be running when it fires.
|
||||
///
|
||||
/// TIMING:
|
||||
/// - Called AFTER scene load, during OnSceneReady phase
|
||||
/// - Frequency: Every scene transition
|
||||
/// - Use for: Restoring level progress, object positions, puzzle states
|
||||
///
|
||||
/// NOTE: Internal visibility allows LifecycleManager to call directly. Override in derived classes.
|
||||
/// </summary>
|
||||
protected virtual void OnSceneRestoreRequested(string serializedData)
|
||||
internal virtual void OnSceneRestoreRequested(string serializedData)
|
||||
{
|
||||
// Default: no-op
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called after all scene restore operations complete.
|
||||
/// Does NOT receive data - use OnSceneRestoreRequested for that.
|
||||
///
|
||||
/// GUARANTEE:
|
||||
/// - ALWAYS called after scene load, whether there's save data or not
|
||||
/// - All OnSceneRestoreRequested() calls have RETURNED (but async operations may still be running)
|
||||
/// - Safe for synchronous restore operations (JSON deserialization, setting fields, etc.)
|
||||
///
|
||||
/// TIMING:
|
||||
/// - Called AFTER all OnSceneRestoreRequested calls complete (or immediately if no save data exists)
|
||||
/// - Frequency: Every scene transition
|
||||
/// - Use for: Post-restore initialization, first-time initialization, triggering events after state is restored
|
||||
///
|
||||
/// COMMON PATTERN:
|
||||
/// Use this to perform actions that depend on whether data was restored or not.
|
||||
/// Example: Play one-time audio only if it hasn't been played before (_hasPlayed == false).
|
||||
///
|
||||
/// NOTE: Internal visibility allows LifecycleManager to call directly. Override in derived classes.
|
||||
/// </summary>
|
||||
internal virtual void OnSceneRestoreCompleted()
|
||||
{
|
||||
// Default: no-op
|
||||
}
|
||||
@@ -220,8 +251,10 @@ namespace Core.Lifecycle
|
||||
/// - Called ONCE on game boot after save file is read
|
||||
/// - NOT called during scene transitions
|
||||
/// - Use for: Player inventory, unlocked features, card collections
|
||||
///
|
||||
/// NOTE: Internal visibility allows LifecycleManager to call directly. Override in derived classes.
|
||||
/// </summary>
|
||||
protected virtual void OnGlobalRestoreRequested(string serializedData)
|
||||
internal virtual void OnGlobalRestoreRequested(string serializedData)
|
||||
{
|
||||
// Default: no-op
|
||||
}
|
||||
@@ -235,8 +268,10 @@ namespace Core.Lifecycle
|
||||
/// - Called ONCE before save file is written (on quit, manual save, etc.)
|
||||
/// - NOT called during scene transitions
|
||||
/// - Use for: Player inventory, unlocked features, card collections
|
||||
///
|
||||
/// NOTE: Internal visibility allows LifecycleManager to call directly. Override in derived classes.
|
||||
/// </summary>
|
||||
protected virtual string OnGlobalSaveRequested()
|
||||
internal virtual string OnGlobalSaveRequested()
|
||||
{
|
||||
return null; // Default: no data to save
|
||||
}
|
||||
@@ -250,8 +285,10 @@ namespace Core.Lifecycle
|
||||
/// - Called ONCE on game boot after all restore operations complete
|
||||
/// - NOT called during scene transitions
|
||||
/// - Use for: Triggering UI updates, broadcasting load events
|
||||
///
|
||||
/// NOTE: Internal visibility allows LifecycleManager to call directly. Override in derived classes.
|
||||
/// </summary>
|
||||
protected virtual void OnGlobalLoadCompleted()
|
||||
internal virtual void OnGlobalLoadCompleted()
|
||||
{
|
||||
// Default: no-op
|
||||
}
|
||||
@@ -265,8 +302,10 @@ namespace Core.Lifecycle
|
||||
/// - Called ONCE before save file is written
|
||||
/// - NOT called during scene transitions
|
||||
/// - Use for: Final validation, cleanup operations
|
||||
///
|
||||
/// NOTE: Internal visibility allows LifecycleManager to call directly. Override in derived classes.
|
||||
/// </summary>
|
||||
protected virtual void OnGlobalSaveStarted()
|
||||
internal virtual void OnGlobalSaveStarted()
|
||||
{
|
||||
// Default: no-op
|
||||
}
|
||||
@@ -276,8 +315,9 @@ namespace Core.Lifecycle
|
||||
/// Called in REVERSE priority order (higher values execute first).
|
||||
/// NOTE: Most cleanup is automatic (managed events, auto-registrations).
|
||||
/// Only override if you need custom cleanup logic.
|
||||
/// Internal visibility allows LifecycleManager to call directly. Override in derived classes.
|
||||
/// </summary>
|
||||
protected virtual void OnManagedDestroy()
|
||||
internal virtual void OnManagedDestroy()
|
||||
{
|
||||
// Override in derived classes
|
||||
}
|
||||
|
||||
@@ -1,17 +1,144 @@
|
||||
namespace Core
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Runtime.CompilerServices;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Centralized logging system with automatic class/method tagging and editor integration.
|
||||
/// Broadcasts log entries to custom editor windows for filtering and analysis.
|
||||
/// </summary>
|
||||
public static class Logging
|
||||
{
|
||||
[System.Diagnostics.Conditional("ENABLE_LOG")]
|
||||
public static void Debug(object message)
|
||||
/// <summary>
|
||||
/// Event fired when a new log entry is added. Subscribe to this in editor windows.
|
||||
/// </summary>
|
||||
public static event Action<LogEntry> OnLogEntryAdded;
|
||||
|
||||
// Store recent logs for late-subscriber editor windows (e.g., windows opened after play mode started)
|
||||
private static readonly List<LogEntry> RecentLogs = new List<LogEntry>();
|
||||
private const int MaxStoredLogs = 5000; // Prevent memory bloat
|
||||
|
||||
/// <summary>
|
||||
/// Get all recent logs. Used by editor windows when they first open.
|
||||
/// </summary>
|
||||
public static IReadOnlyList<LogEntry> GetRecentLogs() => RecentLogs;
|
||||
|
||||
/// <summary>
|
||||
/// Clear all stored logs. Useful for editor windows "Clear" button.
|
||||
/// </summary>
|
||||
public static void ClearLogs()
|
||||
{
|
||||
UnityEngine.Debug.Log(message);
|
||||
RecentLogs.Clear();
|
||||
}
|
||||
|
||||
[System.Diagnostics.Conditional("ENABLE_LOG")]
|
||||
public static void Warning(object message)
|
||||
public static void Debug(string message,
|
||||
[CallerFilePath] string filePath = "",
|
||||
[CallerMemberName] string memberName = "")
|
||||
{
|
||||
UnityEngine.Debug.LogWarning(message);
|
||||
LogInternal(LogLevel.Debug, message, filePath, memberName);
|
||||
}
|
||||
|
||||
[System.Diagnostics.Conditional("ENABLE_LOG")]
|
||||
public static void Info(string message,
|
||||
[CallerFilePath] string filePath = "",
|
||||
[CallerMemberName] string memberName = "")
|
||||
{
|
||||
LogInternal(LogLevel.Info, message, filePath, memberName);
|
||||
}
|
||||
|
||||
[System.Diagnostics.Conditional("ENABLE_LOG")]
|
||||
public static void Warning(string message,
|
||||
[CallerFilePath] string filePath = "",
|
||||
[CallerMemberName] string memberName = "")
|
||||
{
|
||||
LogInternal(LogLevel.Warning, message, filePath, memberName);
|
||||
}
|
||||
|
||||
public static void Error(string message,
|
||||
[CallerFilePath] string filePath = "",
|
||||
[CallerMemberName] string memberName = "")
|
||||
{
|
||||
LogInternal(LogLevel.Error, message, filePath, memberName);
|
||||
}
|
||||
|
||||
private static void LogInternal(LogLevel level, string message, string filePath, string memberName)
|
||||
{
|
||||
string className = Path.GetFileNameWithoutExtension(filePath);
|
||||
string formattedMessage = $"[{className}][{memberName}] {message}";
|
||||
|
||||
// Create log entry
|
||||
var entry = new LogEntry(className, memberName, message, level, Time.realtimeSinceStartup);
|
||||
|
||||
// Store for late subscribers
|
||||
RecentLogs.Add(entry);
|
||||
if (RecentLogs.Count > MaxStoredLogs)
|
||||
RecentLogs.RemoveAt(0);
|
||||
|
||||
// Broadcast to editor windows (editor-only, won't fire in builds)
|
||||
OnLogEntryAdded?.Invoke(entry);
|
||||
|
||||
// Also log to Unity console
|
||||
switch (level)
|
||||
{
|
||||
case LogLevel.Debug:
|
||||
case LogLevel.Info:
|
||||
UnityEngine.Debug.Log(formattedMessage);
|
||||
break;
|
||||
case LogLevel.Warning:
|
||||
UnityEngine.Debug.LogWarning(formattedMessage);
|
||||
break;
|
||||
case LogLevel.Error:
|
||||
UnityEngine.Debug.LogError(formattedMessage);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a single log entry with class, method, message, level, and timestamp.
|
||||
/// </summary>
|
||||
public class LogEntry
|
||||
{
|
||||
public string ClassName { get; }
|
||||
public string MethodName { get; }
|
||||
public string Message { get; }
|
||||
public LogLevel Level { get; }
|
||||
public float Timestamp { get; }
|
||||
|
||||
public LogEntry(string className, string methodName, string message, LogLevel level, float timestamp)
|
||||
{
|
||||
ClassName = className;
|
||||
MethodName = methodName;
|
||||
Message = message;
|
||||
Level = level;
|
||||
Timestamp = timestamp;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Formatted message with class and method tags.
|
||||
/// Format: [ClassName][MethodName] Message
|
||||
/// </summary>
|
||||
public string FormattedMessage => $"[{ClassName}][{MethodName}] {Message}";
|
||||
|
||||
/// <summary>
|
||||
/// Full formatted message with timestamp and level.
|
||||
/// Format: [12.34s][Debug][ClassName][MethodName] Message
|
||||
/// </summary>
|
||||
public string FullFormattedMessage => $"[{Timestamp:F2}s][{Level}]{FormattedMessage}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Log severity levels.
|
||||
/// </summary>
|
||||
public enum LogLevel
|
||||
{
|
||||
Debug,
|
||||
Info,
|
||||
Warning,
|
||||
Error
|
||||
}
|
||||
}
|
||||
@@ -129,20 +129,18 @@ namespace AppleHills.Core
|
||||
|
||||
#region Lifecycle Methods
|
||||
|
||||
private new void Awake()
|
||||
internal override void OnManagedAwake()
|
||||
{
|
||||
base.Awake(); // CRITICAL: Register with LifecycleManager!
|
||||
|
||||
// Set instance immediately so it's available before OnManagedAwake() is called
|
||||
// Set instance immediately (early initialization)
|
||||
_instance = this;
|
||||
}
|
||||
|
||||
protected override void OnManagedAwake()
|
||||
internal override void OnManagedStart()
|
||||
{
|
||||
// QuickAccess has minimal initialization
|
||||
}
|
||||
|
||||
protected override void OnSceneUnloading()
|
||||
internal override void OnSceneUnloading()
|
||||
{
|
||||
// Clear references BEFORE scene unloads for better cleanup timing
|
||||
ClearReferences();
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace Core.SaveLoad
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"[AppleMachine] SaveLoadManager not available for '{name}'", this);
|
||||
Logging.Warning($"[AppleMachine] SaveLoadManager not available for '{name}'");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace Core.SaveLoad
|
||||
// Optional: Log the auto-generated ID in verbose mode
|
||||
if (verbose && string.IsNullOrEmpty(customSaveId))
|
||||
{
|
||||
Debug.Log($"[SaveableStateMachine] '{name}' will use auto-generated Save ID: {GetSaveId()}", this);
|
||||
Logging.Debug($"[SaveableStateMachine] '{name}' will use auto-generated Save ID: {GetSaveId()}");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -158,7 +158,7 @@ namespace Core.SaveLoad
|
||||
{
|
||||
if (verbose)
|
||||
{
|
||||
Debug.LogWarning($"[SaveableStateMachine] No data to restore for '{name}'", this);
|
||||
Logging.Warning($"[SaveableStateMachine] No data to restore for '{name}'");
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -171,7 +171,7 @@ namespace Core.SaveLoad
|
||||
{
|
||||
if (verbose)
|
||||
{
|
||||
Debug.LogWarning($"[SaveableStateMachine] No state name in save data for '{name}'", this);
|
||||
Logging.Warning($"[SaveableStateMachine] No state name in save data for '{name}'");
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -197,7 +197,7 @@ namespace Core.SaveLoad
|
||||
|
||||
if (verbose)
|
||||
{
|
||||
Debug.Log($"[SaveableStateMachine] Restored '{name}' to state: {saveData.stateName}", this);
|
||||
Logging.Debug($"[SaveableStateMachine] Restored '{name}' to state: {saveData.stateName}");
|
||||
}
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
@@ -215,14 +215,14 @@ namespace Core.SaveLoad
|
||||
[ContextMenu("Log Save ID")]
|
||||
private void LogSaveId()
|
||||
{
|
||||
Debug.Log($"Save ID: {GetSaveId()}", this);
|
||||
Logging.Debug($"Save ID: {GetSaveId()}");
|
||||
}
|
||||
|
||||
[ContextMenu("Test Serialize")]
|
||||
private void TestSerialize()
|
||||
{
|
||||
string serialized = SerializeState();
|
||||
Debug.Log($"Serialized state: {serialized}", this);
|
||||
Logging.Debug($"Serialized state: {serialized}");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -46,11 +46,9 @@ namespace Core.SaveLoad
|
||||
// ManagedBehaviour configuration
|
||||
public override int ManagedAwakePriority => 20; // After GameManager and SceneManagerService
|
||||
|
||||
private new void Awake()
|
||||
internal override void OnManagedAwake()
|
||||
{
|
||||
base.Awake(); // CRITICAL: Register with LifecycleManager!
|
||||
|
||||
// Set instance immediately so it's available before OnManagedAwake() is called
|
||||
// Set instance immediately (early initialization)
|
||||
_instance = this;
|
||||
|
||||
// Initialize critical state immediately
|
||||
@@ -58,7 +56,7 @@ namespace Core.SaveLoad
|
||||
IsRestoringState = false;
|
||||
}
|
||||
|
||||
protected override void OnManagedAwake()
|
||||
internal override void OnManagedStart()
|
||||
{
|
||||
Logging.Debug("[SaveLoadManager] Initialized");
|
||||
|
||||
@@ -69,19 +67,19 @@ namespace Core.SaveLoad
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnSceneReady()
|
||||
internal override void OnSceneReady()
|
||||
{
|
||||
// SaveableInteractables now auto-register via ManagedBehaviour lifecycle
|
||||
// No need to discover and register them manually
|
||||
}
|
||||
|
||||
protected override string OnSceneSaveRequested()
|
||||
internal override string OnSceneSaveRequested()
|
||||
{
|
||||
// SaveLoadManager orchestrates saves, doesn't participate in them
|
||||
return null;
|
||||
}
|
||||
|
||||
protected override string OnGlobalSaveRequested()
|
||||
internal override string OnGlobalSaveRequested()
|
||||
{
|
||||
// SaveLoadManager orchestrates saves, doesn't participate in them
|
||||
return null;
|
||||
@@ -504,9 +502,19 @@ namespace Core.SaveLoad
|
||||
/// </summary>
|
||||
public void RestoreSceneData()
|
||||
{
|
||||
if (Lifecycle.LifecycleManager.Instance == null)
|
||||
{
|
||||
Logging.Warning("[SaveLoadManager] LifecycleManager not available for scene restore");
|
||||
return;
|
||||
}
|
||||
|
||||
if (currentSaveData == null || currentSaveData.participantStates == null)
|
||||
{
|
||||
Logging.Debug("[SaveLoadManager] No scene data to restore");
|
||||
Logging.Debug("[SaveLoadManager] No scene data to restore (first visit or no save data)");
|
||||
|
||||
// Still broadcast restore completed so components can initialize properly
|
||||
Lifecycle.LifecycleManager.Instance.BroadcastSceneRestoreCompleted();
|
||||
Logging.Debug($"[SaveLoadManager] Scene restore completed (no data)");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -520,11 +528,12 @@ namespace Core.SaveLoad
|
||||
}
|
||||
|
||||
// Restore scene data via LifecycleManager
|
||||
if (Lifecycle.LifecycleManager.Instance != null)
|
||||
{
|
||||
Lifecycle.LifecycleManager.Instance.BroadcastSceneRestoreRequested(saveDataDict);
|
||||
Logging.Debug($"[SaveLoadManager] Broadcast scene restore to LifecycleManager");
|
||||
}
|
||||
Lifecycle.LifecycleManager.Instance.BroadcastSceneRestoreRequested(saveDataDict);
|
||||
Logging.Debug($"[SaveLoadManager] Broadcast scene restore to LifecycleManager");
|
||||
|
||||
// Broadcast scene restore completed - ALWAYS called, whether there's data or not
|
||||
Lifecycle.LifecycleManager.Instance.BroadcastSceneRestoreCompleted();
|
||||
Logging.Debug($"[SaveLoadManager] Scene restore completed");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -706,7 +715,7 @@ namespace Core.SaveLoad
|
||||
{
|
||||
IsSaving = false;
|
||||
OnSaveCompleted?.Invoke(slot);
|
||||
Debug.Log($"[SaveLoadManager] Save completed for slot '{slot}'");
|
||||
Logging.Debug($"[SaveLoadManager] Save completed for slot '{slot}'");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,9 +30,9 @@ namespace Core
|
||||
// Enable save/load participation
|
||||
public override bool AutoRegisterForSave => true;
|
||||
|
||||
protected override void Awake()
|
||||
internal override void OnManagedAwake()
|
||||
{
|
||||
base.Awake();
|
||||
base.OnManagedAwake();
|
||||
|
||||
_director = GetComponent<PlayableDirector>();
|
||||
if (_director != null)
|
||||
@@ -65,7 +65,7 @@ namespace Core
|
||||
|
||||
#region Save/Load Implementation
|
||||
|
||||
protected override string OnSceneSaveRequested()
|
||||
internal override string OnSceneSaveRequested()
|
||||
{
|
||||
var saveData = new PlayableDirectorSaveData
|
||||
{
|
||||
@@ -77,11 +77,11 @@ namespace Core
|
||||
return JsonUtility.ToJson(saveData);
|
||||
}
|
||||
|
||||
protected override void OnSceneRestoreRequested(string serializedData)
|
||||
internal override void OnSceneRestoreRequested(string serializedData)
|
||||
{
|
||||
if (string.IsNullOrEmpty(serializedData))
|
||||
{
|
||||
Debug.LogWarning($"[SaveablePlayableDirector] No save data to restore for {gameObject.name}");
|
||||
Logging.Warning($"[SaveablePlayableDirector] No save data to restore for {gameObject.name}");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace Core
|
||||
_director.time = _director.duration;
|
||||
_director.Evaluate(); // Force evaluation to apply the state
|
||||
|
||||
Debug.Log($"[SaveablePlayableDirector] Restored completed timeline '{gameObject.name}' - seeked to end");
|
||||
Logging.Debug($"[SaveablePlayableDirector] Restored completed timeline '{gameObject.name}' - seeked to end");
|
||||
}
|
||||
else if (_hasPlayed && saveData.playbackTime > 0)
|
||||
{
|
||||
@@ -107,7 +107,7 @@ namespace Core
|
||||
_director.time = saveData.playbackTime;
|
||||
_director.Evaluate();
|
||||
|
||||
Debug.Log($"[SaveablePlayableDirector] Restored timeline '{gameObject.name}' at time {saveData.playbackTime}");
|
||||
Logging.Debug($"[SaveablePlayableDirector] Restored timeline '{gameObject.name}' at time {saveData.playbackTime}");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -115,7 +115,7 @@ namespace Core
|
||||
_director.time = 0;
|
||||
_director.Evaluate();
|
||||
|
||||
Debug.Log($"[SaveablePlayableDirector] Timeline '{gameObject.name}' not yet played - at start");
|
||||
Logging.Debug($"[SaveablePlayableDirector] Timeline '{gameObject.name}' not yet played - at start");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,11 +47,9 @@ namespace Core
|
||||
// ManagedBehaviour configuration
|
||||
public override int ManagedAwakePriority => 15; // Core infrastructure, after GameManager
|
||||
|
||||
private new void Awake()
|
||||
internal override void OnManagedAwake()
|
||||
{
|
||||
base.Awake(); // CRITICAL: Register with LifecycleManager!
|
||||
|
||||
// Set instance immediately so it's available before OnManagedAwake() is called
|
||||
// Set instance immediately (early initialization)
|
||||
_instance = this;
|
||||
|
||||
// Initialize current scene tracking - critical for scene management
|
||||
@@ -65,17 +63,17 @@ namespace Core
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnManagedAwake()
|
||||
internal override void OnManagedStart()
|
||||
{
|
||||
// Set up loading screen reference and events
|
||||
// This must happen in ManagedAwake because LoadingScreenController instance needs to be set first
|
||||
// This must happen in ManagedStart because LoadingScreenController instance needs to be set first
|
||||
_loadingScreen = LoadingScreenController.Instance;
|
||||
SetupLoadingScreenEvents();
|
||||
|
||||
// Load verbosity settings
|
||||
_logVerbosity = DeveloperSettingsProvider.Instance.GetSettings<DebugSettings>().sceneLogVerbosity;
|
||||
|
||||
LogDebugMessage($"SceneManagerService initialized, current scene is: {CurrentGameplayScene}");
|
||||
Logging.Debug($"SceneManagerService initialized, current scene is: {CurrentGameplayScene}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -93,19 +91,19 @@ namespace Core
|
||||
if (activeScene.name != BootstrapSceneName)
|
||||
{
|
||||
CurrentGameplayScene = activeScene.name;
|
||||
LogDebugMessage($"Initialized with current scene: {CurrentGameplayScene}");
|
||||
Logging.Debug($"Initialized with current scene: {CurrentGameplayScene}");
|
||||
}
|
||||
// Otherwise default to MainMenu
|
||||
else
|
||||
{
|
||||
CurrentGameplayScene = "AppleHillsOverworld";
|
||||
LogDebugMessage($"Initialized with default scene: {CurrentGameplayScene}");
|
||||
Logging.Debug($"Initialized with default scene: {CurrentGameplayScene}");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CurrentGameplayScene = "AppleHillsOverworld";
|
||||
LogDebugMessage($"No valid active scene, defaulting to: {CurrentGameplayScene}");
|
||||
Logging.Debug($"No valid active scene, defaulting to: {CurrentGameplayScene}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -307,7 +305,7 @@ namespace Core
|
||||
}
|
||||
|
||||
// PHASE 2: Broadcast scene unloading - notify components to cleanup
|
||||
LogDebugMessage($"Broadcasting OnSceneUnloading for: {oldSceneName}");
|
||||
Logging.Debug($"Broadcasting OnSceneUnloading for: {oldSceneName}");
|
||||
LifecycleManager.Instance?.BroadcastSceneUnloading(oldSceneName);
|
||||
|
||||
// PHASE 3: Save scene-specific data via SaveLoadManager (unless skipSave is true)
|
||||
@@ -316,19 +314,19 @@ namespace Core
|
||||
var debugSettings = DeveloperSettingsProvider.Instance.GetSettings<DebugSettings>();
|
||||
if (debugSettings.useSaveLoadSystem)
|
||||
{
|
||||
LogDebugMessage($"Saving scene data for: {oldSceneName}");
|
||||
Logging.Debug($"Saving scene data for: {oldSceneName}");
|
||||
SaveLoadManager.Instance.SaveSceneData();
|
||||
}
|
||||
}
|
||||
else if (skipSave)
|
||||
{
|
||||
LogDebugMessage($"Skipping save for: {oldSceneName} (skipSave=true)");
|
||||
Logging.Debug($"Skipping save for: {oldSceneName} (skipSave=true)");
|
||||
}
|
||||
|
||||
// PHASE 4: Clear PuzzleManager state before scene transition
|
||||
if (PuzzleS.PuzzleManager.Instance != null)
|
||||
{
|
||||
LogDebugMessage($"Clearing puzzle state before scene transition");
|
||||
Logging.Debug($"Clearing puzzle state before scene transition");
|
||||
PuzzleS.PuzzleManager.Instance.ClearPuzzleState();
|
||||
}
|
||||
|
||||
@@ -352,7 +350,7 @@ namespace Core
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Warning($"[SceneManagerService] Previous scene '{oldSceneName}' is not loaded, skipping unload.");
|
||||
Logging.Warning($"Previous scene '{oldSceneName}' is not loaded, skipping unload.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -364,7 +362,7 @@ namespace Core
|
||||
}
|
||||
|
||||
// PHASE 8: Begin scene loading mode - enables priority-ordered component initialization
|
||||
LogDebugMessage($"Beginning scene load for: {newSceneName}");
|
||||
Logging.Debug($"Beginning scene load for: {newSceneName}");
|
||||
LifecycleManager.Instance?.BeginSceneLoad(newSceneName);
|
||||
|
||||
// PHASE 9: Load new gameplay scene
|
||||
@@ -372,7 +370,7 @@ namespace Core
|
||||
CurrentGameplayScene = newSceneName;
|
||||
|
||||
// PHASE 10: Broadcast scene ready - processes batched components in priority order, then calls OnSceneReady
|
||||
LogDebugMessage($"Broadcasting OnSceneReady for: {newSceneName}");
|
||||
Logging.Debug($"Broadcasting OnSceneReady for: {newSceneName}");
|
||||
LifecycleManager.Instance?.BroadcastSceneReady(newSceneName);
|
||||
|
||||
// PHASE 11: Restore scene-specific data via SaveLoadManager
|
||||
@@ -381,13 +379,14 @@ namespace Core
|
||||
var debugSettings = DeveloperSettingsProvider.Instance.GetSettings<DebugSettings>();
|
||||
if (debugSettings.useSaveLoadSystem)
|
||||
{
|
||||
LogDebugMessage($"Restoring scene data for: {newSceneName}");
|
||||
Logging.Debug($"Restoring scene data for: {newSceneName}");
|
||||
SaveLoadManager.Instance.RestoreSceneData();
|
||||
}
|
||||
}
|
||||
else if (skipSave)
|
||||
{
|
||||
LogDebugMessage($"Skipping restore for: {newSceneName} (skipSave=true)");
|
||||
SaveLoadManager.Instance.RestoreSceneData();
|
||||
Logging.Debug($"Skipping restore for: {newSceneName} (skipSave=true)");
|
||||
}
|
||||
|
||||
// PHASE 12: Only hide the loading screen if autoHideLoadingScreen is true
|
||||
@@ -396,13 +395,5 @@ namespace Core
|
||||
_loadingScreen.HideLoadingScreen();
|
||||
}
|
||||
}
|
||||
|
||||
private void LogDebugMessage(string message)
|
||||
{
|
||||
if (_logVerbosity <= LogVerbosity.Debug)
|
||||
{
|
||||
Logging.Debug($"[SceneManagerService] {message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,20 +21,18 @@ namespace Core
|
||||
// ManagedBehaviour configuration
|
||||
public override int ManagedAwakePriority => 70; // Platform-specific utility
|
||||
|
||||
private new void Awake()
|
||||
internal override void OnManagedAwake()
|
||||
{
|
||||
base.Awake(); // CRITICAL: Register with LifecycleManager!
|
||||
|
||||
// Set instance immediately so it's available before OnManagedAwake() is called
|
||||
// Set instance immediately (early initialization)
|
||||
_instance = this;
|
||||
|
||||
// Load verbosity settings early (GameManager sets up settings in its Awake)
|
||||
// Load verbosity settings early (GameManager sets up settings in its OnManagedAwake)
|
||||
_logVerbosity = DeveloperSettingsProvider.Instance.GetSettings<DebugSettings>().sceneLogVerbosity;
|
||||
|
||||
LogDebugMessage("Initialized");
|
||||
Logging.Debug("Initialized");
|
||||
}
|
||||
|
||||
protected override void OnManagedAwake()
|
||||
internal override void OnManagedStart()
|
||||
{
|
||||
// Subscribe to SceneManagerService to enforce orientation on every scene load
|
||||
if (SceneManagerService.Instance != null)
|
||||
@@ -51,7 +49,7 @@ namespace Core
|
||||
#endif
|
||||
}
|
||||
|
||||
protected override void OnSceneReady()
|
||||
internal override void OnSceneReady()
|
||||
{
|
||||
// Handle orientation when scene is ready (initial scene)
|
||||
// Note: This fires for the scene that just loaded, LifecycleManager tracks which scene
|
||||
@@ -73,7 +71,7 @@ namespace Core
|
||||
if (sceneName.ToLower().Contains("bootstrap"))
|
||||
{
|
||||
// Bootstrap being loaded additively, don't do anything
|
||||
LogDebugMessage($"Detected bootstrapped scene: '{sceneName}'. Skipping orientation enforcement.");
|
||||
Logging.Debug($"Detected bootstrapped scene: '{sceneName}'. Skipping orientation enforcement.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -83,23 +81,23 @@ namespace Core
|
||||
}
|
||||
else
|
||||
{
|
||||
LogDebugMessage($"No orientationConfig assigned. Defaulting to Landscape for scene '{sceneName}'");
|
||||
Logging.Debug($"No orientationConfig assigned. Defaulting to Landscape for scene '{sceneName}'");
|
||||
}
|
||||
|
||||
switch (requirement)
|
||||
{
|
||||
case ScreenOrientationRequirement.Portrait:
|
||||
LogDebugMessage($"Forcing Portrait for scene '{sceneName}'");
|
||||
Logging.Debug($"Forcing Portrait for scene '{sceneName}'");
|
||||
StartCoroutine(ForcePortrait());
|
||||
break;
|
||||
case ScreenOrientationRequirement.Landscape:
|
||||
LogDebugMessage($"Forcing Landscape for scene '{sceneName}'");
|
||||
Logging.Debug($"Forcing Landscape for scene '{sceneName}'");
|
||||
StartCoroutine(ForceLandscape());
|
||||
break;
|
||||
case ScreenOrientationRequirement.NotApplicable:
|
||||
default:
|
||||
// Default to landscape when no specific requirement is found
|
||||
LogDebugMessage($"No specific orientation for scene '{sceneName}'. Defaulting to Landscape");
|
||||
Logging.Debug($"No specific orientation for scene '{sceneName}'. Defaulting to Landscape");
|
||||
StartCoroutine(ForceLandscape());
|
||||
break;
|
||||
}
|
||||
@@ -127,12 +125,12 @@ namespace Core
|
||||
if (!currentlyLandscape)
|
||||
{
|
||||
// Lock it to portrait and allow the device to orient itself
|
||||
LogDebugMessage($"Actually forcing Portrait from previous: {Screen.orientation}");
|
||||
Logging.Debug($"Actually forcing Portrait from previous: {Screen.orientation}");
|
||||
Screen.orientation = ScreenOrientation.LandscapeRight;
|
||||
}
|
||||
else
|
||||
{
|
||||
LogDebugMessage($"Skipping Landscape enforcement, device already in: {Screen.orientation}");
|
||||
Logging.Debug($"Skipping Landscape enforcement, device already in: {Screen.orientation}");
|
||||
}
|
||||
|
||||
yield return null;
|
||||
@@ -160,12 +158,12 @@ namespace Core
|
||||
if (!currentlyPortrait)
|
||||
{
|
||||
// Lock it to portrait and allow the device to orient itself
|
||||
LogDebugMessage($"Actually forcing Portrait from previous: {Screen.orientation}");
|
||||
Logging.Debug($"Actually forcing Portrait from previous: {Screen.orientation}");
|
||||
Screen.orientation = ScreenOrientation.PortraitUpsideDown;
|
||||
}
|
||||
else
|
||||
{
|
||||
LogDebugMessage($"Skipping Portrait enforcement, device already in: {Screen.orientation}");
|
||||
Logging.Debug($"Skipping Portrait enforcement, device already in: {Screen.orientation}");
|
||||
}
|
||||
|
||||
yield return null;
|
||||
@@ -181,13 +179,5 @@ namespace Core
|
||||
// Allow device to auto-rotate to correct portrait orientation
|
||||
Screen.orientation = ScreenOrientation.AutoRotation;
|
||||
}
|
||||
|
||||
private void LogDebugMessage(string message)
|
||||
{
|
||||
if (_logVerbosity <= LogVerbosity.Debug)
|
||||
{
|
||||
Logging.Debug($"[SceneOrientationEnforcer] {message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using AppleHills.Core.Settings;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Core.Settings
|
||||
{
|
||||
@@ -21,7 +19,7 @@ namespace Core.Settings
|
||||
public static void Register<T>(T service) where T : class
|
||||
{
|
||||
Services[typeof(T)] = service;
|
||||
LogDebugMessage($"Service registered: {typeof(T).Name}");
|
||||
Logging.Debug($"Service registered: {typeof(T).Name}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -36,7 +34,7 @@ namespace Core.Settings
|
||||
return service as T;
|
||||
}
|
||||
|
||||
Logging.Warning($"[ServiceLocator] Service of type {typeof(T).Name} not found!");
|
||||
Logging.Warning($"Service of type {typeof(T).Name} not found!");
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -46,16 +44,7 @@ namespace Core.Settings
|
||||
public static void Clear()
|
||||
{
|
||||
Services.Clear();
|
||||
LogDebugMessage("All services cleared");
|
||||
}
|
||||
|
||||
private static void LogDebugMessage(string message)
|
||||
{
|
||||
if (DeveloperSettingsProvider.Instance.GetSettings<DebugSettings>().settingsLogVerbosity <=
|
||||
LogVerbosity.Debug)
|
||||
{
|
||||
Logging.Debug($"[ServiceLocator] {message}");
|
||||
}
|
||||
Logging.Debug("All services cleared");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
using UnityEngine;
|
||||
using Pixelplacement;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Core;
|
||||
using Core.Lifecycle;
|
||||
using Core.SaveLoad;
|
||||
using UnityEngine.Audio;
|
||||
|
||||
public class PicnicBehaviour : MonoBehaviour
|
||||
public class PicnicBehaviour : ManagedBehaviour
|
||||
{
|
||||
[Header("Random Call Settings")]
|
||||
public float getDistractedMin = 2f;
|
||||
@@ -17,7 +18,8 @@ public class PicnicBehaviour : MonoBehaviour
|
||||
private Animator animator;
|
||||
|
||||
[Header("The FakeChocolate to destroy!")]
|
||||
[SerializeField] private GameObject fakeChocolate; // Assign in Inspector
|
||||
[SerializeField] private GameObject fakeChocolate;
|
||||
[SerializeField] private GameObject realChocolate;
|
||||
|
||||
private AppleAudioSource _audioSource;
|
||||
public AudioResource distractedAudioClips;
|
||||
@@ -25,32 +27,44 @@ public class PicnicBehaviour : MonoBehaviour
|
||||
public AudioResource feederClips;
|
||||
public AudioResource moanerClips;
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
StartCoroutine(StateCycleRoutine());
|
||||
}
|
||||
// Save system configuration
|
||||
public override bool AutoRegisterForSave => true;
|
||||
|
||||
void Awake()
|
||||
// Runtime state tracking
|
||||
private bool _fakeChocolateDestroyed;
|
||||
|
||||
internal override void OnManagedAwake()
|
||||
{
|
||||
stateMachine = GetComponent<AppleMachine>();
|
||||
animator = GetComponent<Animator>();
|
||||
_audioSource = GetComponent<AppleAudioSource>();
|
||||
}
|
||||
|
||||
internal override void OnSceneRestoreCompleted()
|
||||
{
|
||||
if (_fakeChocolateDestroyed)
|
||||
{
|
||||
DestroyChocolateObjects();
|
||||
}
|
||||
else
|
||||
{
|
||||
StartCoroutine(StateCycleRoutine());
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerator StateCycleRoutine()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
// Distracted state
|
||||
float distractedWait = Random.Range(getDistractedMin, getDistractedMax);
|
||||
float distractedWait = UnityEngine.Random.Range(getDistractedMin, getDistractedMax);
|
||||
stateMachine.ChangeState("Picnic PPL Distracted");
|
||||
animator.SetBool("theyDistracted", true);
|
||||
_audioSource.Stop();
|
||||
yield return new WaitForSeconds(distractedWait);
|
||||
|
||||
// Chilling state
|
||||
float chillingWait = Random.Range(getFlirtyMin, getFlirtyMax);
|
||||
float chillingWait = UnityEngine.Random.Range(getFlirtyMin, getFlirtyMax);
|
||||
stateMachine.ChangeState("Picnic PPL Chilling");
|
||||
animator.SetBool("theyDistracted", false);
|
||||
_audioSource.Stop();
|
||||
@@ -58,27 +72,33 @@ public class PicnicBehaviour : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
void StopAudio()
|
||||
{
|
||||
_audioSource.Stop();
|
||||
}
|
||||
|
||||
public void triedToStealChocolate()
|
||||
{
|
||||
_audioSource.Stop();
|
||||
animator.SetTrigger("theyAngry");
|
||||
//stateMachine.ChangeState("Picnic PPL Angry");
|
||||
Logging.Debug("Hey! Don't steal my chocolate!");
|
||||
_audioSource.audioSource.resource = angryAudioClips;
|
||||
_audioSource.Play(0);
|
||||
}
|
||||
|
||||
public void destroyFakeChocolate()
|
||||
{
|
||||
_fakeChocolateDestroyed = true;
|
||||
Destroy(fakeChocolate);
|
||||
Destroy(realChocolate);
|
||||
}
|
||||
|
||||
private void DestroyChocolateObjects()
|
||||
{
|
||||
if (fakeChocolate != null)
|
||||
{
|
||||
Destroy(fakeChocolate);
|
||||
fakeChocolate = null; // Optional: clear reference
|
||||
fakeChocolate = null;
|
||||
}
|
||||
|
||||
if (realChocolate != null)
|
||||
{
|
||||
realChocolate.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,5 +120,33 @@ public class PicnicBehaviour : MonoBehaviour
|
||||
_audioSource.Play(0);
|
||||
}
|
||||
|
||||
internal override string OnSceneSaveRequested()
|
||||
{
|
||||
var state = new PicnicBehaviourState { fakeChocolateDestroyed = _fakeChocolateDestroyed };
|
||||
return JsonUtility.ToJson(state);
|
||||
}
|
||||
|
||||
internal override void OnSceneRestoreRequested(string serializedData)
|
||||
{
|
||||
if (string.IsNullOrEmpty(serializedData)) return;
|
||||
|
||||
try
|
||||
{
|
||||
var state = JsonUtility.FromJson<PicnicBehaviourState>(serializedData);
|
||||
if (state != null)
|
||||
{
|
||||
_fakeChocolateDestroyed = state.fakeChocolateDestroyed;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogWarning($"[PicnicBehaviour] Failed to restore state: {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class PicnicBehaviourState
|
||||
{
|
||||
public bool fakeChocolateDestroyed;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Core;
|
||||
using UnityEngine;
|
||||
using Core.Lifecycle;
|
||||
|
||||
@@ -21,7 +22,7 @@ public class soundBird_CanFly : ManagedBehaviour
|
||||
|
||||
#region Save/Load Implementation
|
||||
|
||||
protected override string OnSceneSaveRequested()
|
||||
internal override string OnSceneSaveRequested()
|
||||
{
|
||||
var saveData = new SoundBirdSaveData
|
||||
{
|
||||
@@ -31,11 +32,11 @@ public class soundBird_CanFly : ManagedBehaviour
|
||||
return JsonUtility.ToJson(saveData);
|
||||
}
|
||||
|
||||
protected override void OnSceneRestoreRequested(string serializedData)
|
||||
internal override void OnSceneRestoreRequested(string serializedData)
|
||||
{
|
||||
if (string.IsNullOrEmpty(serializedData))
|
||||
{
|
||||
Debug.LogWarning($"[soundBird_CanFly] No save data to restore for {gameObject.name}");
|
||||
Logging.Warning($"[soundBird_CanFly] No save data to restore for {gameObject.name}");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -43,7 +44,7 @@ public class soundBird_CanFly : ManagedBehaviour
|
||||
if (saveData != null)
|
||||
{
|
||||
canFly = saveData.canFly;
|
||||
Debug.Log($"[soundBird_CanFly] Restored canFly state: {canFly}");
|
||||
Logging.Debug($"[soundBird_CanFly] Restored canFly state: {canFly}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -95,6 +95,7 @@ namespace AppleHills.Data.CardSystem
|
||||
|
||||
public enum CardZone
|
||||
{
|
||||
NotApplicable,
|
||||
AppleHills,
|
||||
Quarry,
|
||||
CementFactory,
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using AppleHills.Data.CardSystem;
|
||||
using Core;
|
||||
using Core.Lifecycle;
|
||||
using Core.SaveLoad;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Data.CardSystem
|
||||
@@ -41,25 +40,22 @@ namespace Data.CardSystem
|
||||
// Event callbacks using System.Action
|
||||
public event Action<List<CardData>> OnBoosterOpened;
|
||||
public event Action<CardData> OnCardCollected;
|
||||
public event Action<CardData> OnCardRarityUpgraded;
|
||||
public event Action<int> OnBoosterCountChanged;
|
||||
public event Action<CardData> OnPendingCardAdded;
|
||||
public event Action<CardData> OnCardPlacedInAlbum;
|
||||
|
||||
public override int ManagedAwakePriority => 60; // Data systems
|
||||
|
||||
private new void Awake()
|
||||
internal override void OnManagedAwake()
|
||||
{
|
||||
base.Awake(); // CRITICAL: Register with LifecycleManager!
|
||||
|
||||
// Set instance immediately so it's available before OnManagedAwake() is called
|
||||
// Set instance immediately (early initialization)
|
||||
_instance = this;
|
||||
|
||||
// Load card definitions from Addressables, then register with save system
|
||||
LoadCardDefinitionsFromAddressables();
|
||||
}
|
||||
|
||||
protected override void OnManagedAwake()
|
||||
internal override void OnManagedStart()
|
||||
{
|
||||
Logging.Debug("[CardSystemManager] Initialized");
|
||||
}
|
||||
@@ -703,15 +699,31 @@ namespace Data.CardSystem
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clears all card collection data - inventory, pending cards, boosters, and placement tracking
|
||||
/// Used for dev reset functionality
|
||||
/// </summary>
|
||||
public void ClearAllCollectionData()
|
||||
{
|
||||
playerInventory.ClearAllCards();
|
||||
playerInventory.BoosterPackCount = 0;
|
||||
_pendingRevealCards.Clear();
|
||||
_placedInAlbumCardIds.Clear();
|
||||
|
||||
OnBoosterCountChanged?.Invoke(0);
|
||||
|
||||
Logging.Debug("[CardSystemManager] Cleared all collection data (inventory, boosters, pending, placement tracking)");
|
||||
}
|
||||
|
||||
#region Save/Load Lifecycle Hooks
|
||||
|
||||
protected override string OnGlobalSaveRequested()
|
||||
internal override string OnGlobalSaveRequested()
|
||||
{
|
||||
var state = ExportCardCollectionState();
|
||||
return JsonUtility.ToJson(state);
|
||||
}
|
||||
|
||||
protected override void OnGlobalRestoreRequested(string serializedData)
|
||||
internal override void OnGlobalRestoreRequested(string serializedData)
|
||||
{
|
||||
if (string.IsNullOrEmpty(serializedData))
|
||||
{
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using Core;
|
||||
using Core.Lifecycle;
|
||||
using Interactions;
|
||||
@@ -37,7 +35,7 @@ namespace Dialogue
|
||||
|
||||
public override int ManagedAwakePriority => 150; // Dialogue systems
|
||||
|
||||
protected override void OnManagedAwake()
|
||||
internal override void OnManagedStart()
|
||||
{
|
||||
// Get required components
|
||||
appleAudioSource = GetComponent<AppleAudioSource>();
|
||||
@@ -186,8 +184,10 @@ namespace Dialogue
|
||||
return null;
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
protected override void OnDestroy()
|
||||
{
|
||||
base.OnDestroy();
|
||||
|
||||
// Unregister from events
|
||||
if (PuzzleManager.Instance != null)
|
||||
PuzzleManager.Instance.OnStepCompleted -= OnAnyPuzzleStepCompleted;
|
||||
|
||||
@@ -52,11 +52,9 @@ namespace Input
|
||||
|
||||
public override int ManagedAwakePriority => 25; // Input infrastructure
|
||||
|
||||
private new void Awake()
|
||||
internal override void OnManagedAwake()
|
||||
{
|
||||
base.Awake(); // CRITICAL: Register with LifecycleManager!
|
||||
|
||||
// Set instance immediately so it's available before OnManagedAwake() is called
|
||||
// Set instance immediately (early initialization)
|
||||
_instance = this;
|
||||
|
||||
// Load verbosity settings early
|
||||
@@ -89,10 +87,10 @@ namespace Input
|
||||
SwitchInputOnSceneLoaded(SceneManager.GetActiveScene().name);
|
||||
}
|
||||
|
||||
protected override void OnManagedAwake()
|
||||
internal override void OnManagedStart()
|
||||
{
|
||||
// Subscribe to scene load events from SceneManagerService
|
||||
// This must happen in ManagedAwake because SceneManagerService instance needs to be set first
|
||||
// This must happen in ManagedStart because SceneManagerService instance needs to be set first
|
||||
if (SceneManagerService.Instance != null)
|
||||
{
|
||||
SceneManagerService.Instance.SceneLoadCompleted += OnSceneLoadCompleted;
|
||||
@@ -104,7 +102,7 @@ namespace Input
|
||||
/// </summary>
|
||||
private void OnSceneLoadCompleted(string sceneName)
|
||||
{
|
||||
LogDebugMessage($"Scene loaded: {sceneName}, restoring input mode");
|
||||
Logging.Debug($"Scene loaded: {sceneName}, restoring input mode");
|
||||
SwitchInputOnSceneLoaded(sceneName);
|
||||
}
|
||||
|
||||
@@ -182,24 +180,24 @@ namespace Input
|
||||
Vector2 screenPos = positionAction.ReadValue<Vector2>();
|
||||
Vector3 worldPos = Camera.main.ScreenToWorldPoint(screenPos);
|
||||
Vector2 worldPos2D = new Vector2(worldPos.x, worldPos.y);
|
||||
LogDebugMessage($"TapMove performed at {worldPos2D}");
|
||||
Logging.Debug($"TapMove performed at {worldPos2D}");
|
||||
|
||||
// First try to delegate to an override consumer if available
|
||||
if (TryDelegateToOverrideConsumer(screenPos, worldPos2D))
|
||||
{
|
||||
LogDebugMessage("Tap delegated to override consumer");
|
||||
Logging.Debug("Tap delegated to override consumer");
|
||||
return;
|
||||
}
|
||||
|
||||
// Then try to delegate to any ITouchInputConsumer (UI or world interactable)
|
||||
if (!TryDelegateToAnyInputConsumer(screenPos, worldPos2D))
|
||||
{
|
||||
LogDebugMessage("No input consumer found, forwarding tap to default consumer");
|
||||
Logging.Debug("No input consumer found, forwarding tap to default consumer");
|
||||
defaultConsumer?.OnTap(worldPos2D);
|
||||
}
|
||||
else
|
||||
{
|
||||
LogDebugMessage("Tap delegated to input consumer");
|
||||
Logging.Debug("Tap delegated to input consumer");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,13 +210,13 @@ namespace Input
|
||||
Vector2 screenPos = positionAction.ReadValue<Vector2>();
|
||||
Vector3 worldPos = Camera.main.ScreenToWorldPoint(screenPos);
|
||||
Vector2 worldPos2D = new Vector2(worldPos.x, worldPos.y);
|
||||
LogDebugMessage($"HoldMove started at {worldPos2D}");
|
||||
Logging.Debug($"HoldMove started at {worldPos2D}");
|
||||
|
||||
// First check for override consumers
|
||||
if (_overrideConsumers.Count > 0)
|
||||
{
|
||||
_activeHoldConsumer = _overrideConsumers[_overrideConsumers.Count - 1];
|
||||
LogDebugMessage($"Hold delegated to override consumer: {_activeHoldConsumer}");
|
||||
Logging.Debug($"Hold delegated to override consumer: {_activeHoldConsumer}");
|
||||
_activeHoldConsumer.OnHoldStart(worldPos2D);
|
||||
return;
|
||||
}
|
||||
@@ -238,7 +236,7 @@ namespace Input
|
||||
Vector2 screenPos = positionAction.ReadValue<Vector2>();
|
||||
Vector3 worldPos = Camera.main.ScreenToWorldPoint(screenPos);
|
||||
Vector2 worldPos2D = new Vector2(worldPos.x, worldPos.y);
|
||||
LogDebugMessage($"HoldMove canceled at {worldPos2D}");
|
||||
Logging.Debug($"HoldMove canceled at {worldPos2D}");
|
||||
|
||||
// Notify the active hold consumer that the hold has ended
|
||||
_activeHoldConsumer?.OnHoldEnd(worldPos2D);
|
||||
@@ -302,7 +300,7 @@ namespace Input
|
||||
}
|
||||
if (consumer != null)
|
||||
{
|
||||
LogDebugMessage($"Delegating tap to UI consumer at {screenPos} (GameObject: {result.gameObject.name})");
|
||||
Logging.Debug($"Delegating tap to UI consumer at {screenPos} (GameObject: {result.gameObject.name})");
|
||||
consumer.OnTap(screenPos);
|
||||
return true;
|
||||
}
|
||||
@@ -331,7 +329,7 @@ namespace Input
|
||||
}
|
||||
if (consumer != null)
|
||||
{
|
||||
LogDebugMessage($"Delegating tap to consumer at {worldPos} (GameObject: {hitWithMask.gameObject.name})");
|
||||
Logging.Debug($"Delegating tap to consumer at {worldPos} (GameObject: {hitWithMask.gameObject.name})");
|
||||
consumer.OnTap(worldPos);
|
||||
return true;
|
||||
}
|
||||
@@ -345,15 +343,15 @@ namespace Input
|
||||
var consumer = hit.GetComponent<ITouchInputConsumer>();
|
||||
if (consumer != null)
|
||||
{
|
||||
LogDebugMessage($"Delegating tap to consumer at {worldPos} (GameObject: {hit.gameObject.name})");
|
||||
Logging.Debug($"Delegating tap to consumer at {worldPos} (GameObject: {hit.gameObject.name})");
|
||||
consumer.OnTap(worldPos);
|
||||
return true;
|
||||
}
|
||||
LogDebugMessage($"Collider2D hit at {worldPos} (GameObject: {hit.gameObject.name}), but no ITouchInputConsumer found.");
|
||||
Logging.Debug($"Collider2D hit at {worldPos} (GameObject: {hit.gameObject.name}), but no ITouchInputConsumer found.");
|
||||
}
|
||||
else
|
||||
{
|
||||
LogDebugMessage($"No Collider2D found at {worldPos} for interactable delegation.");
|
||||
Logging.Debug($"No Collider2D found at {worldPos} for interactable delegation.");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -368,7 +366,7 @@ namespace Input
|
||||
return;
|
||||
|
||||
_overrideConsumers.Add(consumer);
|
||||
LogDebugMessage($"Override consumer registered: {consumer}");
|
||||
Logging.Debug($"Override consumer registered: {consumer}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -386,7 +384,7 @@ namespace Input
|
||||
}
|
||||
|
||||
_overrideConsumers.Remove(consumer);
|
||||
LogDebugMessage($"Override consumer unregistered: {consumer}");
|
||||
Logging.Debug($"Override consumer unregistered: {consumer}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -396,7 +394,7 @@ namespace Input
|
||||
{
|
||||
_activeHoldConsumer = null;
|
||||
_overrideConsumers.Clear();
|
||||
LogDebugMessage("All override consumers cleared.");
|
||||
Logging.Debug("All override consumers cleared.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -409,17 +407,9 @@ namespace Input
|
||||
|
||||
// Get the topmost override consumer (last registered)
|
||||
var consumer = _overrideConsumers[_overrideConsumers.Count - 1];
|
||||
LogDebugMessage($"Delegating tap to override consumer at {worldPos} (GameObject: {consumer})");
|
||||
Logging.Debug($"Delegating tap to override consumer at {worldPos} (GameObject: {consumer})");
|
||||
consumer.OnTap(worldPos);
|
||||
return true;
|
||||
}
|
||||
|
||||
private void LogDebugMessage(string message)
|
||||
{
|
||||
if (_logVerbosity <= LogVerbosity.Debug)
|
||||
{
|
||||
Logging.Debug($"[InputManager] {message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ using Pathfinding;
|
||||
using AppleHills.Core.Settings;
|
||||
using Core;
|
||||
using Core.Lifecycle;
|
||||
using Core.SaveLoad;
|
||||
|
||||
namespace Input
|
||||
{
|
||||
@@ -73,7 +72,7 @@ namespace Input
|
||||
public override string SaveId => $"{gameObject.scene.name}/PlayerController";
|
||||
public override int ManagedAwakePriority => 100; // Player controller
|
||||
|
||||
protected override void OnManagedAwake()
|
||||
internal override void OnManagedStart()
|
||||
{
|
||||
aiPath = GetComponent<AIPath>();
|
||||
artTransform = transform.Find("CharacterArt");
|
||||
@@ -103,7 +102,7 @@ namespace Input
|
||||
public void OnTap(Vector2 worldPosition)
|
||||
{
|
||||
InterruptMoveTo();
|
||||
LogDebugMessage($"OnTap at {worldPosition}");
|
||||
Logging.Debug($"OnTap at {worldPosition}");
|
||||
if (aiPath != null)
|
||||
{
|
||||
aiPath.enabled = true;
|
||||
@@ -122,7 +121,7 @@ namespace Input
|
||||
public void OnHoldStart(Vector2 worldPosition)
|
||||
{
|
||||
InterruptMoveTo();
|
||||
LogDebugMessage($"OnHoldStart at {worldPosition}");
|
||||
Logging.Debug($"OnHoldStart at {worldPosition}");
|
||||
lastHoldPosition = worldPosition;
|
||||
isHolding = true;
|
||||
if (_settings.DefaultHoldMovementMode == HoldMovementMode.Pathfinding &&
|
||||
@@ -159,7 +158,7 @@ namespace Input
|
||||
/// </summary>
|
||||
public void OnHoldEnd(Vector2 worldPosition)
|
||||
{
|
||||
LogDebugMessage($"OnHoldEnd at {worldPosition}");
|
||||
Logging.Debug($"OnHoldEnd at {worldPosition}");
|
||||
isHolding = false;
|
||||
directMoveVelocity = Vector3.zero;
|
||||
if (aiPath != null && _settings.DefaultHoldMovementMode ==
|
||||
@@ -335,13 +334,13 @@ namespace Input
|
||||
{
|
||||
_isMoving = true;
|
||||
OnMovementStarted?.Invoke();
|
||||
LogDebugMessage("Movement started");
|
||||
Logging.Debug("Movement started");
|
||||
}
|
||||
else if (!isCurrentlyMoving && _isMoving)
|
||||
{
|
||||
_isMoving = false;
|
||||
OnMovementStopped?.Invoke();
|
||||
LogDebugMessage("Movement stopped");
|
||||
Logging.Debug("Movement stopped");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -424,18 +423,10 @@ namespace Input
|
||||
OnArrivedAtTarget?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
private void LogDebugMessage(string message)
|
||||
{
|
||||
if (_logVerbosity <= LogVerbosity.Debug)
|
||||
{
|
||||
Logging.Debug($"[PlayerTouchController] {message}");
|
||||
}
|
||||
}
|
||||
|
||||
#region Save/Load Lifecycle Hooks
|
||||
|
||||
protected override string OnSceneSaveRequested()
|
||||
internal override string OnSceneSaveRequested()
|
||||
{
|
||||
var saveData = new PlayerSaveData
|
||||
{
|
||||
@@ -445,7 +436,7 @@ namespace Input
|
||||
return JsonUtility.ToJson(saveData);
|
||||
}
|
||||
|
||||
protected override void OnSceneRestoreRequested(string serializedData)
|
||||
internal override void OnSceneRestoreRequested(string serializedData)
|
||||
{
|
||||
if (string.IsNullOrEmpty(serializedData))
|
||||
{
|
||||
|
||||
@@ -190,7 +190,7 @@ namespace Interactions
|
||||
/// <returns>True if interaction succeeded, false otherwise</returns>
|
||||
protected virtual bool DoInteraction()
|
||||
{
|
||||
Debug.LogWarning($"[Interactable] DoInteraction not implemented for {GetType().Name}");
|
||||
Logging.Warning($"[Interactable] DoInteraction not implemented for {GetType().Name}");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -68,8 +68,6 @@ namespace Interactions
|
||||
public event Action<PickupItemData, PickupItemData> OnIncorrectItemSlotted;
|
||||
|
||||
public UnityEvent onForbiddenItemSlotted;
|
||||
// Native C# event alternative for code-only subscribers
|
||||
public event Action<PickupItemData, PickupItemData> OnForbiddenItemSlotted;
|
||||
|
||||
public GameObject GetSlottedObject()
|
||||
{
|
||||
@@ -85,9 +83,9 @@ namespace Interactions
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Awake()
|
||||
internal override void OnManagedAwake()
|
||||
{
|
||||
base.Awake(); // SaveableInteractable registration
|
||||
base.OnManagedAwake(); // SaveableInteractable registration
|
||||
|
||||
// Setup visuals
|
||||
if (iconRenderer == null)
|
||||
@@ -333,7 +331,7 @@ namespace Interactions
|
||||
ItemSlotSaveData data = JsonUtility.FromJson<ItemSlotSaveData>(serializedData);
|
||||
if (data == null)
|
||||
{
|
||||
Debug.LogWarning($"[ItemSlot] Failed to deserialize save data for {gameObject.name}");
|
||||
Logging.Warning($"[ItemSlot] Failed to deserialize save data for {gameObject.name}");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -343,7 +341,7 @@ namespace Interactions
|
||||
// Restore slotted item if there was one
|
||||
if (!string.IsNullOrEmpty(data.slottedItemSaveId))
|
||||
{
|
||||
Debug.Log($"[ItemSlot] Restoring slotted item: {data.slottedItemSaveId} (itemId: {data.slottedItemDataId})");
|
||||
Logging.Debug($"[ItemSlot] Restoring slotted item: {data.slottedItemSaveId} (itemId: {data.slottedItemDataId})");
|
||||
RestoreSlottedItem(data.slottedItemSaveId, data.slottedItemDataId);
|
||||
}
|
||||
}
|
||||
@@ -361,7 +359,7 @@ namespace Interactions
|
||||
{
|
||||
// Item not found in scene - it might be a dynamically spawned combined item
|
||||
// Try to spawn it from the itemDataId
|
||||
Debug.Log($"[ItemSlot] Slotted item not found in scene: {slottedItemSaveId}, attempting to spawn from itemId: {expectedItemDataId}");
|
||||
Logging.Debug($"[ItemSlot] Slotted item not found in scene: {slottedItemSaveId}, attempting to spawn from itemId: {expectedItemDataId}");
|
||||
|
||||
GameObject prefab = interactionSettings?.FindPickupPrefabByItemId(expectedItemDataId);
|
||||
if (prefab != null)
|
||||
@@ -369,17 +367,17 @@ namespace Interactions
|
||||
// Spawn the item (inactive, since it will be slotted)
|
||||
slottedObject = Instantiate(prefab, transform.position, Quaternion.identity);
|
||||
slottedObject.SetActive(false);
|
||||
Debug.Log($"[ItemSlot] Successfully spawned combined item for slot: {expectedItemDataId}");
|
||||
Logging.Debug($"[ItemSlot] Successfully spawned combined item for slot: {expectedItemDataId}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"[ItemSlot] Could not find prefab for itemId: {expectedItemDataId}");
|
||||
Logging.Warning($"[ItemSlot] Could not find prefab for itemId: {expectedItemDataId}");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (slottedObject == null)
|
||||
{
|
||||
Debug.LogWarning($"[ItemSlot] Could not find slotted item with save ID: {slottedItemSaveId}");
|
||||
Logging.Warning($"[ItemSlot] Could not find slotted item with save ID: {slottedItemSaveId}");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -395,13 +393,13 @@ namespace Interactions
|
||||
{
|
||||
if (slottedData.itemId != expectedItemDataId)
|
||||
{
|
||||
Debug.LogWarning($"[ItemSlot] ItemId mismatch! Pickup has '{slottedData.itemId}' but expected '{expectedItemDataId}'");
|
||||
Logging.Warning($"[ItemSlot] ItemId mismatch! Pickup has '{slottedData.itemId}' but expected '{expectedItemDataId}'");
|
||||
}
|
||||
}
|
||||
|
||||
if (slottedData == null)
|
||||
{
|
||||
Debug.LogWarning($"[ItemSlot] Pickup {pickup.gameObject.name} has null itemData! Expected itemId: {expectedItemDataId}");
|
||||
Logging.Warning($"[ItemSlot] Pickup {pickup.gameObject.name} has null itemData! Expected itemId: {expectedItemDataId}");
|
||||
if (slottedObject != null)
|
||||
Destroy(slottedObject);
|
||||
return;
|
||||
@@ -409,7 +407,7 @@ namespace Interactions
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"[ItemSlot] Slotted object has no Pickup component: {slottedObject.name}");
|
||||
Logging.Warning($"[ItemSlot] Slotted object has no Pickup component: {slottedObject.name}");
|
||||
if (slottedObject != null)
|
||||
Destroy(slottedObject);
|
||||
return;
|
||||
@@ -419,7 +417,7 @@ namespace Interactions
|
||||
// Follower state is managed separately during save/load restoration
|
||||
ApplySlottedItemState(slottedObject, slottedData, triggerEvents: false);
|
||||
|
||||
Debug.Log($"[ItemSlot] Successfully restored slotted item: {slottedData.itemName} (itemId: {slottedData.itemId})");
|
||||
Logging.Debug($"[ItemSlot] Successfully restored slotted item: {slottedData.itemName} (itemId: {slottedData.itemId})");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -526,7 +524,7 @@ namespace Interactions
|
||||
// If slot already has an item, reject the claim
|
||||
if (currentlySlottedItemObject != null)
|
||||
{
|
||||
Debug.LogWarning($"[ItemSlot] Already has a slotted item, rejecting claim from {pickup.gameObject.name}");
|
||||
Logging.Warning($"[ItemSlot] Already has a slotted item, rejecting claim from {pickup.gameObject.name}");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -537,7 +535,7 @@ namespace Interactions
|
||||
// Claim the pickup
|
||||
ApplySlottedItemState(pickup.gameObject, pickup.itemData, triggerEvents: false);
|
||||
|
||||
Debug.Log($"[ItemSlot] Successfully claimed slotted item: {pickup.itemData?.itemName}");
|
||||
Logging.Debug($"[ItemSlot] Successfully claimed slotted item: {pickup.itemData?.itemName}");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,9 +32,9 @@ namespace Interactions
|
||||
public event Action<PickupItemData> OnItemPickedUp;
|
||||
public event Action<PickupItemData, PickupItemData, PickupItemData> OnItemsCombined;
|
||||
|
||||
protected override void Awake()
|
||||
internal override void OnManagedAwake()
|
||||
{
|
||||
base.Awake(); // Register with save system
|
||||
base.OnManagedAwake(); // Register with save system
|
||||
|
||||
if (iconRenderer == null)
|
||||
iconRenderer = GetComponent<SpriteRenderer>();
|
||||
@@ -44,8 +44,9 @@ namespace Interactions
|
||||
|
||||
// Always register with ItemManager, even if picked up
|
||||
// This allows the save/load system to find held items when restoring state
|
||||
protected override void OnManagedAwake()
|
||||
internal override void OnManagedStart()
|
||||
{
|
||||
base.OnManagedStart();
|
||||
ItemManager.Instance?.RegisterPickup(this);
|
||||
}
|
||||
|
||||
@@ -166,7 +167,7 @@ namespace Interactions
|
||||
PickupSaveData data = JsonUtility.FromJson<PickupSaveData>(serializedData);
|
||||
if (data == null)
|
||||
{
|
||||
Debug.LogWarning($"[Pickup] Failed to deserialize save data for {gameObject.name}");
|
||||
Logging.Warning($"[Pickup] Failed to deserialize save data for {gameObject.name}");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -200,7 +201,7 @@ namespace Interactions
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"[Pickup] Could not find slot with SaveId: {data.slotSaveId}");
|
||||
Logging.Warning($"[Pickup] Could not find slot with SaveId: {data.slotSaveId}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using UnityEngine;
|
||||
using Core;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Interactions
|
||||
{
|
||||
@@ -23,7 +24,7 @@ namespace Interactions
|
||||
|
||||
#region Save/Load Lifecycle Hooks
|
||||
|
||||
protected override string OnSceneSaveRequested()
|
||||
internal override string OnSceneSaveRequested()
|
||||
{
|
||||
object stateData = GetSerializableState();
|
||||
if (stateData == null)
|
||||
@@ -34,11 +35,11 @@ namespace Interactions
|
||||
return JsonUtility.ToJson(stateData);
|
||||
}
|
||||
|
||||
protected override void OnSceneRestoreRequested(string serializedData)
|
||||
internal override void OnSceneRestoreRequested(string serializedData)
|
||||
{
|
||||
if (string.IsNullOrEmpty(serializedData))
|
||||
{
|
||||
Debug.LogWarning($"[SaveableInteractable] Empty save data for {SaveId}");
|
||||
Logging.Warning($"[SaveableInteractable] Empty save data for {SaveId}");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -85,17 +86,17 @@ namespace Interactions
|
||||
[ContextMenu("Log Save ID")]
|
||||
private void LogSaveId()
|
||||
{
|
||||
Debug.Log($"Save ID: {SaveId}");
|
||||
Logging.Debug($"Save ID: {SaveId}");
|
||||
}
|
||||
|
||||
[ContextMenu("Test Serialize/Deserialize")]
|
||||
private void TestSerializeDeserialize()
|
||||
{
|
||||
string serialized = OnSceneSaveRequested();
|
||||
Debug.Log($"Serialized state: {serialized}");
|
||||
Logging.Debug($"Serialized state: {serialized}");
|
||||
|
||||
OnSceneRestoreRequested(serialized);
|
||||
Debug.Log("Deserialization test complete");
|
||||
Logging.Debug("Deserialization test complete");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -21,11 +21,11 @@ namespace Levels
|
||||
/// <summary>
|
||||
/// Unity Awake callback. Sets up icon, interactable, and event handlers.
|
||||
/// </summary>
|
||||
protected override void Awake()
|
||||
internal override void OnManagedAwake()
|
||||
{
|
||||
base.Awake();
|
||||
base.OnManagedAwake();
|
||||
|
||||
Debug.Log($"[LevelSwitch] Awake called for {gameObject.name} in scene {gameObject.scene.name}");
|
||||
Logging.Debug($"[LevelSwitch] Awake called for {gameObject.name} in scene {gameObject.scene.name}");
|
||||
|
||||
if (_iconRenderer == null)
|
||||
_iconRenderer = GetComponent<SpriteRenderer>();
|
||||
@@ -36,14 +36,14 @@ namespace Levels
|
||||
ApplySwitchData();
|
||||
}
|
||||
|
||||
protected override void OnManagedAwake()
|
||||
internal override void OnManagedStart()
|
||||
{
|
||||
Debug.Log($"[LevelSwitch] OnManagedAwake called for {gameObject.name}");
|
||||
Logging.Debug($"[LevelSwitch] OnManagedStart called for {gameObject.name}");
|
||||
}
|
||||
|
||||
protected override void OnSceneReady()
|
||||
internal override void OnSceneReady()
|
||||
{
|
||||
Debug.Log($"[LevelSwitch] OnSceneReady called for {gameObject.name}");
|
||||
Logging.Debug($"[LevelSwitch] OnSceneReady called for {gameObject.name}");
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
@@ -79,7 +79,7 @@ namespace Levels
|
||||
{
|
||||
if (switchData == null || string.IsNullOrEmpty(switchData.targetLevelSceneName))
|
||||
{
|
||||
Debug.LogWarning("LevelSwitch has no valid switchData!");
|
||||
Logging.Warning("LevelSwitch has no valid switchData!");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,21 +35,16 @@ namespace Levels
|
||||
[SerializeField] private bool startUnlocked = false;
|
||||
|
||||
private SpriteRenderer iconRenderer;
|
||||
|
||||
// Settings reference
|
||||
private IInteractionSettings interactionSettings;
|
||||
|
||||
private bool switchActive = true;
|
||||
private bool isUnlocked;
|
||||
|
||||
/// <summary>
|
||||
/// Unity Awake callback. Sets up icon, interactable, and event handlers.
|
||||
/// </summary>
|
||||
protected override void Awake()
|
||||
internal override void OnManagedAwake()
|
||||
{
|
||||
base.Awake();
|
||||
|
||||
switchActive = true;
|
||||
base.OnManagedAwake();
|
||||
|
||||
if (iconRenderer == null)
|
||||
iconRenderer = GetComponent<SpriteRenderer>();
|
||||
|
||||
@@ -64,10 +59,9 @@ namespace Levels
|
||||
ApplySwitchData();
|
||||
}
|
||||
|
||||
protected override void OnManagedAwake()
|
||||
internal override void OnManagedStart()
|
||||
{
|
||||
base.OnManagedAwake();
|
||||
|
||||
base.OnManagedStart();
|
||||
// If startUnlocked is true, always start active
|
||||
if (startUnlocked)
|
||||
{
|
||||
@@ -144,15 +138,7 @@ namespace Levels
|
||||
{
|
||||
return base.CanBeClicked() && isUnlocked;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Setup: Prevent re-entry while interaction is in progress.
|
||||
/// </summary>
|
||||
protected override void OnInteractionStarted()
|
||||
{
|
||||
switchActive = false;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Main interaction logic: Spawn menu and switch input mode.
|
||||
/// </summary>
|
||||
@@ -160,7 +146,7 @@ namespace Levels
|
||||
{
|
||||
if (switchData == null || string.IsNullOrEmpty(switchData.targetLevelSceneName))
|
||||
{
|
||||
Debug.LogWarning("MinigameSwitch has no valid switchData!");
|
||||
Logging.Warning("MinigameSwitch has no valid switchData!");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -203,7 +189,7 @@ namespace Levels
|
||||
|
||||
private void OnMenuCancel()
|
||||
{
|
||||
switchActive = true; // Allow interaction again if cancelled
|
||||
|
||||
InputManager.Instance.SetInputMode(InputMode.GameAndUI);
|
||||
}
|
||||
|
||||
@@ -231,7 +217,7 @@ namespace Levels
|
||||
MinigameSwitchSaveData data = JsonUtility.FromJson<MinigameSwitchSaveData>(serializedData);
|
||||
if (data == null)
|
||||
{
|
||||
Debug.LogWarning($"[MinigameSwitch] Failed to deserialize save data for {gameObject.name}");
|
||||
Logging.Warning($"[MinigameSwitch] Failed to deserialize save data for {gameObject.name}");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ using UI.Core;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using UnityEngine.Playables;
|
||||
using Svg;
|
||||
|
||||
namespace Minigames.DivingForPictures
|
||||
{
|
||||
@@ -106,10 +107,8 @@ namespace Minigames.DivingForPictures
|
||||
public override int ManagedAwakePriority => 190;
|
||||
public override bool AutoRegisterPausable => true; // Automatic GameManager registration
|
||||
|
||||
protected override void Awake()
|
||||
internal override void OnManagedAwake()
|
||||
{
|
||||
base.Awake();
|
||||
|
||||
if (_instance == null)
|
||||
{
|
||||
_instance = this;
|
||||
@@ -120,7 +119,7 @@ namespace Minigames.DivingForPictures
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnManagedAwake()
|
||||
internal override void OnManagedStart()
|
||||
{
|
||||
_settings = GameManager.GetSettingsObject<IDivingMinigameSettings>();
|
||||
_currentSpawnProbability = _settings?.BaseSpawnProbability ?? 0.2f;
|
||||
@@ -131,7 +130,7 @@ namespace Minigames.DivingForPictures
|
||||
Logging.Debug("[DivingGameManager] Initialized");
|
||||
}
|
||||
|
||||
protected override void OnSceneReady()
|
||||
internal override void OnSceneReady()
|
||||
{
|
||||
InitializeGame();
|
||||
|
||||
@@ -627,8 +626,9 @@ namespace Minigames.DivingForPictures
|
||||
{
|
||||
//Instead of surfacingTimeline, play the outro cinematic
|
||||
deathAudioPlayer.Stop();
|
||||
CinematicsManager.Instance.LoadAndPlayCinematic("SurfacingCinematic");
|
||||
CinematicsManager.Instance.ShowCinematicBackground(true);
|
||||
CinematicsManager.Instance.LoadAndPlayCinematic("SurfacingCinematic",true);
|
||||
CinematicsManager.Instance.ChangeCinematicBackgroundColour(new Color(0.5058824f, 0.7803922f, 0.8862746f, 1f));
|
||||
//PlayerHudManager.Instance.ResizeCinematicPlayer();
|
||||
//surfacingTimeline.Play();
|
||||
//Logging.Debug("[DivingGameManager] Last tile left the screen, playing timeline");
|
||||
|
||||
@@ -666,16 +666,20 @@ namespace Minigames.DivingForPictures
|
||||
if (giver != null)
|
||||
{
|
||||
UIPageController.Instance.ShowAllUI();
|
||||
giver.GiveBooster(() => { completed = true; });
|
||||
Logging.Debug("[DivingGameManager] Starting booster giver sequence");
|
||||
giver.GiveBooster(() =>
|
||||
{
|
||||
completed = true;
|
||||
Logging.Debug("[DivingGameManager] Booster giver completed callback received");
|
||||
});
|
||||
|
||||
// 2) Wait for it to finish (with a safety timeout in case it's not wired)
|
||||
float timeout = 10f; // fallback to avoid blocking forever
|
||||
float elapsed = 0f;
|
||||
while (!completed && elapsed < timeout)
|
||||
// 2) Wait for it to finish (NO timeout - wait indefinitely for user interaction)
|
||||
while (!completed)
|
||||
{
|
||||
elapsed += Time.unscaledDeltaTime;
|
||||
yield return null;
|
||||
}
|
||||
|
||||
Logging.Debug("[DivingGameManager] Booster giver sequence finished, proceeding to game over");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -108,7 +108,7 @@ public class FollowerController : ManagedBehaviour
|
||||
|
||||
public override int ManagedAwakePriority => 110; // Follower after player
|
||||
|
||||
protected override void OnManagedAwake()
|
||||
internal override void OnManagedStart()
|
||||
{
|
||||
_aiPath = GetComponent<AIPath>();
|
||||
// Find art prefab and animator
|
||||
@@ -129,7 +129,7 @@ public class FollowerController : ManagedBehaviour
|
||||
_interactionSettings = GameManager.GetSettingsObject<IInteractionSettings>();
|
||||
}
|
||||
|
||||
protected override void OnSceneReady()
|
||||
internal override void OnSceneReady()
|
||||
{
|
||||
// Find player reference when scene is ready (called for every scene load)
|
||||
FindPlayerReference();
|
||||
@@ -727,7 +727,7 @@ public class FollowerController : ManagedBehaviour
|
||||
|
||||
#region Save/Load Lifecycle Hooks
|
||||
|
||||
protected override string OnSceneSaveRequested()
|
||||
internal override string OnSceneSaveRequested()
|
||||
{
|
||||
var saveData = new FollowerSaveData
|
||||
{
|
||||
@@ -754,7 +754,7 @@ public class FollowerController : ManagedBehaviour
|
||||
return JsonUtility.ToJson(saveData);
|
||||
}
|
||||
|
||||
protected override void OnSceneRestoreRequested(string serializedData)
|
||||
internal override void OnSceneRestoreRequested(string serializedData)
|
||||
{
|
||||
if (string.IsNullOrEmpty(serializedData))
|
||||
{
|
||||
@@ -914,7 +914,7 @@ public class FollowerController : ManagedBehaviour
|
||||
/// </summary>
|
||||
public static FollowerController FindInstance()
|
||||
{
|
||||
return FindObjectOfType<FollowerController>();
|
||||
return FindFirstObjectByType<FollowerController>();
|
||||
}
|
||||
|
||||
#endregion Save/Load Lifecycle Hooks
|
||||
|
||||
@@ -1,19 +1,74 @@
|
||||
using System;
|
||||
using Core;
|
||||
using Core.Lifecycle;
|
||||
using UnityEngine;
|
||||
|
||||
public class BirdGameStats : MonoBehaviour
|
||||
namespace PuzzleS
|
||||
{
|
||||
public int birdsFoundInLevel;
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
/// <summary>
|
||||
/// Tracks bird discovery progress in the bird finding minigame.
|
||||
/// Saves scene-specific progress using the ManagedBehaviour lifecycle system.
|
||||
/// </summary>
|
||||
public class BirdGameStats : ManagedBehaviour
|
||||
{
|
||||
|
||||
public int birdsFoundInLevel;
|
||||
|
||||
// Save system configuration
|
||||
public override bool AutoRegisterForSave => true;
|
||||
|
||||
internal override void OnManagedStart()
|
||||
{
|
||||
// Initialize after all managers are ready
|
||||
}
|
||||
|
||||
public void BirdFound()
|
||||
{
|
||||
birdsFoundInLevel += 1;
|
||||
}
|
||||
|
||||
#region Save/Load Lifecycle Hooks
|
||||
|
||||
internal override string OnSceneSaveRequested()
|
||||
{
|
||||
// Save scene-specific progress
|
||||
var state = new BirdGameState
|
||||
{
|
||||
birdsFoundInLevel = this.birdsFoundInLevel
|
||||
};
|
||||
return JsonUtility.ToJson(state);
|
||||
}
|
||||
|
||||
internal override void OnSceneRestoreRequested(string serializedData)
|
||||
{
|
||||
if (string.IsNullOrEmpty(serializedData))
|
||||
{
|
||||
// No saved data, keep default values
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var state = JsonUtility.FromJson<BirdGameState>(serializedData);
|
||||
if (state != null)
|
||||
{
|
||||
birdsFoundInLevel = state.birdsFoundInLevel;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logging.Warning($"[BirdGameStats] Failed to restore state: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
public void BirdFound()
|
||||
/// <summary>
|
||||
/// Serializable state for bird game progress
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class BirdGameState
|
||||
{
|
||||
birdsFoundInLevel += 1;
|
||||
public int birdsFoundInLevel;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace PuzzleS
|
||||
// Enum for tracking proximity state (simplified to just Close and Far)
|
||||
public enum ProximityState { Close, Far }
|
||||
|
||||
protected override void Awake()
|
||||
internal override void OnManagedAwake()
|
||||
{
|
||||
_interactable = GetComponent<InteractableBase>();
|
||||
|
||||
@@ -56,14 +56,10 @@ namespace PuzzleS
|
||||
Logging.Warning($"[Puzzles] Indicator prefab for {stepData?.stepId} does not implement IPuzzlePrompt");
|
||||
}
|
||||
}
|
||||
|
||||
base.Awake();
|
||||
}
|
||||
|
||||
protected override void OnManagedAwake()
|
||||
internal override void OnManagedStart()
|
||||
{
|
||||
base.OnManagedAwake();
|
||||
|
||||
// Register with PuzzleManager - safe to access .Instance here
|
||||
if (stepData != null && PuzzleManager.Instance != null)
|
||||
{
|
||||
|
||||
@@ -96,15 +96,13 @@ namespace PuzzleS
|
||||
|
||||
public override int ManagedAwakePriority => 80; // Puzzle systems
|
||||
|
||||
private new void Awake()
|
||||
internal override void OnManagedAwake()
|
||||
{
|
||||
base.Awake(); // CRITICAL: Register with LifecycleManager!
|
||||
|
||||
// Set instance immediately so it's available before OnManagedAwake() is called
|
||||
// Set instance immediately (early initialization)
|
||||
_instance = this;
|
||||
}
|
||||
|
||||
protected override void OnManagedAwake()
|
||||
internal override void OnManagedStart()
|
||||
{
|
||||
// Initialize settings reference
|
||||
_interactionSettings = GameManager.GetSettingsObject<IInteractionSettings>();
|
||||
@@ -591,7 +589,7 @@ namespace PuzzleS
|
||||
|
||||
#region Save/Load Lifecycle Hooks
|
||||
|
||||
protected override string OnSceneSaveRequested()
|
||||
internal override string OnSceneSaveRequested()
|
||||
{
|
||||
if (_currentLevelData == null)
|
||||
{
|
||||
@@ -611,9 +609,9 @@ namespace PuzzleS
|
||||
return json;
|
||||
}
|
||||
|
||||
protected override void OnSceneRestoreRequested(string data)
|
||||
internal override void OnSceneRestoreRequested(string data)
|
||||
{
|
||||
Debug.Log("[XAXA] PuzzleManager loading with data: " + data);
|
||||
Logging.Debug("[XAXA] PuzzleManager loading with data: " + data);
|
||||
|
||||
if (string.IsNullOrEmpty(data) || data == "{}")
|
||||
{
|
||||
|
||||
@@ -3,12 +3,14 @@ using System;
|
||||
using System.Diagnostics.Tracing;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Audio;
|
||||
using Core;
|
||||
using Core.Lifecycle;
|
||||
|
||||
/// <summary>
|
||||
/// We automatically add the AudioSource component here so we can control it. Do not add it manually!
|
||||
/// </summary>
|
||||
[RequireComponent(typeof(AudioSource))]
|
||||
public class AppleAudioSource : MonoBehaviour
|
||||
public class AppleAudioSource : ManagedBehaviour
|
||||
{
|
||||
public enum AudioSourceType{CriticalVO,VO,Ambience,SFX,Music}
|
||||
public AudioSourceType audioSourceType;
|
||||
@@ -17,15 +19,18 @@ public class AppleAudioSource : MonoBehaviour
|
||||
[HideInInspector ] public int clipPriority;
|
||||
public int sourcePriority;
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void OnEnable()
|
||||
|
||||
internal override void OnManagedAwake()
|
||||
{
|
||||
audioSource = GetComponent<AudioSource>();
|
||||
}
|
||||
|
||||
internal override void OnManagedStart()
|
||||
{
|
||||
AudioManager.Instance.RegisterNewAudioSource(this);
|
||||
_audioMixer = AudioManager.Instance.audioMixer;
|
||||
InitializeAudioSource();
|
||||
audioSource.playOnAwake = false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -55,6 +60,10 @@ public class AppleAudioSource : MonoBehaviour
|
||||
|
||||
public void Play(int requestedClipPriority)
|
||||
{
|
||||
if (audioSource == null)
|
||||
{
|
||||
audioSource = GetComponent<AudioSource>();
|
||||
}
|
||||
clipPriority = requestedClipPriority;
|
||||
if (audioSourceType == AudioSourceType.CriticalVO || audioSourceType == AudioSourceType.VO)
|
||||
{
|
||||
@@ -64,7 +73,7 @@ public class AppleAudioSource : MonoBehaviour
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("[AUDIOMANAGER] AppleAudioSource " + name + " was suppressed because something more important is playing");
|
||||
Logging.Debug("[AUDIOMANAGER] AppleAudioSource " + name + " was suppressed because something more important is playing");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -5,6 +5,7 @@ using AppleHills.Core.Interfaces;
|
||||
using System.Collections.Generic;
|
||||
using AudioSourceEvents;
|
||||
using System;
|
||||
using Core;
|
||||
using Core.Lifecycle;
|
||||
|
||||
public class AudioManager : ManagedBehaviour, IPausable
|
||||
@@ -43,27 +44,39 @@ public class AudioManager : ManagedBehaviour, IPausable
|
||||
public override int ManagedAwakePriority => 30; // Audio infrastructure
|
||||
public override bool AutoRegisterPausable => true; // Auto-register as IPausable
|
||||
|
||||
private new void Awake()
|
||||
internal override void OnManagedAwake()
|
||||
{
|
||||
base.Awake(); // CRITICAL: Register with LifecycleManager!
|
||||
|
||||
// Set instance immediately so it's available before OnManagedAwake() is called
|
||||
// Set instance immediately (early initialization)
|
||||
_instance = this;
|
||||
}
|
||||
|
||||
protected override void OnManagedAwake()
|
||||
internal override void OnManagedStart()
|
||||
{
|
||||
// Auto-registration with GameManager handled by ManagedBehaviour
|
||||
}
|
||||
// Initialize lists if they were not set in inspector
|
||||
criticalVOSources = criticalVOSources ?? new List<AppleAudioSource>();
|
||||
VOSources = VOSources ?? new List<AppleAudioSource>();
|
||||
musicSources = musicSources ?? new List<AppleAudioSource>();
|
||||
ambienceSources = ambienceSources ?? new List<AppleAudioSource>();
|
||||
SFXSources = SFXSources ?? new List<AppleAudioSource>();
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
_player = QuickAccess.Instance.PlayerGameObject;
|
||||
_audioListener = QuickAccess.Instance.MainCamera.GetComponent<AudioListener>();
|
||||
// Perform singleton-dependent initialization here
|
||||
if (QuickAccess.Instance != null)
|
||||
{
|
||||
_player = QuickAccess.Instance.PlayerGameObject;
|
||||
if (QuickAccess.Instance.MainCamera != null)
|
||||
{
|
||||
_audioListener = QuickAccess.Instance.MainCamera.GetComponent<AudioListener>();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Warning("[AudioManager] QuickAccess.Instance is null during OnManagedStart. Some audio references may remain unset.");
|
||||
}
|
||||
|
||||
// Diagnostic
|
||||
foreach (AppleAudioSource _audioSource in criticalVOSources)
|
||||
{
|
||||
Debug.Log("Found source: " + _audioSource.name);
|
||||
Logging.Debug("Found source: " + _audioSource.name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,15 +101,15 @@ public class AudioManager : ManagedBehaviour, IPausable
|
||||
|
||||
public LevelAudioObject GetCurrentLevelAudioObject()
|
||||
{
|
||||
Debug.Log("Audio objects: " + FindObjectsByType<LevelAudioObject>(FindObjectsInactive.Include, FindObjectsSortMode.None).Length);
|
||||
Logging.Debug("Audio objects: " + FindObjectsByType<LevelAudioObject>(FindObjectsInactive.Include, FindObjectsSortMode.None).Length);
|
||||
if (FindObjectsByType<LevelAudioObject>(FindObjectsInactive.Include, FindObjectsSortMode.None).Length > 1)
|
||||
{
|
||||
Debug.LogWarning("Warning! More than one LevelAudioObject in the level! Using the first one found");
|
||||
Logging.Warning("Warning! More than one LevelAudioObject in the level! Using the first one found");
|
||||
return FindObjectsByType<LevelAudioObject>(FindObjectsInactive.Include, FindObjectsSortMode.None)[0];
|
||||
}
|
||||
if (FindObjectsByType<LevelAudioObject>(FindObjectsInactive.Include, FindObjectsSortMode.None).Length == 0)
|
||||
{
|
||||
Debug.LogWarning("Error! No LevelAudioObject found, AudioManager might not function properly!");
|
||||
Logging.Warning("Error! No LevelAudioObject found, AudioManager might not function properly!");
|
||||
return null;
|
||||
}
|
||||
else
|
||||
@@ -142,12 +155,10 @@ public class AudioManager : ManagedBehaviour, IPausable
|
||||
/// </summary>
|
||||
public bool RequestPlayVO(AppleAudioSource requestedAudioSource)
|
||||
{
|
||||
//Debug.Log($"[AUDIOMANAGER] CurrentVO source prio: {currentlyPlayingVO.sourcePriority}, clip prio: {currentlyPlayingVO.clipPriority} requested VO prio: {requestedAudioSource.sourcePriority}, clip prio: {clipPriority}");
|
||||
// If nothing is playing, let the requested audio source play
|
||||
if (currentlyPlayingVO == null)
|
||||
{
|
||||
SetupNewAudioSource(requestedAudioSource);
|
||||
Debug.Log($"[AUDIOMANAGER] Playing {currentlyPlayingVO.name} as nothing is currently playing.");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -161,7 +172,6 @@ public class AudioManager : ManagedBehaviour, IPausable
|
||||
{
|
||||
InterruptAudioSource(requestedAudioSource);
|
||||
SetupNewAudioSource(requestedAudioSource);
|
||||
Debug.Log($"[AUDIOMANAGER] {currentlyPlayingVO.name} is the same as {requestedAudioSource.name}. Triggering it again.");
|
||||
return true;
|
||||
|
||||
}
|
||||
@@ -171,7 +181,6 @@ public class AudioManager : ManagedBehaviour, IPausable
|
||||
|
||||
InterruptAudioSource(requestedAudioSource);
|
||||
SetupNewAudioSource(requestedAudioSource);
|
||||
Debug.Log($"[AUDIOMANAGER] {currentlyPlayingVO.name} is not critical. Playing {requestedAudioSource.name} instead because it is critical.");
|
||||
return true;
|
||||
}
|
||||
// If the requested audio source has the same priority as currently playing source, check the priority of the requested clip
|
||||
@@ -181,8 +190,6 @@ public class AudioManager : ManagedBehaviour, IPausable
|
||||
{
|
||||
InterruptAudioSource(requestedAudioSource);
|
||||
SetupNewAudioSource(requestedAudioSource);
|
||||
Debug.Log($"[AUDIOMANAGER] Interrupted {currentlyPlayingVO.name} because it has same priority as {requestedAudioSource.name} but the requested clip has higher priority");
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@@ -194,7 +201,6 @@ public class AudioManager : ManagedBehaviour, IPausable
|
||||
if (currentlyPlayingVO.audioSourceType == AppleAudioSource.AudioSourceType.CriticalVO && currentlyPlayingVO.sourcePriority > requestedAudioSource.sourcePriority)
|
||||
{
|
||||
currentlyPlayingVO.InterruptAudio(requestedAudioSource.name);
|
||||
Debug.Log($"[AUDIOMANAGER] Interrupted {currentlyPlayingVO.name} because {requestedAudioSource.name} has higher priority");
|
||||
InterruptAudioSource(requestedAudioSource);
|
||||
SetupNewAudioSource(requestedAudioSource);
|
||||
return true;
|
||||
@@ -202,7 +208,6 @@ public class AudioManager : ManagedBehaviour, IPausable
|
||||
// If the requested audio source didn't clear any of the above cases, tell it to get rekt.
|
||||
else
|
||||
{
|
||||
Debug.Log($"[AUDIOMANAGER] {currentlyPlayingVO.name} is still playing. {requestedAudioSource.name} has lower priority");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -216,7 +221,6 @@ public class AudioManager : ManagedBehaviour, IPausable
|
||||
{
|
||||
if (audioSource.audioSource.resource == null)
|
||||
{
|
||||
Debug.Log($"[AUDIOMANAGER] Faled to setup {audioSource.name}. Invalid resource");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -265,7 +269,15 @@ public class AudioManager : ManagedBehaviour, IPausable
|
||||
{
|
||||
foreach (AppleAudioSource source in criticalVOSources)
|
||||
{
|
||||
source.InterruptAudio("GlobalInterrupt");
|
||||
if (source == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
source.InterruptAudio("GlobalInterrupt");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
foreach (AppleAudioSource source in VOSources)
|
||||
|
||||
@@ -4,8 +4,11 @@ using System;
|
||||
using System.Diagnostics.Tracing;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Audio;
|
||||
using Core;
|
||||
using Core.Lifecycle;
|
||||
using PuzzleS;
|
||||
|
||||
public class BushAudioController : MonoBehaviour
|
||||
public class BushAudioController : ManagedBehaviour
|
||||
{
|
||||
private IAudioEventSource _eventSource;
|
||||
public AppleAudioSource VOPlayer;
|
||||
@@ -20,7 +23,7 @@ public class BushAudioController : MonoBehaviour
|
||||
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
internal override void OnManagedStart()
|
||||
{
|
||||
_eventSource = VOPlayer.audioSource.RequestEventHandlers();
|
||||
_eventSource.AudioStopped += PlayBirdCounter;
|
||||
@@ -48,9 +51,9 @@ public class BushAudioController : MonoBehaviour
|
||||
|
||||
}
|
||||
|
||||
public void OnDisable()
|
||||
{
|
||||
// Unsubscribe from events when disabled
|
||||
_eventSource.AudioStopped -= PlayBirdCounter;
|
||||
}
|
||||
//public void OnDisable()
|
||||
//{
|
||||
// // Unsubscribe from events when disabled
|
||||
// _eventSource.AudioStopped -= PlayBirdCounter;
|
||||
//}
|
||||
}
|
||||
|
||||
@@ -1,22 +1,81 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Audio;
|
||||
using System;
|
||||
using Core;
|
||||
using Core.Lifecycle;
|
||||
|
||||
public class LevelAudioObject : MonoBehaviour
|
||||
[Serializable]
|
||||
public class LevelAudioObjectSaveData
|
||||
{
|
||||
public bool hasPlayed;
|
||||
}
|
||||
|
||||
public class LevelAudioObject : ManagedBehaviour
|
||||
{
|
||||
[Header("Audio Settings")]
|
||||
public AppleAudioSource narratorAudioSource;
|
||||
public AudioResource firstNarration;
|
||||
|
||||
[Header("Playback Settings")]
|
||||
[Tooltip("If true, the audio will only play once and never again after being played")]
|
||||
public bool isOneTime;
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
private bool _hasPlayed;
|
||||
|
||||
#region ManagedBehaviour Overrides
|
||||
|
||||
public override bool AutoRegisterForSave => isOneTime; // Only save if one-time audio
|
||||
|
||||
internal override string OnSceneSaveRequested()
|
||||
{
|
||||
PlayNarrationAudio();
|
||||
if (!isOneTime)
|
||||
return null; // No need to save if not one-time
|
||||
|
||||
LevelAudioObjectSaveData saveData = new LevelAudioObjectSaveData
|
||||
{
|
||||
hasPlayed = _hasPlayed
|
||||
};
|
||||
|
||||
return JsonUtility.ToJson(saveData);
|
||||
}
|
||||
|
||||
void PlayNarrationAudio()
|
||||
internal override void OnSceneRestoreRequested(string serializedData)
|
||||
{
|
||||
if (!isOneTime || string.IsNullOrEmpty(serializedData))
|
||||
return;
|
||||
|
||||
try
|
||||
{
|
||||
LevelAudioObjectSaveData saveData = JsonUtility.FromJson<LevelAudioObjectSaveData>(serializedData);
|
||||
_hasPlayed = saveData.hasPlayed;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logging.Warning($"[LevelAudioObject] Failed to restore audio state: {e.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
internal override void OnSceneRestoreCompleted()
|
||||
{
|
||||
if (isOneTime && !_hasPlayed)
|
||||
{
|
||||
PlayNarrationAudio();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void PlayNarrationAudio()
|
||||
{
|
||||
if (narratorAudioSource == null || firstNarration == null)
|
||||
{
|
||||
Logging.Warning($"[LevelAudioObject] Missing audio source or narration resource on {gameObject.name}");
|
||||
return;
|
||||
}
|
||||
|
||||
narratorAudioSource.audioSource.resource = firstNarration;
|
||||
narratorAudioSource.Play(0);
|
||||
|
||||
_hasPlayed = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Core;
|
||||
using UnityEngine;
|
||||
|
||||
public class ProximitySoundReaction : MonoBehaviour
|
||||
@@ -12,13 +13,13 @@ public class ProximitySoundReaction : MonoBehaviour
|
||||
|
||||
private void OnCollisionEnter2D(Collision2D collision)
|
||||
{
|
||||
Debug.Log("overlap!");
|
||||
Logging.Debug("overlap!");
|
||||
|
||||
}
|
||||
|
||||
private void OnTriggerEnter2D(Collider2D collision)
|
||||
{
|
||||
Debug.Log("Wolter triggered!");
|
||||
Logging.Debug("Wolter triggered!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
using Core;
|
||||
using Core.Lifecycle;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Audio;
|
||||
|
||||
public class PulverAudioController : MonoBehaviour
|
||||
public class PulverAudioController : ManagedBehaviour
|
||||
{
|
||||
private AppleAudioSource audioSource;
|
||||
public AppleAudioSource audioSource;
|
||||
public AudioResource combineAudio;
|
||||
private FollowerController followerController;
|
||||
public ItemManager itemManager;
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
internal override void OnManagedStart()
|
||||
{
|
||||
audioSource = GetComponent<AppleAudioSource>();
|
||||
followerController = GetComponent<FollowerController>();
|
||||
followerController.PulverIsCombining.AddListener(PulverIsCombining);
|
||||
|
||||
|
||||
@@ -1,82 +1,122 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using SkiaSharp.Unity;
|
||||
using Input;
|
||||
using AppleHills.Core;
|
||||
using UnityEngine.Events;
|
||||
using UI.Core;
|
||||
using Pixelplacement;
|
||||
using Pixelplacement.TweenSystem;
|
||||
using UI;
|
||||
|
||||
public class AppSwitcher : MonoBehaviour
|
||||
public class AppSwitcher : UIPage
|
||||
{
|
||||
|
||||
public TextAsset iconIdle;
|
||||
public TextAsset iconEstablish;
|
||||
public TextAsset rainbowEstablish;
|
||||
public TextAsset rainbowRemove;
|
||||
public GameObject rainbow;
|
||||
public GameObject icon;
|
||||
public GameObject rainbowIn;
|
||||
public GameObject rainbowOut;
|
||||
public GameObject gameLayoutContainer;
|
||||
public GameObject exitButton;
|
||||
public RectMask2D rectMask;
|
||||
|
||||
[Header("Slide Animation Settings")]
|
||||
public float slideDuration = 0.5f;
|
||||
|
||||
private SkottiePlayerV2 rainbowInPlayer;
|
||||
private SkottiePlayerV2 rainbowOutPlayer;
|
||||
private TweenBase slideInTween;
|
||||
private TweenBase slideOutTween;
|
||||
|
||||
private SkottiePlayerV2 iconPlayer;
|
||||
private SkottiePlayerV2 rainbowPlayer;
|
||||
private Animator animator;
|
||||
|
||||
|
||||
private void OnEnable()
|
||||
internal override void OnManagedAwake()
|
||||
{
|
||||
iconPlayer = icon.GetComponentInChildren<SkottiePlayerV2>();
|
||||
rainbowPlayer = rainbow.GetComponentInChildren<SkottiePlayerV2>();
|
||||
animator = GetComponent<Animator>();
|
||||
}
|
||||
base.OnManagedAwake();
|
||||
|
||||
public void OpenAppSwitcher()
|
||||
{
|
||||
//Activate players
|
||||
rainbow.SetActive(true);
|
||||
gameLayoutContainer.SetActive(true);
|
||||
|
||||
// Play establishing animations
|
||||
rainbowPlayer.LoadAnimation(rainbowEstablish.text);
|
||||
rainbowPlayer.PlayAnimation(false);
|
||||
rainbowPlayer.loop = false;
|
||||
gameLayoutContainer.SetActive(true);
|
||||
animator.Play("GamesReveal");
|
||||
|
||||
// Show the exit button
|
||||
exitButton.SetActive(true);
|
||||
|
||||
// Set input mode to UI
|
||||
QuickAccess.Instance.PlayerController.InterruptMoveTo();
|
||||
InputManager.Instance.SetInputMode(InputMode.UI);
|
||||
|
||||
rainbowPlayer.OnAnimationFinished += AnimFinished;
|
||||
}
|
||||
|
||||
public void CloseAppSwitcher()
|
||||
{
|
||||
rainbowPlayer.resetAfterFinished = true;
|
||||
rainbowPlayer.LoadAnimation(rainbowRemove.text);
|
||||
rainbowPlayer.PlayAnimation(false);
|
||||
rainbowPlayer.loop = false;
|
||||
animator.Play("GamesHide");
|
||||
|
||||
// Set input mode to game and ui
|
||||
InputManager.Instance.SetInputMode(InputMode.GameAndUI);
|
||||
|
||||
// Hide the exit button
|
||||
PageName = "AppSwitcher";
|
||||
rainbowInPlayer = rainbowIn.GetComponent<SkottiePlayerV2>();
|
||||
rainbowOutPlayer = rainbowOut.GetComponent<SkottiePlayerV2>();
|
||||
|
||||
if (rectMask == null)
|
||||
{
|
||||
rectMask = GetComponent<RectMask2D>();
|
||||
}
|
||||
|
||||
// Initially hide both
|
||||
rainbowIn.SetActive(true);
|
||||
exitButton.SetActive(false);
|
||||
}
|
||||
|
||||
public void GamesHiddenAnimationEvent()
|
||||
protected override void DoTransitionIn(Action onComplete)
|
||||
{
|
||||
rainbow.SetActive(false);
|
||||
gameLayoutContainer.SetActive(false);
|
||||
InputManager.Instance.SetInputMode(InputMode.UI);
|
||||
|
||||
gameLayoutContainer.SetActive(true);
|
||||
|
||||
// Hide rainbow out, show rainbow in
|
||||
rainbowOut.SetActive(false);
|
||||
|
||||
// Play animation on rainbow in without resetting state
|
||||
rainbowInPlayer.PlayAnimation(true);
|
||||
|
||||
// Slide in animation - tween padding.left from 1700 to 0
|
||||
slideInTween = TweenPaddingLeft(1700f, 0f, Tween.EaseOut, () =>
|
||||
{
|
||||
onComplete?.Invoke();
|
||||
rainbowOut.SetActive(true);
|
||||
exitButton.SetActive(true);
|
||||
});
|
||||
}
|
||||
|
||||
private void AnimFinished(string str)
|
||||
protected override void DoTransitionOut(Action onComplete)
|
||||
{
|
||||
rainbowIn.SetActive(false);
|
||||
|
||||
// Play animation on rainbow out with resetting state
|
||||
rainbowOutPlayer.PlayAnimation(true);
|
||||
|
||||
// Hide the exit button
|
||||
exitButton.SetActive(false);
|
||||
|
||||
// Slide out animation - tween padding.left from 0 to 1700
|
||||
slideOutTween = TweenPaddingLeft(0f, 1700f, Tween.EaseIn, () => {
|
||||
gameLayoutContainer.SetActive(false);
|
||||
rainbowIn.SetActive(true);
|
||||
onComplete?.Invoke();
|
||||
InputManager.Instance.SetInputMode(InputMode.GameAndUI);
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tweens the left padding of the rectMask from startValue to endValue.
|
||||
/// </summary>
|
||||
private TweenBase TweenPaddingLeft(float startValue, float endValue, AnimationCurve easeCurve, Action onComplete)
|
||||
{
|
||||
// Set starting position
|
||||
Vector4 startPadding = rectMask.padding;
|
||||
startPadding.x = startValue;
|
||||
rectMask.padding = startPadding;
|
||||
|
||||
return Tween.Value(
|
||||
startValue,
|
||||
endValue,
|
||||
(value) => {
|
||||
Vector4 padding = rectMask.padding;
|
||||
padding.x = value;
|
||||
rectMask.padding = padding;
|
||||
},
|
||||
slideDuration,
|
||||
0f, // no delay
|
||||
easeCurve,
|
||||
Tween.LoopType.None,
|
||||
null, // onStart
|
||||
onComplete
|
||||
);
|
||||
}
|
||||
|
||||
protected override void OnDestroy()
|
||||
{
|
||||
base.OnDestroy();
|
||||
|
||||
// Clean up tweens
|
||||
slideInTween?.Stop();
|
||||
slideOutTween?.Stop();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using AppleHills.Data.CardSystem;
|
||||
using Core;
|
||||
using Pixelplacement;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
@@ -82,37 +83,37 @@ namespace UI.CardSystem
|
||||
/// </summary>
|
||||
public void OnPointerClick(PointerEventData eventData)
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-ALBUMCARD] OnPointerClick on {name}, _parentSlot={((_parentSlot != null) ? _parentSlot.name : "NULL")}, _isEnlarged={_isEnlarged}, position={eventData.position}");
|
||||
Logging.Debug($"[CLICK-TRACE-ALBUMCARD] OnPointerClick on {name}, _parentSlot={((_parentSlot != null) ? _parentSlot.name : "NULL")}, _isEnlarged={_isEnlarged}, position={eventData.position}");
|
||||
|
||||
// During reveal flow (before placed in slot), forward clicks to parent FlippableCard
|
||||
if (_parentSlot == null)
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-ALBUMCARD] {name} - No parent slot, forwarding click to parent FlippableCard");
|
||||
Logging.Debug($"[CLICK-TRACE-ALBUMCARD] {name} - No parent slot, forwarding click to parent FlippableCard");
|
||||
|
||||
// Find parent FlippableCard and forward the click
|
||||
FlippableCard parentFlippable = GetComponentInParent<FlippableCard>();
|
||||
if (parentFlippable != null)
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-ALBUMCARD] {name} - Found parent FlippableCard, calling OnPointerClick");
|
||||
Logging.Debug($"[CLICK-TRACE-ALBUMCARD] {name} - Found parent FlippableCard, calling OnPointerClick");
|
||||
parentFlippable.OnPointerClick(eventData);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"[CLICK-TRACE-ALBUMCARD] {name} - No parent FlippableCard found!");
|
||||
Logging.Warning($"[CLICK-TRACE-ALBUMCARD] {name} - No parent FlippableCard found!");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Log($"[CLICK-TRACE-ALBUMCARD] {name} - Has parent slot, processing click");
|
||||
Logging.Debug($"[CLICK-TRACE-ALBUMCARD] {name} - Has parent slot, processing click");
|
||||
|
||||
if (_isEnlarged)
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-ALBUMCARD] {name} - Is enlarged, requesting shrink");
|
||||
Logging.Debug($"[CLICK-TRACE-ALBUMCARD] {name} - Is enlarged, requesting shrink");
|
||||
OnShrinkRequested?.Invoke(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-ALBUMCARD] {name} - Is normal size, requesting enlarge");
|
||||
Logging.Debug($"[CLICK-TRACE-ALBUMCARD] {name} - Is normal size, requesting enlarge");
|
||||
OnEnlargeRequested?.Invoke(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using AppleHills.Data.CardSystem;
|
||||
using Core;
|
||||
using Data.CardSystem;
|
||||
using Pixelplacement;
|
||||
using UI.Core;
|
||||
using UI.DragAndDrop.Core;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace UI.CardSystem
|
||||
@@ -22,7 +24,9 @@ namespace UI.CardSystem
|
||||
[SerializeField] private BookCurlPro.BookPro book;
|
||||
|
||||
[Header("Zone Navigation")]
|
||||
[SerializeField] private BookTabButton[] zoneTabs; // All zone tab buttons
|
||||
[SerializeField] private Transform tabContainer; // Container holding all BookTabButton children
|
||||
|
||||
private BookTabButton[] zoneTabs; // Discovered zone tab buttons
|
||||
|
||||
[Header("Album Card Reveal")]
|
||||
[SerializeField] private SlotContainer bottomRightSlots;
|
||||
@@ -40,9 +44,10 @@ namespace UI.CardSystem
|
||||
private List<AlbumCardPlacementDraggable> _activeCards = new List<AlbumCardPlacementDraggable>();
|
||||
private const int MAX_VISIBLE_CARDS = 3;
|
||||
|
||||
protected override void OnManagedAwake()
|
||||
internal override void OnManagedStart()
|
||||
{
|
||||
base.OnManagedAwake();
|
||||
// Discover zone tabs from container
|
||||
DiscoverZoneTabs();
|
||||
|
||||
// Make sure we have a CanvasGroup for transitions
|
||||
if (canvasGroup == null)
|
||||
@@ -65,6 +70,17 @@ namespace UI.CardSystem
|
||||
// Set up booster pack button listeners
|
||||
SetupBoosterButtonListeners();
|
||||
|
||||
// Subscribe to book page flip events
|
||||
if (book != null)
|
||||
{
|
||||
book.OnFlip.AddListener(OnPageFlipped);
|
||||
Logging.Debug("[AlbumViewPage] Subscribed to book.OnFlip event");
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Warning("[AlbumViewPage] Book reference is null, cannot subscribe to OnFlip event!");
|
||||
}
|
||||
|
||||
// Subscribe to CardSystemManager events (managers are guaranteed to be initialized)
|
||||
if (CardSystemManager.Instance != null)
|
||||
{
|
||||
@@ -81,6 +97,36 @@ namespace UI.CardSystem
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Discover all BookTabButton components from the tab container
|
||||
/// </summary>
|
||||
private void DiscoverZoneTabs()
|
||||
{
|
||||
if (tabContainer == null)
|
||||
{
|
||||
Debug.LogError("[AlbumViewPage] Tab container is not assigned! Cannot discover zone tabs.");
|
||||
zoneTabs = new BookTabButton[0];
|
||||
return;
|
||||
}
|
||||
|
||||
// Get all BookTabButton components from children
|
||||
zoneTabs = tabContainer.GetComponentsInChildren<BookTabButton>(includeInactive: false);
|
||||
|
||||
if (zoneTabs == null || zoneTabs.Length == 0)
|
||||
{
|
||||
Logging.Warning($"[AlbumViewPage] No BookTabButton components found in tab container '{tabContainer.name}'!");
|
||||
zoneTabs = new BookTabButton[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Debug($"[AlbumViewPage] Discovered {zoneTabs.Length} zone tabs from container '{tabContainer.name}'");
|
||||
foreach (var tab in zoneTabs)
|
||||
{
|
||||
Logging.Debug($" - Tab: {tab.name}, Zone: {tab.Zone}, TargetPage: {tab.TargetPage}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SetupBoosterButtonListeners()
|
||||
{
|
||||
if (boosterPackButtons == null) return;
|
||||
@@ -88,6 +134,12 @@ namespace UI.CardSystem
|
||||
for (int i = 0; i < boosterPackButtons.Length; i++)
|
||||
{
|
||||
if (boosterPackButtons[i] == null) continue;
|
||||
// Unsubscribe from book events
|
||||
if (book != null)
|
||||
{
|
||||
book.OnFlip.RemoveListener(OnPageFlipped);
|
||||
}
|
||||
|
||||
|
||||
Button button = boosterPackButtons[i].GetComponent<Button>();
|
||||
if (button != null)
|
||||
@@ -155,7 +207,7 @@ namespace UI.CardSystem
|
||||
if (Input.InputManager.Instance != null)
|
||||
{
|
||||
Input.InputManager.Instance.SetInputMode(_previousInputMode);
|
||||
Debug.Log($"[AlbumViewPage] Restored input mode to {_previousInputMode} on exit");
|
||||
Logging.Debug($"[AlbumViewPage] Restored input mode to {_previousInputMode} on exit");
|
||||
}
|
||||
|
||||
if (UIPageController.Instance != null)
|
||||
@@ -206,7 +258,7 @@ namespace UI.CardSystem
|
||||
// Store the current input mode before switching
|
||||
_previousInputMode = Input.InputMode.GameAndUI;
|
||||
Input.InputManager.Instance.SetInputMode(Input.InputMode.UI);
|
||||
Debug.Log("[AlbumViewPage] Switched to UI-only input mode on first entry");
|
||||
Logging.Debug("[AlbumViewPage] Switched to UI-only input mode on first entry");
|
||||
}
|
||||
|
||||
// Subscribe to pending card events while page is active
|
||||
@@ -215,8 +267,16 @@ namespace UI.CardSystem
|
||||
CardSystemManager.Instance.OnPendingCardAdded += OnPendingCardAdded;
|
||||
}
|
||||
|
||||
// Spawn pending cards when opening album
|
||||
SpawnPendingCards();
|
||||
// Only spawn pending cards if we're already on an album page (not the menu)
|
||||
if (IsInAlbumProper())
|
||||
{
|
||||
Logging.Debug("[AlbumViewPage] Opening directly to album page - spawning cards immediately");
|
||||
SpawnPendingCards();
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Debug("[AlbumViewPage] Opening to menu page - cards will spawn when entering album");
|
||||
}
|
||||
|
||||
base.TransitionIn();
|
||||
}
|
||||
@@ -229,6 +289,9 @@ namespace UI.CardSystem
|
||||
CardSystemManager.Instance.OnPendingCardAdded -= OnPendingCardAdded;
|
||||
}
|
||||
|
||||
// Clean up active pending cards to prevent duplicates on next opening
|
||||
CleanupActiveCards();
|
||||
|
||||
// Don't restore input mode here - only restore when actually exiting (in OnExitButtonClicked)
|
||||
base.TransitionOut();
|
||||
}
|
||||
@@ -302,6 +365,46 @@ namespace UI.CardSystem
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if we're currently viewing the album proper (not the menu page)
|
||||
/// </summary>
|
||||
private bool IsInAlbumProper()
|
||||
{
|
||||
if (book == null)
|
||||
{
|
||||
Logging.Warning("[AlbumViewPage] Book reference is null in IsInAlbumProper check");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Page 1 is the menu/cover, page 2+ are album pages with card slots
|
||||
bool inAlbum = book.CurrentPaper > 1;
|
||||
return inAlbum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when book page flips - show/hide pending cards based on whether we're in the album proper
|
||||
/// </summary>
|
||||
private void OnPageFlipped()
|
||||
{
|
||||
bool isInAlbum = IsInAlbumProper();
|
||||
if (isInAlbum && _activeCards.Count == 0)
|
||||
{
|
||||
// Entering album proper and no cards spawned yet - spawn them with animation
|
||||
Logging.Debug("[AlbumViewPage] Entering album proper - spawning pending cards with animation");
|
||||
SpawnPendingCards();
|
||||
}
|
||||
else if (!isInAlbum && _activeCards.Count > 0)
|
||||
{
|
||||
// Returning to menu page - cleanup cards
|
||||
Logging.Debug("[AlbumViewPage] Returning to menu page - cleaning up pending cards");
|
||||
CleanupActiveCards();
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Debug($"[AlbumViewPage] Page flipped but no card state change needed (already in correct state)");
|
||||
}
|
||||
}
|
||||
|
||||
#region Album Card Reveal System
|
||||
|
||||
/// <summary>
|
||||
@@ -325,7 +428,7 @@ namespace UI.CardSystem
|
||||
|
||||
int spawnCount = Mathf.Min(uniquePending.Count, MAX_VISIBLE_CARDS);
|
||||
|
||||
Debug.Log($"[AlbumViewPage] Spawning {spawnCount} unique pending cards (total pending: {pending.Count})");
|
||||
Logging.Debug($"[AlbumViewPage] Spawning {spawnCount} unique pending cards (total pending: {pending.Count})");
|
||||
|
||||
for (int i = 0; i < spawnCount; i++)
|
||||
{
|
||||
@@ -341,14 +444,14 @@ namespace UI.CardSystem
|
||||
// Guard: Don't spawn cards with zero copies
|
||||
if (cardData.CopiesOwned <= 0)
|
||||
{
|
||||
Debug.LogWarning($"[AlbumViewPage] Skipping spawn of card '{cardData.Name}' with {cardData.CopiesOwned} copies");
|
||||
Logging.Warning($"[AlbumViewPage] Skipping spawn of card '{cardData.Name}' with {cardData.CopiesOwned} copies");
|
||||
return;
|
||||
}
|
||||
|
||||
DraggableSlot slot = FindSlotByIndex(slotIndex);
|
||||
if (slot == null)
|
||||
{
|
||||
Debug.LogWarning($"[AlbumViewPage] Could not find slot with SlotIndex {slotIndex}");
|
||||
Logging.Warning($"[AlbumViewPage] Could not find slot with SlotIndex {slotIndex}");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -375,11 +478,11 @@ namespace UI.CardSystem
|
||||
// Track it
|
||||
_activeCards.Add(cardPlacement);
|
||||
|
||||
Debug.Log($"[AlbumViewPage] Spawned card '{cardData.Name}' (CopiesOwned: {cardData.CopiesOwned}) in slot {slotIndex}");
|
||||
Logging.Debug($"[AlbumViewPage] Spawned card '{cardData.Name}' (CopiesOwned: {cardData.CopiesOwned}) in slot {slotIndex}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"[AlbumViewPage] Spawned card has no AlbumCardDraggable component!");
|
||||
Logging.Warning($"[AlbumViewPage] Spawned card has no AlbumCardDraggable component!");
|
||||
Destroy(cardObj);
|
||||
}
|
||||
}
|
||||
@@ -393,7 +496,7 @@ namespace UI.CardSystem
|
||||
// Guard: Don't spawn cards with zero copies
|
||||
if (card.CopiesOwned <= 0)
|
||||
{
|
||||
Debug.LogWarning($"[AlbumViewPage] Ignoring pending card '{card.Name}' with {card.CopiesOwned} copies");
|
||||
Logging.Warning($"[AlbumViewPage] Ignoring pending card '{card.Name}' with {card.CopiesOwned} copies");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -404,7 +507,7 @@ namespace UI.CardSystem
|
||||
|
||||
if (alreadySpawned)
|
||||
{
|
||||
Debug.Log($"[AlbumViewPage] Card '{card.Name}' already spawned, skipping duplicate spawn");
|
||||
Logging.Debug($"[AlbumViewPage] Card '{card.Name}' already spawned, skipping duplicate spawn");
|
||||
return; // Don't spawn duplicates
|
||||
}
|
||||
|
||||
@@ -421,13 +524,13 @@ namespace UI.CardSystem
|
||||
/// </summary>
|
||||
private void OnCardRevealed(AlbumCardPlacementDraggable cardPlacement, CardData cardData)
|
||||
{
|
||||
Debug.Log($"[AlbumViewPage] Card revealed: {cardData.Name} (Zone: {cardData.Zone}, CopiesOwned: {cardData.CopiesOwned})");
|
||||
Logging.Debug($"[AlbumViewPage] Card revealed: {cardData.Name} (Zone: {cardData.Zone}, CopiesOwned: {cardData.CopiesOwned})");
|
||||
|
||||
// IMMEDIATELY move card from pending to inventory upon reveal
|
||||
if (CardSystemManager.Instance != null)
|
||||
{
|
||||
CardSystemManager.Instance.MarkCardAsPlaced(cardData);
|
||||
Debug.Log($"[AlbumViewPage] Moved card '{cardData.Name}' from pending to inventory on reveal");
|
||||
Logging.Debug($"[AlbumViewPage] Moved card '{cardData.Name}' from pending to inventory on reveal");
|
||||
}
|
||||
|
||||
// Remove this card from active cards list
|
||||
@@ -439,12 +542,12 @@ namespace UI.CardSystem
|
||||
if (currentZone != cardData.Zone)
|
||||
{
|
||||
// Card is from a different zone - navigate to its zone
|
||||
Debug.Log($"[AlbumViewPage] Card zone ({cardData.Zone}) doesn't match current zone ({currentZone}). Navigating to card's zone...");
|
||||
Logging.Debug($"[AlbumViewPage] Card zone ({cardData.Zone}) doesn't match current zone ({currentZone}). Navigating to card's zone...");
|
||||
NavigateToZone(cardData.Zone);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log($"[AlbumViewPage] Card zone ({cardData.Zone}) matches current zone - no navigation needed.");
|
||||
Logging.Debug($"[AlbumViewPage] Card zone ({cardData.Zone}) matches current zone - no navigation needed.");
|
||||
}
|
||||
|
||||
// Shuffle remaining cards to front and spawn next unique card
|
||||
@@ -459,7 +562,7 @@ namespace UI.CardSystem
|
||||
/// </summary>
|
||||
private void OnCardPlacedInAlbum(AlbumCardPlacementDraggable cardPlacement, CardData cardData)
|
||||
{
|
||||
Debug.Log($"[AlbumViewPage] Card placed in album slot: {cardData.Name}");
|
||||
Logging.Debug($"[AlbumViewPage] Card placed in album slot: {cardData.Name}");
|
||||
|
||||
// Unsubscribe from events (card is now static in album)
|
||||
cardPlacement.OnCardRevealed -= OnCardRevealed;
|
||||
@@ -543,7 +646,9 @@ namespace UI.CardSystem
|
||||
public CardZone GetCurrentZone()
|
||||
{
|
||||
if (book == null || zoneTabs == null || zoneTabs.Length == 0)
|
||||
{
|
||||
return CardZone.AppleHills; // Default
|
||||
}
|
||||
|
||||
int currentPage = book.CurrentPaper;
|
||||
|
||||
@@ -555,9 +660,8 @@ namespace UI.CardSystem
|
||||
return tab.Zone;
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback to first zone
|
||||
return zoneTabs[0].Zone;
|
||||
return CardZone.NotApplicable;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -565,16 +669,20 @@ namespace UI.CardSystem
|
||||
/// </summary>
|
||||
public BookTabButton GetTabForZone(CardZone zone)
|
||||
{
|
||||
|
||||
if (zoneTabs == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
foreach (var tab in zoneTabs)
|
||||
{
|
||||
{
|
||||
if (tab.Zone == zone)
|
||||
{
|
||||
return tab;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -641,7 +749,7 @@ namespace UI.CardSystem
|
||||
{
|
||||
if (card == null) return;
|
||||
|
||||
Debug.Log($"[AlbumViewPage] OnCardEnlargeRequested called for card: {card.name}, current parent: {card.transform.parent.name}");
|
||||
Logging.Debug($"[AlbumViewPage] OnCardEnlargeRequested called for card: {card.name}, current parent: {card.transform.parent.name}");
|
||||
|
||||
// IMPORTANT: Call EnlargeCard FIRST to store original parent (the slot)
|
||||
// BEFORE reparenting to the enlarged container
|
||||
@@ -651,7 +759,7 @@ namespace UI.CardSystem
|
||||
if (cardEnlargedBackdrop != null)
|
||||
{
|
||||
cardEnlargedBackdrop.SetActive(true);
|
||||
Debug.Log($"[AlbumViewPage] Backdrop shown");
|
||||
Logging.Debug($"[AlbumViewPage] Backdrop shown");
|
||||
}
|
||||
|
||||
// NOW reparent card to enlarged container (above backdrop)
|
||||
@@ -659,10 +767,10 @@ namespace UI.CardSystem
|
||||
{
|
||||
card.transform.SetParent(cardEnlargedContainer, true);
|
||||
card.transform.SetAsLastSibling(); // Ensure on top
|
||||
Debug.Log($"[AlbumViewPage] Card reparented to enlarged container");
|
||||
Logging.Debug($"[AlbumViewPage] Card reparented to enlarged container");
|
||||
}
|
||||
|
||||
Debug.Log($"[AlbumViewPage] Card enlarged: {card.GetCardData()?.Name}");
|
||||
Logging.Debug($"[AlbumViewPage] Card enlarged: {card.GetCardData()?.Name}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -690,7 +798,7 @@ namespace UI.CardSystem
|
||||
card.transform.localRotation = card.GetOriginalLocalRotation();
|
||||
}
|
||||
|
||||
Debug.Log($"[AlbumViewPage] Card shrunk: {card.GetCardData()?.Name}");
|
||||
Logging.Debug($"[AlbumViewPage] Card shrunk: {card.GetCardData()?.Name}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -701,7 +809,7 @@ namespace UI.CardSystem
|
||||
if (previewCardTransform == null)
|
||||
return;
|
||||
|
||||
Debug.Log($"[AlbumViewPage] ShowSlotPreview called for slot: {slot.name}");
|
||||
Logging.Debug($"[AlbumViewPage] ShowSlotPreview called for slot: {slot.name}");
|
||||
|
||||
// Show backdrop
|
||||
if (cardEnlargedBackdrop != null)
|
||||
@@ -725,7 +833,7 @@ namespace UI.CardSystem
|
||||
if (previewCardTransform == null)
|
||||
return;
|
||||
|
||||
Debug.Log($"[AlbumViewPage] HideSlotPreview called for slot: {slot.name}");
|
||||
Logging.Debug($"[AlbumViewPage] HideSlotPreview called for slot: {slot.name}");
|
||||
|
||||
// Hide backdrop
|
||||
if (cardEnlargedBackdrop != null)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using AppleHills.Data.CardSystem;
|
||||
using BookCurlPro;
|
||||
using Core;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using Tween = Pixelplacement.Tween;
|
||||
@@ -69,7 +70,7 @@ namespace UI.CardSystem
|
||||
{
|
||||
if (book == null)
|
||||
{
|
||||
Debug.LogWarning($"[BookTabButton] No BookPro reference assigned on {gameObject.name}");
|
||||
Logging.Warning($"[BookTabButton] No BookPro reference assigned on {gameObject.name}");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,10 +40,8 @@ namespace UI.CardSystem
|
||||
|
||||
private TweenBase _activeTween;
|
||||
|
||||
protected override void OnManagedAwake()
|
||||
internal override void OnManagedStart()
|
||||
{
|
||||
base.OnManagedAwake();
|
||||
|
||||
// Store original scale for pulse animation
|
||||
if (dotBackground != null)
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using AppleHills.Data.CardSystem;
|
||||
using Core;
|
||||
using Data.CardSystem;
|
||||
using Pixelplacement;
|
||||
using UI.Core;
|
||||
@@ -33,12 +34,12 @@ namespace UI.CardSystem
|
||||
[SerializeField] private float cardSpacing = 150f;
|
||||
|
||||
[Header("Settings")]
|
||||
[SerializeField] private float cardRevealDelay = 0.5f;
|
||||
[SerializeField] private float boosterDisappearDuration = 0.5f;
|
||||
[SerializeField] private CinemachineImpulseSource impulseSource;
|
||||
[SerializeField] private ParticleSystem openingParticleSystem;
|
||||
[SerializeField] private Transform albumIcon; // Target for card fly-away animation
|
||||
[SerializeField] private GameObject albumIcon; // Target for card fly-away animation and dismiss button
|
||||
|
||||
private Button _dismissButton; // Button to close/dismiss the booster opening page
|
||||
private int _availableBoosterCount;
|
||||
private BoosterPackDraggable _currentBoosterInCenter;
|
||||
private List<BoosterPackDraggable> _activeBoostersInSlots = new List<BoosterPackDraggable>();
|
||||
@@ -57,12 +58,34 @@ namespace UI.CardSystem
|
||||
if (canvasGroup == null)
|
||||
canvasGroup = gameObject.AddComponent<CanvasGroup>();
|
||||
|
||||
// Get dismiss button from albumIcon GameObject
|
||||
if (albumIcon != null)
|
||||
{
|
||||
_dismissButton = albumIcon.GetComponent<Button>();
|
||||
if (_dismissButton != null)
|
||||
{
|
||||
_dismissButton.onClick.AddListener(OnDismissButtonClicked);
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Warning("[BoosterOpeningPage] albumIcon does not have a Button component!");
|
||||
}
|
||||
}
|
||||
|
||||
// UI pages should start disabled
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
protected override void OnDestroy()
|
||||
{
|
||||
base.OnDestroy();
|
||||
|
||||
// Unsubscribe from dismiss button
|
||||
if (_dismissButton != null)
|
||||
{
|
||||
_dismissButton.onClick.RemoveListener(OnDismissButtonClicked);
|
||||
}
|
||||
|
||||
// Unsubscribe from slot events
|
||||
if (centerOpeningSlot != null)
|
||||
{
|
||||
@@ -81,10 +104,29 @@ namespace UI.CardSystem
|
||||
{
|
||||
_availableBoosterCount = count;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when the dismiss button (albumIcon) is clicked
|
||||
/// </summary>
|
||||
private void OnDismissButtonClicked()
|
||||
{
|
||||
if (UIPageController.Instance != null)
|
||||
{
|
||||
UIPageController.Instance.PopPage();
|
||||
Logging.Debug("[BoosterOpeningPage] Dismiss button clicked, popping page from stack");
|
||||
}
|
||||
}
|
||||
|
||||
public override void TransitionIn()
|
||||
{
|
||||
base.TransitionIn();
|
||||
|
||||
// Ensure album icon is visible when page opens
|
||||
if (albumIcon != null)
|
||||
{
|
||||
albumIcon.SetActive(true);
|
||||
}
|
||||
|
||||
InitializeBoosterDisplay();
|
||||
}
|
||||
|
||||
@@ -99,17 +141,17 @@ namespace UI.CardSystem
|
||||
/// </summary>
|
||||
private void InitializeBoosterDisplay()
|
||||
{
|
||||
Debug.Log($"[BoosterOpeningPage] InitializeBoosterDisplay called with {_availableBoosterCount} boosters available");
|
||||
Logging.Debug($"[BoosterOpeningPage] InitializeBoosterDisplay called with {_availableBoosterCount} boosters available");
|
||||
|
||||
if (boosterPackPrefab == null)
|
||||
{
|
||||
Debug.LogWarning("BoosterOpeningPage: No booster pack prefab assigned!");
|
||||
Logging.Warning("BoosterOpeningPage: No booster pack prefab assigned!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (bottomRightSlots == null || bottomRightSlots.SlotCount == 0)
|
||||
{
|
||||
Debug.LogWarning("BoosterOpeningPage: No slots available!");
|
||||
Logging.Warning("BoosterOpeningPage: No slots available!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -119,7 +161,7 @@ namespace UI.CardSystem
|
||||
// Calculate how many boosters to show (max 3, or available count, whichever is lower)
|
||||
int visibleCount = Mathf.Min(_availableBoosterCount, MAX_VISIBLE_BOOSTERS);
|
||||
|
||||
Debug.Log($"[BoosterOpeningPage] Will spawn {visibleCount} boosters");
|
||||
Logging.Debug($"[BoosterOpeningPage] Will spawn {visibleCount} boosters");
|
||||
|
||||
// Spawn boosters and assign to slots
|
||||
for (int i = 0; i < visibleCount; i++)
|
||||
@@ -132,11 +174,11 @@ namespace UI.CardSystem
|
||||
{
|
||||
centerOpeningSlot.OnOccupied += OnBoosterPlacedInCenter;
|
||||
centerOpeningSlot.OnVacated += OnBoosterRemovedFromCenter;
|
||||
Debug.Log($"[BoosterOpeningPage] Subscribed to center slot events");
|
||||
Logging.Debug($"[BoosterOpeningPage] Subscribed to center slot events");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("[BoosterOpeningPage] centerOpeningSlot is null!");
|
||||
Logging.Warning("[BoosterOpeningPage] centerOpeningSlot is null!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,7 +190,7 @@ namespace UI.CardSystem
|
||||
DraggableSlot slot = FindSlotByIndex(slotIndex);
|
||||
if (slot == null)
|
||||
{
|
||||
Debug.LogWarning($"[BoosterOpeningPage] Could not find slot with SlotIndex {slotIndex}!");
|
||||
Logging.Warning($"[BoosterOpeningPage] Could not find slot with SlotIndex {slotIndex}!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -171,11 +213,11 @@ namespace UI.CardSystem
|
||||
// Track it
|
||||
_activeBoostersInSlots.Add(booster);
|
||||
|
||||
Debug.Log($"[BoosterOpeningPage] Spawned booster in slot with SlotIndex {slotIndex}");
|
||||
Logging.Debug($"[BoosterOpeningPage] Spawned booster in slot with SlotIndex {slotIndex}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"[BoosterOpeningPage] Spawned booster has no BoosterPackDraggable component!");
|
||||
Logging.Warning($"[BoosterOpeningPage] Spawned booster has no BoosterPackDraggable component!");
|
||||
Destroy(boosterObj);
|
||||
}
|
||||
}
|
||||
@@ -211,7 +253,7 @@ namespace UI.CardSystem
|
||||
booster.CurrentSlot.Vacate();
|
||||
}
|
||||
|
||||
Debug.Log($"[BoosterOpeningPage] Removed booster from slot {slotIndex}");
|
||||
Logging.Debug($"[BoosterOpeningPage] Removed booster from slot {slotIndex}");
|
||||
}
|
||||
|
||||
_activeBoostersInSlots.RemoveAt(slotIndex);
|
||||
@@ -231,7 +273,7 @@ namespace UI.CardSystem
|
||||
RemoveBoosterFromSlot(lastIndex);
|
||||
}
|
||||
|
||||
Debug.Log($"[BoosterOpeningPage] Updated visible boosters: {_activeBoostersInSlots.Count}/{targetCount}");
|
||||
Logging.Debug($"[BoosterOpeningPage] Updated visible boosters: {_activeBoostersInSlots.Count}/{targetCount}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -241,7 +283,7 @@ namespace UI.CardSystem
|
||||
{
|
||||
if (_activeBoostersInSlots.Count == 0) return;
|
||||
|
||||
Debug.Log($"[BoosterOpeningPage] Shuffling {_activeBoostersInSlots.Count} boosters to front slots");
|
||||
Logging.Debug($"[BoosterOpeningPage] Shuffling {_activeBoostersInSlots.Count} boosters to front slots");
|
||||
|
||||
// Unassign all boosters from their current slots
|
||||
foreach (var booster in _activeBoostersInSlots)
|
||||
@@ -261,12 +303,12 @@ namespace UI.CardSystem
|
||||
|
||||
if (targetSlot != null)
|
||||
{
|
||||
Debug.Log($"[BoosterOpeningPage] Assigning booster to slot with SlotIndex {i} {targetSlot.name}");
|
||||
Logging.Debug($"[BoosterOpeningPage] Assigning booster to slot with SlotIndex {i} {targetSlot.name}");
|
||||
booster.AssignToSlot(targetSlot, true); // Animate the move
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"[BoosterOpeningPage] Could not find slot with SlotIndex {i} {targetSlot.name}");
|
||||
Logging.Warning($"[BoosterOpeningPage] Could not find slot with SlotIndex {i} {targetSlot.name}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -311,7 +353,7 @@ namespace UI.CardSystem
|
||||
if (slot != null && !slot.IsOccupied)
|
||||
{
|
||||
SpawnBoosterInSlot(i);
|
||||
Debug.Log($"[BoosterOpeningPage] Spawned new booster in slot with SlotIndex {i}");
|
||||
Logging.Debug($"[BoosterOpeningPage] Spawned new booster in slot with SlotIndex {i}");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -330,13 +372,20 @@ namespace UI.CardSystem
|
||||
// Remove from active slots list
|
||||
_activeBoostersInSlots.Remove(booster);
|
||||
|
||||
// Hide album icon when booster is placed in center
|
||||
if (albumIcon != null)
|
||||
{
|
||||
albumIcon.SetActive(false);
|
||||
Logging.Debug($"[BoosterOpeningPage] Album icon hidden");
|
||||
}
|
||||
|
||||
// Lock the slot so it can't be dragged out
|
||||
Debug.Log($"[BoosterOpeningPage] Locking center slot. IsLocked before: {centerOpeningSlot.IsLocked}");
|
||||
Logging.Debug($"[BoosterOpeningPage] Locking center slot. IsLocked before: {centerOpeningSlot.IsLocked}");
|
||||
centerOpeningSlot.SetLocked(true);
|
||||
Debug.Log($"[BoosterOpeningPage] IsLocked after: {centerOpeningSlot.IsLocked}");
|
||||
Logging.Debug($"[BoosterOpeningPage] IsLocked after: {centerOpeningSlot.IsLocked}");
|
||||
|
||||
// Configure booster for opening (disables drag, enables tapping, resets tap count)
|
||||
Debug.Log($"[BoosterOpeningPage] Calling SetInOpeningSlot(true) on booster");
|
||||
Logging.Debug($"[BoosterOpeningPage] Calling SetInOpeningSlot(true) on booster");
|
||||
booster.SetInOpeningSlot(true);
|
||||
|
||||
// Subscribe to tap events for visual feedback
|
||||
@@ -351,7 +400,7 @@ namespace UI.CardSystem
|
||||
// Shuffle remaining boosters to occupy the first slots
|
||||
ShuffleBoostersToFront();
|
||||
|
||||
Debug.Log($"[BoosterOpeningPage] Booster placed in center, ready for taps. Active boosters in slots: {_activeBoostersInSlots.Count}");
|
||||
Logging.Debug($"[BoosterOpeningPage] Booster placed in center, ready for taps. Active boosters in slots: {_activeBoostersInSlots.Count}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -370,12 +419,12 @@ namespace UI.CardSystem
|
||||
}
|
||||
|
||||
_currentBoosterInCenter = null;
|
||||
Debug.Log($"[BoosterOpeningPage] Booster removed from center");
|
||||
Logging.Debug($"[BoosterOpeningPage] Booster removed from center");
|
||||
}
|
||||
|
||||
private void OnBoosterTapped(BoosterPackDraggable booster, int currentTaps, int maxTaps)
|
||||
{
|
||||
Debug.Log($"[BoosterOpeningPage] Booster tapped: {currentTaps}/{maxTaps}");
|
||||
Logging.Debug($"[BoosterOpeningPage] Booster tapped: {currentTaps}/{maxTaps}");
|
||||
|
||||
// Fire Cinemachine impulse with random velocity (excluding Z)
|
||||
if (impulseSource != null)
|
||||
@@ -400,7 +449,7 @@ namespace UI.CardSystem
|
||||
/// </summary>
|
||||
private void OnBoosterOpened(BoosterPackDraggable booster)
|
||||
{
|
||||
Debug.Log($"[BoosterOpeningPage] Booster opened, playing particle effect");
|
||||
Logging.Debug($"[BoosterOpeningPage] Booster opened, playing particle effect");
|
||||
|
||||
// Reset and play particle system
|
||||
if (openingParticleSystem != null)
|
||||
@@ -438,7 +487,7 @@ namespace UI.CardSystem
|
||||
{
|
||||
if (_isProcessingOpening) return;
|
||||
|
||||
Debug.Log($"[BoosterOpeningPage] Booster ready to open!");
|
||||
Logging.Debug($"[BoosterOpeningPage] Booster ready to open!");
|
||||
|
||||
// Trigger the actual opening sequence
|
||||
booster.TriggerOpen();
|
||||
@@ -481,7 +530,7 @@ namespace UI.CardSystem
|
||||
// WaitForCardReveals already includes: 0.5s wait + (cardCount * 0.5s stagger) + 0.5s animation + 0.5s final
|
||||
// Total is: 1.5s + (cardCount * 0.5s)
|
||||
// For 5 cards that's 4 seconds total, which should be enough
|
||||
Debug.Log("[BoosterOpeningPage] Last booster opened, auto-transitioning to album main page");
|
||||
Logging.Debug("[BoosterOpeningPage] Last booster opened, auto-transitioning to album main page");
|
||||
if (UIPageController.Instance != null)
|
||||
{
|
||||
UIPageController.Instance.PopPage();
|
||||
@@ -528,7 +577,7 @@ namespace UI.CardSystem
|
||||
{
|
||||
if (flippableCardPrefab == null || cardDisplayContainer == null)
|
||||
{
|
||||
Debug.LogWarning("BoosterOpeningPage: Missing card prefab or container!");
|
||||
Logging.Warning("BoosterOpeningPage: Missing card prefab or container!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -572,7 +621,7 @@ namespace UI.CardSystem
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"[BoosterOpeningPage] FlippableCard component not found on card {i}!");
|
||||
Logging.Warning($"[BoosterOpeningPage] FlippableCard component not found on card {i}!");
|
||||
}
|
||||
|
||||
_currentRevealedCards.Add(cardObj);
|
||||
@@ -588,7 +637,7 @@ namespace UI.CardSystem
|
||||
/// </summary>
|
||||
private void OnCardFlipStarted(FlippableCard flippingCard)
|
||||
{
|
||||
Debug.Log($"[BoosterOpeningPage] Card flip started, disabling all other cards.");
|
||||
Logging.Debug($"[BoosterOpeningPage] Card flip started, disabling all other cards.");
|
||||
|
||||
// Disable ALL cards immediately to prevent multi-flip
|
||||
foreach (GameObject cardObj in _currentRevealedCards)
|
||||
@@ -606,14 +655,14 @@ namespace UI.CardSystem
|
||||
/// </summary>
|
||||
private void OnCardRevealed(int cardIndex)
|
||||
{
|
||||
Debug.Log($"[BoosterOpeningPage] Card {cardIndex} revealed!");
|
||||
Logging.Debug($"[BoosterOpeningPage] Card {cardIndex} revealed!");
|
||||
_revealedCardCount++;
|
||||
|
||||
// Get the flippable card and card data
|
||||
FlippableCard flippableCard = _currentRevealedCards[cardIndex].GetComponent<FlippableCard>();
|
||||
if (flippableCard == null)
|
||||
{
|
||||
Debug.LogWarning($"[BoosterOpeningPage] FlippableCard not found for card {cardIndex}!");
|
||||
Logging.Warning($"[BoosterOpeningPage] FlippableCard not found for card {cardIndex}!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -624,7 +673,7 @@ namespace UI.CardSystem
|
||||
|
||||
if (isNew)
|
||||
{
|
||||
Debug.Log($"[BoosterOpeningPage] Card '{cardData.Name}' is NEW!");
|
||||
Logging.Debug($"[BoosterOpeningPage] Card '{cardData.Name}' is NEW!");
|
||||
flippableCard.ShowAsNew();
|
||||
}
|
||||
else
|
||||
@@ -632,7 +681,7 @@ namespace UI.CardSystem
|
||||
// Check if card is already Legendary - if so, skip progress bar and auto-progress
|
||||
if (existingCard.Rarity == AppleHills.Data.CardSystem.CardRarity.Legendary)
|
||||
{
|
||||
Debug.Log($"[BoosterOpeningPage] Card '{cardData.Name}' is LEGENDARY - auto-progressing!");
|
||||
Logging.Debug($"[BoosterOpeningPage] Card '{cardData.Name}' is LEGENDARY - auto-progressing!");
|
||||
// Add to inventory immediately and move to next card
|
||||
Data.CardSystem.CardSystemManager.Instance.AddCardToInventoryDelayed(cardData);
|
||||
_cardsCompletedInteraction++;
|
||||
@@ -642,14 +691,14 @@ namespace UI.CardSystem
|
||||
}
|
||||
|
||||
int ownedCount = existingCard.CopiesOwned;
|
||||
Debug.Log($"[BoosterOpeningPage] Card '{cardData.Name}' is a REPEAT! Owned: {ownedCount}");
|
||||
Logging.Debug($"[BoosterOpeningPage] Card '{cardData.Name}' is a REPEAT! Owned: {ownedCount}");
|
||||
|
||||
// Check if this card will trigger an upgrade (ownedCount + 1 >= threshold)
|
||||
bool willUpgrade = (ownedCount + 1) >= flippableCard.CardsToUpgrade && existingCard.Rarity < AppleHills.Data.CardSystem.CardRarity.Legendary;
|
||||
|
||||
if (willUpgrade)
|
||||
{
|
||||
Debug.Log($"[BoosterOpeningPage] This card will trigger upgrade! ({ownedCount + 1}/{flippableCard.CardsToUpgrade})");
|
||||
Logging.Debug($"[BoosterOpeningPage] This card will trigger upgrade! ({ownedCount + 1}/{flippableCard.CardsToUpgrade})");
|
||||
// Show as repeat - progress bar will fill and auto-trigger upgrade
|
||||
flippableCard.ShowAsRepeatWithUpgrade(ownedCount, existingCard);
|
||||
}
|
||||
@@ -672,7 +721,7 @@ namespace UI.CardSystem
|
||||
/// </summary>
|
||||
private void OnCardCompletedInteraction(FlippableCard card, int cardIndex)
|
||||
{
|
||||
Debug.Log($"[BoosterOpeningPage] Card {cardIndex} interaction complete!");
|
||||
Logging.Debug($"[BoosterOpeningPage] Card {cardIndex} interaction complete!");
|
||||
|
||||
// Add card to inventory NOW (after player saw it)
|
||||
Data.CardSystem.CardSystemManager.Instance.AddCardToInventoryDelayed(card.CardData);
|
||||
@@ -689,7 +738,7 @@ namespace UI.CardSystem
|
||||
// Re-enable all unrevealed cards (they can be flipped now)
|
||||
EnableUnrevealedCards();
|
||||
|
||||
Debug.Log($"[BoosterOpeningPage] Cards completed interaction: {_cardsCompletedInteraction}/{_currentCardData.Length}");
|
||||
Logging.Debug($"[BoosterOpeningPage] Cards completed interaction: {_cardsCompletedInteraction}/{_currentCardData.Length}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -710,7 +759,7 @@ namespace UI.CardSystem
|
||||
}
|
||||
}
|
||||
|
||||
Debug.Log($"[BoosterOpeningPage] Set active card. Only one card is now clickable.");
|
||||
Logging.Debug($"[BoosterOpeningPage] Set active card. Only one card is now clickable.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -727,7 +776,7 @@ namespace UI.CardSystem
|
||||
}
|
||||
}
|
||||
|
||||
Debug.Log($"[BoosterOpeningPage] Re-enabled unrevealed cards for flipping.");
|
||||
Logging.Debug($"[BoosterOpeningPage] Re-enabled unrevealed cards for flipping.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -735,7 +784,7 @@ namespace UI.CardSystem
|
||||
/// </summary>
|
||||
private void OnCardClickedWhileInactive(FlippableCard inactiveCard)
|
||||
{
|
||||
Debug.Log($"[BoosterOpeningPage] Inactive card clicked, jiggling active card.");
|
||||
Logging.Debug($"[BoosterOpeningPage] Inactive card clicked, jiggling active card.");
|
||||
|
||||
if (_currentActiveCard != null)
|
||||
{
|
||||
@@ -754,7 +803,7 @@ namespace UI.CardSystem
|
||||
yield return null;
|
||||
}
|
||||
|
||||
Debug.Log($"[BoosterOpeningPage] All cards revealed! Waiting for interactions...");
|
||||
Logging.Debug($"[BoosterOpeningPage] All cards revealed! Waiting for interactions...");
|
||||
|
||||
// Wait until all cards have completed their new/repeat interaction
|
||||
while (_cardsCompletedInteraction < _currentCardData.Length)
|
||||
@@ -762,13 +811,20 @@ namespace UI.CardSystem
|
||||
yield return null;
|
||||
}
|
||||
|
||||
Debug.Log($"[BoosterOpeningPage] All interactions complete! Animating cards to album...");
|
||||
Logging.Debug($"[BoosterOpeningPage] All interactions complete! Animating cards to album...");
|
||||
|
||||
// All cards revealed and interacted with, wait a moment
|
||||
yield return new WaitForSeconds(0.5f);
|
||||
|
||||
// Show album icon before cards start tweening to it
|
||||
if (albumIcon != null)
|
||||
{
|
||||
albumIcon.SetActive(true);
|
||||
Logging.Debug($"[BoosterOpeningPage] Album icon shown for card tween target");
|
||||
}
|
||||
|
||||
// Animate cards to album icon (or center if no icon assigned) with staggered delays
|
||||
Vector3 targetPosition = albumIcon != null ? albumIcon.position : Vector3.zero;
|
||||
Vector3 targetPosition = albumIcon != null ? albumIcon.transform.position : Vector3.zero;
|
||||
|
||||
int cardIndex = 0;
|
||||
foreach (GameObject cardObj in _currentRevealedCards)
|
||||
@@ -795,6 +851,8 @@ namespace UI.CardSystem
|
||||
_currentRevealedCards.Clear();
|
||||
|
||||
yield return new WaitForSeconds(totalAnimationTime);
|
||||
|
||||
// Album icon stays visible for next booster (will be hidden when next booster is placed)
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections;
|
||||
using Core;
|
||||
using Data.CardSystem;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
@@ -58,7 +59,7 @@ namespace UI.CardSystem
|
||||
{
|
||||
if (Instance != null && Instance != this)
|
||||
{
|
||||
Debug.LogWarning("[BoosterPackGiver] Duplicate instance detected. Destroying this component.");
|
||||
Logging.Warning("[BoosterPackGiver] Duplicate instance detected. Destroying this component.");
|
||||
Destroy(this);
|
||||
yield break;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using UI.Core;
|
||||
using Core;
|
||||
using UI.Core;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
@@ -45,12 +46,14 @@ namespace UI.CardSystem
|
||||
{
|
||||
openAlbumButton.onClick.RemoveListener(OnOpenAlbumClicked);
|
||||
}
|
||||
|
||||
Logging.Debug("ALBUM: CardAlbumDestroyed");
|
||||
}
|
||||
|
||||
private void OnOpenAlbumClicked()
|
||||
{
|
||||
if (UIPageController.Instance == null) return;
|
||||
|
||||
|
||||
// Check if we're currently on the booster opening page
|
||||
if (UIPageController.Instance.CurrentPage == boosterOpeningPage)
|
||||
{
|
||||
@@ -70,7 +73,6 @@ namespace UI.CardSystem
|
||||
UIPageController.Instance.PushPage(albumViewPage);
|
||||
}
|
||||
}
|
||||
// If we're already on the album main page, do nothing
|
||||
}
|
||||
|
||||
private void OnPageChanged(UIPage currentPage)
|
||||
|
||||
@@ -335,7 +335,7 @@ namespace UI.CardSystem
|
||||
{
|
||||
if (editorCardDefinition == null)
|
||||
{
|
||||
UnityEngine.Debug.LogWarning("[CardDisplay] No Card Definition assigned in Editor Tools.");
|
||||
Debug.LogWarning("[CardDisplay] No Card Definition assigned in Editor Tools.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using AppleHills.Data.CardSystem;
|
||||
using Core;
|
||||
using Data.CardSystem;
|
||||
using Pixelplacement;
|
||||
using UI.DragAndDrop.Core;
|
||||
@@ -63,15 +64,15 @@ namespace UI.CardSystem
|
||||
/// </summary>
|
||||
public void RevealCard()
|
||||
{
|
||||
if (_isRevealed) return;
|
||||
|
||||
if (_isRevealed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
_isRevealed = true;
|
||||
|
||||
if (flippableCard != null)
|
||||
{
|
||||
flippableCard.FlipToReveal();
|
||||
}
|
||||
|
||||
OnCardRevealed?.Invoke(this, _cardData);
|
||||
}
|
||||
|
||||
@@ -82,7 +83,7 @@ namespace UI.CardSystem
|
||||
{
|
||||
if (_cardData == null)
|
||||
{
|
||||
Debug.LogWarning("[AlbumCardPlacementDraggable] Cannot snap to slot - no card data assigned.");
|
||||
Logging.Warning("[AlbumCardPlacementDraggable] Cannot snap to slot - no card data assigned.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -117,7 +118,7 @@ namespace UI.CardSystem
|
||||
TweenExtractedCardToSlot(extractedCard, () =>
|
||||
{
|
||||
// After animation completes
|
||||
Debug.Log($"[AlbumCardPlacementDraggable] Card placement animation complete for {_cardData.Name}");
|
||||
Logging.Debug($"[AlbumCardPlacementDraggable] Card placement animation complete for {_cardData.Name}");
|
||||
|
||||
// Notify that card was placed
|
||||
OnCardPlacedInAlbum?.Invoke(this, _cardData);
|
||||
@@ -128,13 +129,13 @@ namespace UI.CardSystem
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("[AlbumCardPlacementDraggable] Failed to extract AlbumCard from wrapper!");
|
||||
Logging.Warning("[AlbumCardPlacementDraggable] Failed to extract AlbumCard from wrapper!");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"[AlbumCardPlacementDraggable] Could not find matching slot for card '{_cardData.Name}' (Zone: {_cardData.Zone}, Index: {_cardData.CollectionIndex})");
|
||||
Logging.Warning($"[AlbumCardPlacementDraggable] Could not find matching slot for card '{_cardData.Name}' (Zone: {_cardData.Zone}, Index: {_cardData.CollectionIndex})");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,7 +163,7 @@ namespace UI.CardSystem
|
||||
Tween.LocalRotation(cardTransform, Quaternion.identity, snapDuration, 0f, Tween.EaseOutBack,
|
||||
completeCallback: () =>
|
||||
{
|
||||
Debug.Log($"[AlbumCardPlacementDraggable] Tween complete for extracted card {card.name}, final height: {cardRect.sizeDelta.y}");
|
||||
Logging.Debug($"[AlbumCardPlacementDraggable] Tween complete for extracted card {card.name}, final height: {cardRect.sizeDelta.y}");
|
||||
onComplete?.Invoke();
|
||||
});
|
||||
}
|
||||
@@ -191,9 +192,6 @@ namespace UI.CardSystem
|
||||
protected override void OnPointerUpHook(bool longPress)
|
||||
{
|
||||
base.OnPointerUpHook(longPress);
|
||||
|
||||
Debug.Log($"[CLICK-TRACE-PLACEMENT] OnPointerUpHook on {name}, _wasDragged={_wasDragged}, _isRevealed={_isRevealed}, _waitingForPlacementTap={_waitingForPlacementTap}, longPress={longPress}");
|
||||
|
||||
_isHolding = false;
|
||||
|
||||
// Cancel hold timer if running
|
||||
@@ -202,40 +200,35 @@ namespace UI.CardSystem
|
||||
StopCoroutine(_holdRevealCoroutine);
|
||||
_holdRevealCoroutine = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
|
||||
// Handle tap (not dragged)
|
||||
if (!_wasDragged)
|
||||
{
|
||||
if (!_isRevealed)
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-PLACEMENT] {name} - First tap, revealing card");
|
||||
// First tap: reveal the card
|
||||
RevealCard();
|
||||
_waitingForPlacementTap = true;
|
||||
}
|
||||
else if (_waitingForPlacementTap)
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-PLACEMENT] {name} - Second tap, snapping to slot");
|
||||
// Second tap: snap to slot
|
||||
_waitingForPlacementTap = false;
|
||||
SnapToAlbumSlot();
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-PLACEMENT] {name} - Tap after reveal but not waiting for placement tap");
|
||||
}
|
||||
}
|
||||
else if (_isDragRevealing)
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-PLACEMENT] {name} - Was drag-revealed, auto-snapping");
|
||||
// Was drag-revealed, auto-snap on release
|
||||
_isDragRevealing = false;
|
||||
SnapToAlbumSlot();
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-PLACEMENT] {name} - Was dragged but no special handling");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -250,7 +243,6 @@ namespace UI.CardSystem
|
||||
{
|
||||
RevealCard();
|
||||
_isDragRevealing = true;
|
||||
Debug.Log("[AlbumCardDraggable] Card revealed via hold");
|
||||
}
|
||||
|
||||
_holdRevealCoroutine = null;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using AppleHills.Data.CardSystem;
|
||||
using Core;
|
||||
using Data.CardSystem;
|
||||
using UI.DragAndDrop.Core;
|
||||
using UnityEngine;
|
||||
@@ -72,7 +73,7 @@ namespace UI.CardSystem
|
||||
albumCard.SetParentSlot(this);
|
||||
|
||||
// Register with AlbumViewPage for enlarge/shrink handling
|
||||
AlbumViewPage albumPage = FindObjectOfType<AlbumViewPage>();
|
||||
AlbumViewPage albumPage = FindFirstObjectByType<AlbumViewPage>();
|
||||
if (albumPage != null)
|
||||
{
|
||||
albumPage.RegisterAlbumCard(albumCard);
|
||||
@@ -133,7 +134,7 @@ namespace UI.CardSystem
|
||||
// Keep preview hidden - it'll show when user taps to enlarge
|
||||
previewCardDisplay.gameObject.SetActive(false);
|
||||
|
||||
Debug.Log($"[AlbumCardSlot] Setup preview card for {targetCardDefinition.Name} (hidden until tap)");
|
||||
Logging.Debug($"[AlbumCardSlot] Setup preview card for {targetCardDefinition.Name} (hidden until tap)");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -152,7 +153,7 @@ namespace UI.CardSystem
|
||||
// Guard: need prefab to spawn
|
||||
if (albumCardPrefab == null)
|
||||
{
|
||||
Debug.LogWarning($"[AlbumCardSlot] No albumCardPrefab assigned for slot targeting {targetCardDefinition.name}");
|
||||
Logging.Warning($"[AlbumCardSlot] No albumCardPrefab assigned for slot targeting {targetCardDefinition.name}");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -207,17 +208,17 @@ namespace UI.CardSystem
|
||||
}
|
||||
|
||||
// Register with AlbumViewPage for enlarge/shrink handling
|
||||
AlbumViewPage albumPage = FindObjectOfType<AlbumViewPage>();
|
||||
AlbumViewPage albumPage = FindFirstObjectByType<AlbumViewPage>();
|
||||
if (albumPage != null)
|
||||
{
|
||||
albumPage.RegisterAlbumCard(albumCard);
|
||||
}
|
||||
|
||||
Debug.Log($"[AlbumCardSlot] Spawned owned card '{cardData.Name}' ({cardData.Rarity}) in slot");
|
||||
Logging.Debug($"[AlbumCardSlot] Spawned owned card '{cardData.Name}' ({cardData.Rarity}) in slot");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"[AlbumCardSlot] Spawned prefab has no AlbumCard component!");
|
||||
Logging.Warning($"[AlbumCardSlot] Spawned prefab has no AlbumCard component!");
|
||||
Destroy(cardObj);
|
||||
}
|
||||
}
|
||||
@@ -235,30 +236,30 @@ namespace UI.CardSystem
|
||||
/// </summary>
|
||||
public void OnPointerClick(PointerEventData eventData)
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-SLOT] OnPointerClick on {name}, _isOccupiedPermanently={_isOccupiedPermanently}, _placedCard={((_placedCard != null) ? _placedCard.name : "NULL")}, _isPreviewShowing={_isPreviewShowing}, position={eventData.position}");
|
||||
Logging.Debug($"[CLICK-TRACE-SLOT] OnPointerClick on {name}, _isOccupiedPermanently={_isOccupiedPermanently}, _placedCard={((_placedCard != null) ? _placedCard.name : "NULL")}, _isPreviewShowing={_isPreviewShowing}, position={eventData.position}");
|
||||
|
||||
// Only handle clicks if slot is empty
|
||||
if (_isOccupiedPermanently || _placedCard != null)
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-SLOT] {name} - Slot is occupied, ignoring");
|
||||
Logging.Debug($"[CLICK-TRACE-SLOT] {name} - Slot is occupied, ignoring");
|
||||
return;
|
||||
}
|
||||
|
||||
// Only handle if we have a preview card setup
|
||||
if (previewCardDisplay == null || targetCardDefinition == null)
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-SLOT] {name} - No preview setup, ignoring");
|
||||
Logging.Debug($"[CLICK-TRACE-SLOT] {name} - No preview setup, ignoring");
|
||||
return;
|
||||
}
|
||||
|
||||
if (_isPreviewShowing)
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-SLOT] {name} - Preview is showing, hiding it");
|
||||
Logging.Debug($"[CLICK-TRACE-SLOT] {name} - Preview is showing, hiding it");
|
||||
HidePreview();
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-SLOT] {name} - Preview is hidden, showing it");
|
||||
Logging.Debug($"[CLICK-TRACE-SLOT] {name} - Preview is hidden, showing it");
|
||||
ShowPreview();
|
||||
}
|
||||
}
|
||||
@@ -283,7 +284,7 @@ namespace UI.CardSystem
|
||||
previewCardDisplay.transform.localScale = _previewOriginalScale;
|
||||
|
||||
// Get AlbumViewPage to show backdrop and reparent
|
||||
AlbumViewPage albumPage = FindObjectOfType<AlbumViewPage>();
|
||||
AlbumViewPage albumPage = FindFirstObjectByType<AlbumViewPage>();
|
||||
if (albumPage != null)
|
||||
{
|
||||
albumPage.ShowSlotPreview(this, previewCardDisplay.transform);
|
||||
@@ -293,7 +294,7 @@ namespace UI.CardSystem
|
||||
Pixelplacement.Tween.LocalScale(previewCardDisplay.transform, _previewOriginalScale * previewEnlargedScale,
|
||||
previewScaleDuration, 0f, Pixelplacement.Tween.EaseOutBack);
|
||||
|
||||
Debug.Log($"[AlbumCardSlot] Showing preview for {targetCardDefinition.Name}");
|
||||
Logging.Debug($"[AlbumCardSlot] Showing preview for {targetCardDefinition.Name}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -310,7 +311,7 @@ namespace UI.CardSystem
|
||||
previewCardDisplay.SetPreviewMode(false, null);
|
||||
|
||||
// Get AlbumViewPage to hide backdrop
|
||||
AlbumViewPage albumPage = FindObjectOfType<AlbumViewPage>();
|
||||
AlbumViewPage albumPage = FindFirstObjectByType<AlbumViewPage>();
|
||||
if (albumPage != null)
|
||||
{
|
||||
albumPage.HideSlotPreview(this, previewCardDisplay.transform, () =>
|
||||
@@ -340,11 +341,11 @@ namespace UI.CardSystem
|
||||
// Hide the preview card after returning to slot
|
||||
previewCardDisplay.gameObject.SetActive(false);
|
||||
|
||||
Debug.Log($"[AlbumCardSlot] Preview hidden and reset for {targetCardDefinition.Name}");
|
||||
Logging.Debug($"[AlbumCardSlot] Preview hidden and reset for {targetCardDefinition.Name}");
|
||||
});
|
||||
}
|
||||
|
||||
Debug.Log($"[AlbumCardSlot] Hiding preview for {targetCardDefinition.Name}");
|
||||
Logging.Debug($"[AlbumCardSlot] Hiding preview for {targetCardDefinition.Name}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -352,7 +353,7 @@ namespace UI.CardSystem
|
||||
/// </summary>
|
||||
public void DismissPreview()
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-SLOT] DismissPreview called on {name}");
|
||||
Logging.Debug($"[CLICK-TRACE-SLOT] DismissPreview called on {name}");
|
||||
HidePreview();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using UI.DragAndDrop.Core;
|
||||
using Core;
|
||||
using UI.DragAndDrop.Core;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UI.CardSystem.DragDrop
|
||||
@@ -127,10 +128,10 @@ namespace UI.CardSystem.DragDrop
|
||||
/// </summary>
|
||||
public void SetInOpeningSlot(bool inSlot)
|
||||
{
|
||||
Debug.Log($"[BoosterPackDraggable] SetInOpeningSlot({inSlot}) called on {name}");
|
||||
Logging.Debug($"[BoosterPackDraggable] SetInOpeningSlot({inSlot}) called on {name}");
|
||||
|
||||
SetDraggingEnabled(!inSlot); // Disable dragging when in opening slot
|
||||
Debug.Log($"[BoosterPackDraggable] SetDraggingEnabled({!inSlot}) called");
|
||||
Logging.Debug($"[BoosterPackDraggable] SetDraggingEnabled({!inSlot}) called");
|
||||
|
||||
canTapToOpen = inSlot; // Enable tap-to-open when in opening slot
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using AppleHills.Data.CardSystem;
|
||||
using Core;
|
||||
using Pixelplacement;
|
||||
using Pixelplacement.TweenSystem;
|
||||
using UnityEngine;
|
||||
@@ -40,7 +41,6 @@ namespace UI.CardSystem
|
||||
// State
|
||||
private bool _isFlipped = false;
|
||||
private bool _isFlipping = false;
|
||||
private bool _isHovering = false;
|
||||
private TweenBase _idleHoverTween;
|
||||
private CardData _cardData;
|
||||
private Vector2 _originalPosition; // Track original spawn position
|
||||
@@ -241,8 +241,6 @@ namespace UI.CardSystem
|
||||
if (_isFlipped || _isFlipping)
|
||||
return;
|
||||
|
||||
_isHovering = true;
|
||||
|
||||
// Scale up slightly on hover
|
||||
Tween.LocalScale(transform, Vector3.one * hoverScaleMultiplier, 0.2f, 0f, Tween.EaseOutBack);
|
||||
}
|
||||
@@ -252,20 +250,18 @@ namespace UI.CardSystem
|
||||
if (_isFlipped || _isFlipping)
|
||||
return;
|
||||
|
||||
_isHovering = false;
|
||||
|
||||
// Scale back to normal
|
||||
Tween.LocalScale(transform, Vector3.one, 0.2f, 0f, Tween.EaseOutBack);
|
||||
}
|
||||
|
||||
public void OnPointerClick(PointerEventData eventData)
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-FLIPPABLE] OnPointerClick on {name}, _isClickable={_isClickable}, _isWaitingForTap={_isWaitingForTap}, _isFlipped={_isFlipped}, position={eventData.position}");
|
||||
Logging.Debug($"[CLICK-TRACE-FLIPPABLE] OnPointerClick on {name}, _isClickable={_isClickable}, _isWaitingForTap={_isWaitingForTap}, _isFlipped={_isFlipped}, position={eventData.position}");
|
||||
|
||||
// If not clickable, notify and return
|
||||
if (!_isClickable)
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-FLIPPABLE] {name} - Not clickable, firing OnClickedWhileInactive");
|
||||
Logging.Debug($"[CLICK-TRACE-FLIPPABLE] {name} - Not clickable, firing OnClickedWhileInactive");
|
||||
OnClickedWhileInactive?.Invoke(this);
|
||||
return;
|
||||
}
|
||||
@@ -273,7 +269,7 @@ namespace UI.CardSystem
|
||||
// If waiting for tap after reveal, handle that
|
||||
if (_isWaitingForTap)
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-FLIPPABLE] {name} - Waiting for tap, dismissing enlarged state");
|
||||
Logging.Debug($"[CLICK-TRACE-FLIPPABLE] {name} - Waiting for tap, dismissing enlarged state");
|
||||
OnCardTappedAfterReveal?.Invoke(this);
|
||||
_isWaitingForTap = false;
|
||||
return;
|
||||
@@ -281,11 +277,11 @@ namespace UI.CardSystem
|
||||
|
||||
if (_isFlipped || _isFlipping)
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-FLIPPABLE] {name} - Ignoring click (flipped={_isFlipped}, flipping={_isFlipping})");
|
||||
Logging.Debug($"[CLICK-TRACE-FLIPPABLE] {name} - Ignoring click (flipped={_isFlipped}, flipping={_isFlipping})");
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Log($"[CLICK-TRACE-FLIPPABLE] {name} - Processing click, starting flip");
|
||||
Logging.Debug($"[CLICK-TRACE-FLIPPABLE] {name} - Processing click, starting flip");
|
||||
// Flip on click
|
||||
FlipToReveal();
|
||||
}
|
||||
@@ -341,7 +337,7 @@ namespace UI.CardSystem
|
||||
/// </summary>
|
||||
private void TriggerUpgradeTransition(AppleHills.Data.CardSystem.CardData lowerRarityCard)
|
||||
{
|
||||
Debug.Log($"[FlippableCard] Triggering upgrade transition from {lowerRarityCard.Rarity}!");
|
||||
Logging.Debug($"[FlippableCard] Triggering upgrade transition from {lowerRarityCard.Rarity}!");
|
||||
|
||||
AppleHills.Data.CardSystem.CardRarity oldRarity = lowerRarityCard.Rarity;
|
||||
AppleHills.Data.CardSystem.CardRarity newRarity = oldRarity + 1;
|
||||
@@ -429,7 +425,7 @@ namespace UI.CardSystem
|
||||
if (newCardText != null)
|
||||
newCardText.SetActive(true);
|
||||
|
||||
Debug.Log($"[FlippableCard] Card upgraded from {oldRarity} to {newRarity}! Showing as NEW.");
|
||||
Logging.Debug($"[FlippableCard] Card upgraded from {oldRarity} to {newRarity}! Showing as NEW.");
|
||||
|
||||
// Card is already enlarged from the repeat display, so no need to enlarge again
|
||||
}
|
||||
@@ -457,7 +453,7 @@ namespace UI.CardSystem
|
||||
TransitionToNewCardView(newRarity);
|
||||
});
|
||||
|
||||
Debug.Log($"[FlippableCard] Card upgraded from {oldRarity} to {newRarity}! Showing progress {ownedAtNewRarity}/5");
|
||||
Logging.Debug($"[FlippableCard] Card upgraded from {oldRarity} to {newRarity}! Showing progress {ownedAtNewRarity}/5");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -465,7 +461,7 @@ namespace UI.CardSystem
|
||||
/// </summary>
|
||||
private void TransitionToNewCardView(AppleHills.Data.CardSystem.CardRarity newRarity)
|
||||
{
|
||||
Debug.Log($"[FlippableCard] Transitioning to NEW CARD view at {newRarity} rarity");
|
||||
Logging.Debug($"[FlippableCard] Transitioning to NEW CARD view at {newRarity} rarity");
|
||||
|
||||
// Update the CardDisplay to show new rarity
|
||||
if (cardDisplay != null && _cardData != null)
|
||||
@@ -488,7 +484,7 @@ namespace UI.CardSystem
|
||||
_isNew = true;
|
||||
_isWaitingForTap = true;
|
||||
|
||||
Debug.Log($"[FlippableCard] Now showing as NEW CARD at {newRarity}, waiting for tap");
|
||||
Logging.Debug($"[FlippableCard] Now showing as NEW CARD at {newRarity}, waiting for tap");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -538,7 +534,7 @@ namespace UI.CardSystem
|
||||
// Check if we have the required number of elements (should match cardsToUpgrade)
|
||||
if (progressElements.Length < cardsToUpgrade)
|
||||
{
|
||||
Debug.LogWarning($"[FlippableCard] Not enough Image components in progress bar! Expected {cardsToUpgrade}, found {progressElements.Length}");
|
||||
Logging.Warning($"[FlippableCard] Not enough Image components in progress bar! Expected {cardsToUpgrade}, found {progressElements.Length}");
|
||||
onComplete?.Invoke();
|
||||
return;
|
||||
}
|
||||
@@ -647,7 +643,7 @@ namespace UI.CardSystem
|
||||
{
|
||||
if (albumCard == null)
|
||||
{
|
||||
Debug.LogWarning("[FlippableCard] Cannot extract AlbumCard - none found!");
|
||||
Logging.Warning("[FlippableCard] Cannot extract AlbumCard - none found!");
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -661,7 +657,7 @@ namespace UI.CardSystem
|
||||
albumCard.SetupCard(_cardData);
|
||||
}
|
||||
|
||||
Debug.Log($"[FlippableCard] Extracted AlbumCard '{_cardData?.Name}' to {newParent.name} - ready for tween");
|
||||
Logging.Debug($"[FlippableCard] Extracted AlbumCard '{_cardData?.Name}' to {newParent.name} - ready for tween");
|
||||
|
||||
return albumCard;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Core;
|
||||
using Data.CardSystem;
|
||||
using Pixelplacement;
|
||||
using UnityEngine;
|
||||
@@ -10,7 +11,8 @@ namespace UI.CardSystem
|
||||
/// <summary>
|
||||
/// Singleton UI component for granting booster packs from minigames.
|
||||
/// Displays a booster pack with glow effect, waits for user to click continue,
|
||||
/// then animates the pack flying to bottom-left corner before granting the reward.
|
||||
/// then shows the scrapbook button and animates the pack flying to it before granting the reward.
|
||||
/// The scrapbook button is automatically hidden after the animation completes.
|
||||
/// </summary>
|
||||
public class MinigameBoosterGiver : MonoBehaviour
|
||||
{
|
||||
@@ -25,7 +27,6 @@ namespace UI.CardSystem
|
||||
[Header("Animation Settings")]
|
||||
[SerializeField] private float hoverAmount = 20f;
|
||||
[SerializeField] private float hoverDuration = 1.5f;
|
||||
[SerializeField] private float glowPulseMin = 0.9f;
|
||||
[SerializeField] private float glowPulseMax = 1.1f;
|
||||
[SerializeField] private float glowPulseDuration = 1.2f;
|
||||
|
||||
@@ -45,7 +46,7 @@ namespace UI.CardSystem
|
||||
// Singleton pattern
|
||||
if (Instance != null && Instance != this)
|
||||
{
|
||||
Debug.LogWarning("[MinigameBoosterGiver] Duplicate instance found. Destroying.");
|
||||
Logging.Warning("[MinigameBoosterGiver] Duplicate instance found. Destroying.");
|
||||
Destroy(gameObject);
|
||||
return;
|
||||
}
|
||||
@@ -98,7 +99,7 @@ namespace UI.CardSystem
|
||||
{
|
||||
if (_currentSequence != null)
|
||||
{
|
||||
Debug.LogWarning("[MinigameBoosterGiver] Already running a sequence. Ignoring new request.");
|
||||
Logging.Warning("[MinigameBoosterGiver] Already running a sequence. Ignoring new request.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -187,23 +188,61 @@ namespace UI.CardSystem
|
||||
yield break;
|
||||
}
|
||||
|
||||
// Calculate bottom-left corner position in local space
|
||||
RectTransform canvasRect = GetComponentInParent<Canvas>()?.GetComponent<RectTransform>();
|
||||
Vector3 targetPosition;
|
||||
|
||||
if (canvasRect != null)
|
||||
// Show scrapbook button temporarily using HUD visibility context
|
||||
PlayerHudManager.HudVisibilityContext hudContext = null;
|
||||
GameObject scrapbookButton = null;
|
||||
|
||||
scrapbookButton = PlayerHudManager.Instance.GetScrabookButton();
|
||||
if (scrapbookButton != null)
|
||||
{
|
||||
// Convert bottom-left corner with offset to local position
|
||||
Vector2 bottomLeft = new Vector2(-canvasRect.rect.width / 2f, -canvasRect.rect.height / 2f);
|
||||
targetPosition = bottomLeft + targetBottomLeftOffset;
|
||||
hudContext = PlayerHudManager.Instance.ShowElementTemporarily(scrapbookButton);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Fallback if no canvas found
|
||||
targetPosition = _boosterInitialPosition + new Vector3(-500f, -500f, 0f);
|
||||
Logging.Warning("[MinigameBoosterGiver] Scrapbook button not found in PlayerHudManager.");
|
||||
}
|
||||
|
||||
// Tween to bottom-left corner
|
||||
// Calculate target position - use scrapbook button position if available
|
||||
Vector3 targetPosition;
|
||||
|
||||
if (scrapbookButton != null)
|
||||
{
|
||||
// Get the scrapbook button's position in the same coordinate space as boosterImage
|
||||
RectTransform scrapbookRect = scrapbookButton.GetComponent<RectTransform>();
|
||||
if (scrapbookRect != null)
|
||||
{
|
||||
// Convert scrapbook button's world position to local position relative to boosterImage's parent
|
||||
Canvas canvas = GetComponentInParent<Canvas>();
|
||||
if (canvas != null && canvas.renderMode == RenderMode.ScreenSpaceOverlay)
|
||||
{
|
||||
// For overlay canvas, convert screen position to local position
|
||||
Vector2 screenPos = RectTransformUtility.WorldToScreenPoint(null, scrapbookRect.position);
|
||||
RectTransformUtility.ScreenPointToLocalPointInRectangle(
|
||||
boosterImage.parent as RectTransform,
|
||||
screenPos,
|
||||
null,
|
||||
out Vector2 localPoint);
|
||||
targetPosition = localPoint;
|
||||
}
|
||||
else
|
||||
{
|
||||
// For world space or camera canvas
|
||||
targetPosition = boosterImage.parent.InverseTransformPoint(scrapbookRect.position);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Warning("[MinigameBoosterGiver] Scrapbook button has no RectTransform, using fallback position.");
|
||||
targetPosition = GetFallbackPosition();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Fallback to bottom-left corner
|
||||
targetPosition = GetFallbackPosition();
|
||||
}
|
||||
|
||||
// Tween to scrapbook button position
|
||||
Tween.LocalPosition(boosterImage, targetPosition, disappearDuration, 0f, Tween.EaseInBack);
|
||||
|
||||
// Scale down
|
||||
@@ -217,13 +256,16 @@ namespace UI.CardSystem
|
||||
if (CardSystemManager.Instance != null)
|
||||
{
|
||||
CardSystemManager.Instance.AddBoosterPack(1);
|
||||
Debug.Log("[MinigameBoosterGiver] Booster pack granted!");
|
||||
Logging.Debug("[MinigameBoosterGiver] Booster pack granted!");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("[MinigameBoosterGiver] CardSystemManager not found, cannot grant booster pack.");
|
||||
Logging.Warning("[MinigameBoosterGiver] CardSystemManager not found, cannot grant booster pack.");
|
||||
}
|
||||
|
||||
// Hide scrapbook button by disposing the context
|
||||
hudContext?.Dispose();
|
||||
|
||||
// Hide the visual
|
||||
if (visualContainer != null)
|
||||
{
|
||||
@@ -237,6 +279,22 @@ namespace UI.CardSystem
|
||||
// Clear sequence reference
|
||||
_currentSequence = null;
|
||||
}
|
||||
|
||||
private Vector3 GetFallbackPosition()
|
||||
{
|
||||
RectTransform canvasRect = GetComponentInParent<Canvas>()?.GetComponent<RectTransform>();
|
||||
if (canvasRect != null)
|
||||
{
|
||||
// Convert bottom-left corner with offset to local position
|
||||
Vector2 bottomLeft = new Vector2(-canvasRect.rect.width / 2f, -canvasRect.rect.height / 2f);
|
||||
return bottomLeft + targetBottomLeftOffset;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Ultimate fallback if no canvas found
|
||||
return _boosterInitialPosition + new Vector3(-500f, -500f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using UI.DragAndDrop.Core;
|
||||
using Core;
|
||||
using UI.DragAndDrop.Core;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UI.CardSystem
|
||||
@@ -22,7 +23,7 @@ namespace UI.CardSystem
|
||||
if (container == null || objects == null || objects.Count == 0)
|
||||
return;
|
||||
|
||||
Debug.Log($"[SlotContainerHelper] Shuffling {objects.Count} objects to front slots");
|
||||
Logging.Debug($"[SlotContainerHelper] Shuffling {objects.Count} objects to front slots");
|
||||
|
||||
// Unassign all objects from their current slots
|
||||
foreach (var obj in objects)
|
||||
@@ -41,12 +42,12 @@ namespace UI.CardSystem
|
||||
|
||||
if (targetSlot != null)
|
||||
{
|
||||
Debug.Log($"[SlotContainerHelper] Assigning object to slot with SlotIndex {i}");
|
||||
Logging.Debug($"[SlotContainerHelper] Assigning object to slot with SlotIndex {i}");
|
||||
obj.AssignToSlot(targetSlot, animate);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"[SlotContainerHelper] Could not find slot with SlotIndex {i}");
|
||||
Logging.Warning($"[SlotContainerHelper] Could not find slot with SlotIndex {i}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using Core;
|
||||
using Core.Lifecycle;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace UI.Core
|
||||
@@ -9,12 +10,19 @@ namespace UI.Core
|
||||
/// <summary>
|
||||
/// Manages UI page transitions and maintains a stack of active pages.
|
||||
/// Pages are pushed onto a stack for navigation and popped when going back.
|
||||
/// Supports both scene-based pages and prefab-based instantiation.
|
||||
/// </summary>
|
||||
public class UIPageController : ManagedBehaviour
|
||||
{
|
||||
private static UIPageController _instance;
|
||||
public static UIPageController Instance => _instance;
|
||||
|
||||
[Header("Canvas Management")]
|
||||
[SerializeField] private Transform mainCanvas;
|
||||
|
||||
// Cache instantiated pages to avoid re-creating them
|
||||
private Dictionary<GameObject, UIPage> _prefabInstanceCache = new Dictionary<GameObject, UIPage>();
|
||||
|
||||
private Stack<UIPage> _pageStack = new Stack<UIPage>();
|
||||
public UIPage CurrentPage => _pageStack.Count > 0 ? _pageStack.Peek() : null;
|
||||
public IEnumerable<UIPage> PageStack => _pageStack;
|
||||
@@ -31,15 +39,13 @@ namespace UI.Core
|
||||
|
||||
public override int ManagedAwakePriority => 50; // UI infrastructure
|
||||
|
||||
private new void Awake()
|
||||
internal override void OnManagedAwake()
|
||||
{
|
||||
base.Awake(); // CRITICAL: Register with LifecycleManager!
|
||||
|
||||
// Set instance immediately so it's available before OnManagedAwake() is called
|
||||
// Set instance immediately (early initialization)
|
||||
_instance = this;
|
||||
}
|
||||
|
||||
protected override void OnManagedAwake()
|
||||
internal override void OnManagedStart()
|
||||
{
|
||||
Logging.Debug("[UIPageController] Initialized");
|
||||
}
|
||||
@@ -48,7 +54,17 @@ namespace UI.Core
|
||||
{
|
||||
base.OnDestroy();
|
||||
|
||||
// Clean up event subscription when the controller is destroyed
|
||||
// Clean up cached instances
|
||||
foreach (var cachedPage in _prefabInstanceCache.Values)
|
||||
{
|
||||
if (cachedPage != null)
|
||||
{
|
||||
Destroy(cachedPage.gameObject);
|
||||
}
|
||||
}
|
||||
_prefabInstanceCache.Clear();
|
||||
|
||||
// Clean up event subscription
|
||||
if (_cancelAction != null)
|
||||
{
|
||||
_cancelAction.performed -= OnCancelActionPerformed;
|
||||
@@ -85,6 +101,86 @@ namespace UI.Core
|
||||
Logging.Debug($"[UIPageController] Pushed page: {page.PageName}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Pushes a page from a prefab. Instantiates on first use, reuses on subsequent calls.
|
||||
/// </summary>
|
||||
/// <param name="pagePrefab">The prefab containing a UIPage component</param>
|
||||
public void PushPageFromPrefab(GameObject pagePrefab)
|
||||
{
|
||||
if (pagePrefab == null)
|
||||
{
|
||||
Debug.LogError("[UIPageController] Cannot push null prefab");
|
||||
return;
|
||||
}
|
||||
|
||||
UIPage pageInstance = GetOrInstantiatePage(pagePrefab);
|
||||
if (pageInstance != null)
|
||||
{
|
||||
PushPage(pageInstance); // Use existing push logic
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets cached page instance or instantiates a new one from prefab.
|
||||
/// Searches for UIPage component on root GameObject first, then in first-order children.
|
||||
/// </summary>
|
||||
private UIPage GetOrInstantiatePage(GameObject pagePrefab)
|
||||
{
|
||||
// Check cache first
|
||||
if (_prefabInstanceCache.TryGetValue(pagePrefab, out UIPage cachedPage))
|
||||
{
|
||||
if (cachedPage != null) // Null check in case it was destroyed
|
||||
{
|
||||
return cachedPage;
|
||||
}
|
||||
else
|
||||
{
|
||||
_prefabInstanceCache.Remove(pagePrefab);
|
||||
}
|
||||
}
|
||||
|
||||
// Validate mainCanvas
|
||||
if (mainCanvas == null)
|
||||
{
|
||||
Debug.LogError("[UIPageController] mainCanvas is not assigned! Cannot instantiate page prefab.");
|
||||
return null;
|
||||
}
|
||||
|
||||
// Instantiate new page
|
||||
GameObject pageObject = Instantiate(pagePrefab, mainCanvas);
|
||||
|
||||
// Try to find UIPage component on root first
|
||||
UIPage pageComponent = pageObject.GetComponent<UIPage>();
|
||||
|
||||
// If not found on root, search first-order children (in hierarchy order)
|
||||
if (pageComponent == null)
|
||||
{
|
||||
Transform pageTransform = pageObject.transform;
|
||||
for (int i = 0; i < pageTransform.childCount; i++)
|
||||
{
|
||||
pageComponent = pageTransform.GetChild(i).GetComponent<UIPage>();
|
||||
if (pageComponent != null)
|
||||
{
|
||||
Logging.Debug($"[UIPageController] Found UIPage component on child: {pageComponent.gameObject.name}");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (pageComponent == null)
|
||||
{
|
||||
Debug.LogError($"[UIPageController] Prefab {pagePrefab.name} does not have a UIPage component on root or first-order children!");
|
||||
Destroy(pageObject);
|
||||
return null;
|
||||
}
|
||||
|
||||
// Cache it
|
||||
_prefabInstanceCache[pagePrefab] = pageComponent;
|
||||
|
||||
Logging.Debug($"[UIPageController] Instantiated and cached page: {pageComponent.PageName}");
|
||||
return pageComponent;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Pops the current page from the stack and shows the previous page.
|
||||
/// </summary>
|
||||
@@ -92,40 +188,72 @@ namespace UI.Core
|
||||
{
|
||||
if (_pageStack.Count <= 0) return;
|
||||
|
||||
// Hide and pop current page
|
||||
// Pop current page from stack
|
||||
UIPage currentPage = _pageStack.Pop();
|
||||
currentPage.TransitionOut();
|
||||
|
||||
// Show previous page if there is one
|
||||
if (_pageStack.Count > 0)
|
||||
// Subscribe to transition out completion event
|
||||
Action onTransitionComplete = null;
|
||||
onTransitionComplete = () =>
|
||||
{
|
||||
UIPage previousPage = _pageStack.Peek();
|
||||
previousPage.TransitionIn();
|
||||
OnPageChanged?.Invoke(previousPage);
|
||||
Logging.Debug($"[UIPageController] Popped to previous page: {previousPage.PageName}");
|
||||
}
|
||||
else
|
||||
{
|
||||
OnPageChanged?.Invoke(null);
|
||||
Logging.Debug("[UIPageController] Popped last page, no pages left in stack");
|
||||
}
|
||||
// Unsubscribe to prevent memory leaks
|
||||
currentPage.OnTransitionOutCompleted -= onTransitionComplete;
|
||||
|
||||
// Fire OnPageChanged AFTER transition completes
|
||||
if (_pageStack.Count > 0)
|
||||
{
|
||||
UIPage previousPage = _pageStack.Peek();
|
||||
previousPage.TransitionIn();
|
||||
OnPageChanged?.Invoke(previousPage);
|
||||
Logging.Debug($"[UIPageController] Popped to previous page: {previousPage.PageName}");
|
||||
}
|
||||
else
|
||||
{
|
||||
OnPageChanged?.Invoke(null);
|
||||
Logging.Debug("[UIPageController] Popped last page, no pages left in stack");
|
||||
}
|
||||
};
|
||||
|
||||
currentPage.OnTransitionOutCompleted += onTransitionComplete;
|
||||
|
||||
// Start the transition out animation
|
||||
currentPage.TransitionOut();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clears all pages from the stack.
|
||||
/// Clears all pages from the stack and optionally destroys cached instances.
|
||||
/// </summary>
|
||||
public void ClearStack()
|
||||
/// <param name="destroyCachedInstances">If true, destroys all cached prefab instances</param>
|
||||
public void ClearStack(bool destroyCachedInstances = false)
|
||||
{
|
||||
if (_pageStack.Count <= 0) return;
|
||||
|
||||
// Hide current page
|
||||
UIPage currentPage = _pageStack.Peek();
|
||||
currentPage.TransitionOut();
|
||||
if (_pageStack.Count > 0)
|
||||
{
|
||||
// Hide current page
|
||||
UIPage currentPage = _pageStack.Peek();
|
||||
currentPage.TransitionOut();
|
||||
}
|
||||
|
||||
// Clear stack
|
||||
_pageStack.Clear();
|
||||
|
||||
// Optionally destroy cached instances
|
||||
if (destroyCachedInstances)
|
||||
{
|
||||
foreach (var cachedPage in _prefabInstanceCache.Values)
|
||||
{
|
||||
if (cachedPage != null)
|
||||
{
|
||||
Destroy(cachedPage.gameObject);
|
||||
}
|
||||
}
|
||||
_prefabInstanceCache.Clear();
|
||||
Logging.Debug("[UIPageController] Cleared page stack and destroyed cached instances");
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Debug("[UIPageController] Cleared page stack (cached instances retained)");
|
||||
}
|
||||
|
||||
OnPageChanged?.Invoke(null);
|
||||
Logging.Debug("[UIPageController] Cleared page stack");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Core;
|
||||
using Pixelplacement;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
@@ -79,10 +80,10 @@ namespace UI.DragAndDrop.Core
|
||||
|
||||
protected virtual void Initialize()
|
||||
{
|
||||
Debug.Log($"[DraggableObject] Initializing {name} at world pos {transform.position}, local pos {transform.localPosition}, parent: {(transform.parent != null ? transform.parent.name : "NULL")}");
|
||||
Logging.Debug($"[DraggableObject] Initializing {name} at world pos {transform.position}, local pos {transform.localPosition}, parent: {(transform.parent != null ? transform.parent.name : "NULL")}");
|
||||
|
||||
_canvas = GetComponentInParent<Canvas>();
|
||||
Debug.Log($"[DraggableObject] {name} found canvas: {(_canvas != null ? _canvas.name : "NULL")}, canvas pos: {(_canvas != null ? _canvas.transform.position.ToString() : "N/A")}");
|
||||
Logging.Debug($"[DraggableObject] {name} found canvas: {(_canvas != null ? _canvas.name : "NULL")}, canvas pos: {(_canvas != null ? _canvas.transform.position.ToString() : "N/A")}");
|
||||
|
||||
_imageComponent = GetComponent<Image>();
|
||||
_canvasGroup = GetComponent<CanvasGroup>();
|
||||
@@ -95,7 +96,7 @@ namespace UI.DragAndDrop.Core
|
||||
_imageComponent = gameObject.AddComponent<Image>();
|
||||
_imageComponent.color = new Color(1, 1, 1, 0.01f); // Nearly transparent (0 doesn't work)
|
||||
_imageComponent.raycastTarget = true;
|
||||
Debug.Log($"[DraggableObject] Added invisible Image to {name} for raycast detection");
|
||||
Logging.Debug($"[DraggableObject] Added invisible Image to {name} for raycast detection");
|
||||
}
|
||||
|
||||
// Use assigned visual, or find in children recursively if not assigned
|
||||
@@ -190,19 +191,19 @@ namespace UI.DragAndDrop.Core
|
||||
if (eventData.button != PointerEventData.InputButton.Left)
|
||||
return;
|
||||
|
||||
Debug.Log($"[DraggableObject] OnBeginDrag called on {name}. _isDraggingEnabled={_isDraggingEnabled}");
|
||||
Logging.Debug($"[DraggableObject] OnBeginDrag called on {name}. _isDraggingEnabled={_isDraggingEnabled}");
|
||||
|
||||
// Check if dragging is enabled BEFORE setting any state
|
||||
if (!_isDraggingEnabled)
|
||||
{
|
||||
Debug.Log($"[DraggableObject] OnBeginDrag blocked - dragging disabled on {name}");
|
||||
Logging.Debug($"[DraggableObject] OnBeginDrag blocked - dragging disabled on {name}");
|
||||
return;
|
||||
}
|
||||
|
||||
_isDragging = true;
|
||||
_wasDragged = true;
|
||||
|
||||
Debug.Log($"[DraggableObject] Drag started on {name}");
|
||||
Logging.Debug($"[DraggableObject] Drag started on {name}");
|
||||
|
||||
// ...existing code...
|
||||
if (_canvas != null && _canvas.renderMode == RenderMode.ScreenSpaceOverlay && RectTransform != null)
|
||||
@@ -345,7 +346,7 @@ namespace UI.DragAndDrop.Core
|
||||
|
||||
protected virtual void FindAndSnapToSlot()
|
||||
{
|
||||
SlotContainer[] containers = FindObjectsOfType<SlotContainer>();
|
||||
SlotContainer[] containers = FindObjectsByType<SlotContainer>(FindObjectsSortMode.None);
|
||||
DraggableSlot closestSlot = null;
|
||||
float closestDistance = float.MaxValue;
|
||||
|
||||
@@ -413,7 +414,7 @@ namespace UI.DragAndDrop.Core
|
||||
if (slot == null)
|
||||
return;
|
||||
|
||||
Debug.Log($"[DraggableObject] Assigning {name} to slot {slot.name}, animate={animate}, current pos={transform.position}, slot pos={slot.transform.position}");
|
||||
Logging.Debug($"[DraggableObject] Assigning {name} to slot {slot.name}, animate={animate}, current pos={transform.position}, slot pos={slot.transform.position}");
|
||||
|
||||
DraggableSlot previousSlot = _currentSlot;
|
||||
_currentSlot = slot;
|
||||
@@ -429,7 +430,7 @@ namespace UI.DragAndDrop.Core
|
||||
transform.SetParent(slot.transform);
|
||||
transform.localPosition = _isSelected ? new Vector3(0, selectionOffset, 0) : Vector3.zero;
|
||||
transform.localRotation = Quaternion.identity;
|
||||
Debug.Log($"[DraggableObject] {name} assigned to slot {slot.name}, new world pos={transform.position}, local pos={transform.localPosition}");
|
||||
Logging.Debug($"[DraggableObject] {name} assigned to slot {slot.name}, new world pos={transform.position}, local pos={transform.localPosition}");
|
||||
}
|
||||
|
||||
OnSlotChanged?.Invoke(this, slot);
|
||||
@@ -510,14 +511,14 @@ namespace UI.DragAndDrop.Core
|
||||
/// </summary>
|
||||
public virtual void SetDraggingEnabled(bool enabled)
|
||||
{
|
||||
Debug.Log($"[DraggableObject] SetDraggingEnabled({enabled}) called on {name}. _isDragging={_isDragging}, _isDraggingEnabled={_isDraggingEnabled}");
|
||||
Logging.Debug($"[DraggableObject] SetDraggingEnabled({enabled}) called on {name}. _isDragging={_isDragging}, _isDraggingEnabled={_isDraggingEnabled}");
|
||||
|
||||
_isDraggingEnabled = enabled;
|
||||
|
||||
// If disabling dragging while actively dragging, stop the drag
|
||||
if (!enabled && _isDragging)
|
||||
{
|
||||
Debug.Log($"[DraggableObject] Stopping active drag on {name}");
|
||||
Logging.Debug($"[DraggableObject] Stopping active drag on {name}");
|
||||
_isDragging = false;
|
||||
|
||||
// Re-enable raycasting
|
||||
@@ -529,7 +530,7 @@ namespace UI.DragAndDrop.Core
|
||||
_canvasGroup.blocksRaycasts = true;
|
||||
}
|
||||
|
||||
Debug.Log($"[DraggableObject] After SetDraggingEnabled: _isDragging={_isDragging}, _isDraggingEnabled={_isDraggingEnabled}");
|
||||
Logging.Debug($"[DraggableObject] After SetDraggingEnabled: _isDragging={_isDragging}, _isDraggingEnabled={_isDraggingEnabled}");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Pixelplacement;
|
||||
using Core;
|
||||
using Pixelplacement;
|
||||
using Pixelplacement.TweenSystem;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem; // Added for new Input System
|
||||
@@ -67,14 +68,14 @@ namespace UI.DragAndDrop.Core
|
||||
_parentDraggable = parent;
|
||||
|
||||
Canvas parentCanvas = parent.GetComponentInParent<Canvas>();
|
||||
Debug.Log($"[DraggableVisual] Initializing visual for {parent.name} at world pos {parent.transform.position}, parent canvas: {(parentCanvas != null ? parentCanvas.name + " (renderMode: " + parentCanvas.renderMode + ")" : "NULL")}");
|
||||
Logging.Debug($"[DraggableVisual] Initializing visual for {parent.name} at world pos {parent.transform.position}, parent canvas: {(parentCanvas != null ? parentCanvas.name + " (renderMode: " + parentCanvas.renderMode + ")" : "NULL")}");
|
||||
|
||||
// CRITICAL: Reparent visual to canvas (not base) so it can move independently
|
||||
// This enables the delayed follow effect
|
||||
if (parentCanvas != null)
|
||||
{
|
||||
transform.SetParent(parentCanvas.transform, true); // worldPositionStays = true
|
||||
Debug.Log($"[DraggableVisual] Reparented visual {name} to canvas {parentCanvas.name} for independent movement");
|
||||
Logging.Debug($"[DraggableVisual] Reparented visual {name} to canvas {parentCanvas.name} for independent movement");
|
||||
}
|
||||
|
||||
// Get components if assigned (don't auto-create Canvas to avoid Unity's auto-reparenting)
|
||||
@@ -106,7 +107,7 @@ namespace UI.DragAndDrop.Core
|
||||
tiltParent.localRotation = Quaternion.identity;
|
||||
}
|
||||
|
||||
Debug.Log($"[DraggableVisual] Visual {name} initialized at world pos {transform.position}, local pos {transform.localPosition}, local rotation {transform.localRotation.eulerAngles}, parent at world pos {parent.transform.position}, local pos {parent.transform.localPosition}, rotation {parent.transform.rotation.eulerAngles}");
|
||||
Logging.Debug($"[DraggableVisual] Visual {name} initialized at world pos {transform.position}, local pos {transform.localPosition}, local rotation {transform.localRotation.eulerAngles}, parent at world pos {parent.transform.position}, local pos {parent.transform.localPosition}, rotation {parent.transform.rotation.eulerAngles}");
|
||||
|
||||
_isInitialized = true;
|
||||
|
||||
@@ -202,7 +203,7 @@ namespace UI.DragAndDrop.Core
|
||||
float distance = Vector3.Distance(currentPosition, targetPosition);
|
||||
if (distance > 500f)
|
||||
{
|
||||
Debug.LogWarning($"[DraggableVisual] Large position delta detected! Visual {name} at {currentPosition}, target {targetPosition}, parent {_parentDraggable.name}, distance: {distance}");
|
||||
Logging.Warning($"[DraggableVisual] Large position delta detected! Visual {name} at {currentPosition}, target {targetPosition}, parent {_parentDraggable.name}, distance: {distance}");
|
||||
}
|
||||
|
||||
// Apply follow logic with snappy easing
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user