拼ui 一些业务逻辑x实现
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: afec8d3d486f3574d83ade6fc9dc4b82
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
[Serializable]
|
||||
public class GlobalAchievementMetricEntry
|
||||
{
|
||||
public GlobalAchievementMetricType metricType;
|
||||
public float value;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class GlobalAchievementStateEntry
|
||||
{
|
||||
public int achievementId;
|
||||
public bool unlocked;
|
||||
public long unlockedUtcTicks;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class GlobalAchievementSaveData
|
||||
{
|
||||
public int version = 1;
|
||||
public string lastLoginDateStamp;
|
||||
public string trustedDateStamp;
|
||||
public List<GlobalAchievementMetricEntry> metrics = new List<GlobalAchievementMetricEntry>();
|
||||
public List<GlobalAchievementStateEntry> states = new List<GlobalAchievementStateEntry>();
|
||||
}
|
||||
|
||||
public struct GlobalAchievementSnapshot
|
||||
{
|
||||
public GlobalAchievementSO definition;
|
||||
public float currentValue;
|
||||
public float normalizedProgress;
|
||||
public bool unlocked;
|
||||
public DateTime unlockedUtc;
|
||||
public string unlockedDateTimeText;
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5f9bc8ea38a77534a9d329e1992fb750
|
||||
@@ -0,0 +1,71 @@
|
||||
using UnityEngine;
|
||||
|
||||
public enum GlobalAchievementMetricType
|
||||
{
|
||||
TotalCoinsEarned = 0,
|
||||
OwnedHeroCount = 1,
|
||||
OwnedSongCount = 2,
|
||||
BestSingleSongTotalScore = 3,
|
||||
TotalSongBestScoreSum = 4,
|
||||
LoginDays = 5,
|
||||
}
|
||||
|
||||
[CreateAssetMenu(fileName = "GA_", menuName = "SO_Data/GlobalAchievement")]
|
||||
public class GlobalAchievementSO : ScriptableObject
|
||||
{
|
||||
[Header("identity")]
|
||||
public int achievementId;
|
||||
public string displayName;
|
||||
public string achievementSeriesKey;
|
||||
[Range(0, 6)] public int achievementLevel;
|
||||
|
||||
[TextArea(2, 5)]
|
||||
public string description;
|
||||
|
||||
[Header("display")]
|
||||
public Sprite icon;
|
||||
public int sortOrder;
|
||||
public bool hiddenUntilUnlocked;
|
||||
|
||||
[Header("runtime mirror")]
|
||||
[SerializeField] private bool isUnlocked;
|
||||
[SerializeField] private string unlockedDateTime;
|
||||
|
||||
[Header("trigger")]
|
||||
public GlobalAchievementMetricType metricType = GlobalAchievementMetricType.LoginDays;
|
||||
public float targetValue = 1f;
|
||||
|
||||
[Header("steam")]
|
||||
public bool syncWithSteam;
|
||||
public string steamAchievementApiName;
|
||||
|
||||
public bool IsUnlocked
|
||||
{
|
||||
get { return isUnlocked; }
|
||||
}
|
||||
|
||||
public string UnlockedDateTime
|
||||
{
|
||||
get { return unlockedDateTime; }
|
||||
}
|
||||
|
||||
public void SetUnlockedState(bool value, long unlockedUtcTicks = 0L)
|
||||
{
|
||||
isUnlocked = value;
|
||||
if (value && unlockedUtcTicks > 0L)
|
||||
{
|
||||
unlockedDateTime = new System.DateTime(unlockedUtcTicks, System.DateTimeKind.Utc).ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
else if (!value)
|
||||
{
|
||||
unlockedDateTime = string.Empty;
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
if (!Application.isPlaying)
|
||||
{
|
||||
UnityEditor.EditorUtility.SetDirty(this);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c385da50177c22f468bf5b7012e70372
|
||||
@@ -0,0 +1,571 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public sealed class GlobalAchievementService : MonoBehaviour
|
||||
{
|
||||
private const string SaveCategory = "global_achievement";
|
||||
private const string SaveKey = "runtime_state";
|
||||
public const string DefaultResourcesPath = "so/globalachievments";
|
||||
public const string DefaultEditorAssetFolder = "Assets/Resources/so/globalachievments";
|
||||
|
||||
public static GlobalAchievementService Instance { get; private set; }
|
||||
|
||||
public event Action<GlobalAchievementSO> OnAchievementUnlocked;
|
||||
|
||||
private readonly List<GlobalAchievementSO> definitions = new List<GlobalAchievementSO>();
|
||||
private readonly Dictionary<int, GlobalAchievementStateEntry> stateById = new Dictionary<int, GlobalAchievementStateEntry>();
|
||||
private readonly Dictionary<GlobalAchievementMetricType, GlobalAchievementMetricEntry> metricByType = new Dictionary<GlobalAchievementMetricType, GlobalAchievementMetricEntry>();
|
||||
|
||||
private GlobalAchievementSaveData saveData;
|
||||
private bool initialized;
|
||||
private bool loginReportedThisSession;
|
||||
private int lastSaveFrame = -1;
|
||||
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
|
||||
private static void Bootstrap()
|
||||
{
|
||||
EnsureInstance();
|
||||
}
|
||||
|
||||
public static GlobalAchievementService EnsureInstance()
|
||||
{
|
||||
if (Instance != null)
|
||||
{
|
||||
return Instance;
|
||||
}
|
||||
|
||||
var host = new GameObject("__global_achievement_service");
|
||||
host.hideFlags = HideFlags.HideInHierarchy | HideFlags.HideInInspector;
|
||||
DontDestroyOnLoad(host);
|
||||
Instance = host.AddComponent<GlobalAchievementService>();
|
||||
return Instance;
|
||||
}
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (Instance != null && Instance != this)
|
||||
{
|
||||
Destroy(gameObject);
|
||||
return;
|
||||
}
|
||||
|
||||
Instance = this;
|
||||
DontDestroyOnLoad(gameObject);
|
||||
InitializeIfNeeded();
|
||||
}
|
||||
|
||||
private void OnApplicationPause(bool pauseStatus)
|
||||
{
|
||||
if (pauseStatus)
|
||||
{
|
||||
SaveNow();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnApplicationQuit()
|
||||
{
|
||||
SaveNow();
|
||||
}
|
||||
|
||||
public void InitializeIfNeeded()
|
||||
{
|
||||
if (initialized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
initialized = true;
|
||||
GlobalAchievementSaveData loaded;
|
||||
if (!SecureSaveVault.TryLoadJson(SaveCategory, SaveKey, out loaded))
|
||||
{
|
||||
loaded = new GlobalAchievementSaveData();
|
||||
}
|
||||
|
||||
saveData = loaded ?? new GlobalAchievementSaveData();
|
||||
RebuildCaches();
|
||||
LoadDefinitionsFromResources();
|
||||
ReportLoginSessionStart();
|
||||
RefreshDerivedMetrics();
|
||||
SaveNow();
|
||||
}
|
||||
|
||||
public void LoadDefinitionsFromResources(string resourcesPath = DefaultResourcesPath)
|
||||
{
|
||||
InitializeIfNeeded();
|
||||
|
||||
definitions.Clear();
|
||||
GlobalAchievementSO[] loadedDefinitions = Resources.LoadAll<GlobalAchievementSO>(resourcesPath);
|
||||
if (loadedDefinitions != null && loadedDefinitions.Length > 0)
|
||||
{
|
||||
definitions.AddRange(loadedDefinitions);
|
||||
definitions.Sort(CompareDefinitions);
|
||||
}
|
||||
|
||||
SyncMirrorFlagsToDefinitions();
|
||||
EvaluateAll();
|
||||
}
|
||||
|
||||
public IReadOnlyList<GlobalAchievementSO> GetDefinitions()
|
||||
{
|
||||
InitializeIfNeeded();
|
||||
return definitions;
|
||||
}
|
||||
|
||||
public List<GlobalAchievementSnapshot> GetSnapshots()
|
||||
{
|
||||
InitializeIfNeeded();
|
||||
var snapshots = new List<GlobalAchievementSnapshot>(definitions.Count);
|
||||
for (int i = 0; i < definitions.Count; i++)
|
||||
{
|
||||
GlobalAchievementSO definition = definitions[i];
|
||||
if (definition == null || definition.achievementId <= 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
GlobalAchievementStateEntry state = GetOrCreateState(definition.achievementId);
|
||||
float currentValue = GetMetric(definition.metricType);
|
||||
float targetValue = Mathf.Max(1f, definition.targetValue);
|
||||
snapshots.Add(new GlobalAchievementSnapshot
|
||||
{
|
||||
definition = definition,
|
||||
currentValue = currentValue,
|
||||
normalizedProgress = Mathf.Clamp01(currentValue / targetValue),
|
||||
unlocked = state.unlocked,
|
||||
unlockedUtc = state.unlockedUtcTicks > 0 ? new DateTime(state.unlockedUtcTicks, DateTimeKind.Utc) : default(DateTime),
|
||||
unlockedDateTimeText = state.unlockedUtcTicks > 0 ? new DateTime(state.unlockedUtcTicks, DateTimeKind.Utc).ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss") : string.Empty,
|
||||
});
|
||||
}
|
||||
|
||||
return snapshots;
|
||||
}
|
||||
|
||||
public float GetMetric(GlobalAchievementMetricType metricType)
|
||||
{
|
||||
InitializeIfNeeded();
|
||||
GlobalAchievementMetricEntry metric;
|
||||
if (metricByType.TryGetValue(metricType, out metric))
|
||||
{
|
||||
return Mathf.Max(0f, metric.value);
|
||||
}
|
||||
|
||||
return 0f;
|
||||
}
|
||||
|
||||
public void AddMetric(GlobalAchievementMetricType metricType, float delta)
|
||||
{
|
||||
if (Mathf.Approximately(delta, 0f))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
InitializeIfNeeded();
|
||||
GlobalAchievementMetricEntry metric = GetOrCreateMetric(metricType);
|
||||
float nextValue = Mathf.Max(0f, metric.value + delta);
|
||||
if (Mathf.Approximately(metric.value, nextValue))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
metric.value = nextValue;
|
||||
PersistMetricsIfChanged(true);
|
||||
}
|
||||
|
||||
public void SetMetric(GlobalAchievementMetricType metricType, float value)
|
||||
{
|
||||
InitializeIfNeeded();
|
||||
PersistMetricsIfChanged(SetMetricValue(metricType, value));
|
||||
}
|
||||
|
||||
public void SetMetricAtLeast(GlobalAchievementMetricType metricType, float value)
|
||||
{
|
||||
InitializeIfNeeded();
|
||||
GlobalAchievementMetricEntry metric = GetOrCreateMetric(metricType);
|
||||
float nextValue = Mathf.Max(0f, value);
|
||||
if (nextValue <= metric.value)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
metric.value = nextValue;
|
||||
PersistMetricsIfChanged(true);
|
||||
}
|
||||
|
||||
public void ReportLoginSessionStart()
|
||||
{
|
||||
InitializeIfNeeded();
|
||||
if (loginReportedThisSession)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
loginReportedThisSession = true;
|
||||
string currentDateStamp = DateTime.Now.ToString("yyyy-MM-dd");
|
||||
if (!string.IsNullOrEmpty(saveData.trustedDateStamp) && string.CompareOrdinal(currentDateStamp, saveData.trustedDateStamp) < 0)
|
||||
{
|
||||
currentDateStamp = saveData.trustedDateStamp;
|
||||
}
|
||||
else
|
||||
{
|
||||
saveData.trustedDateStamp = currentDateStamp;
|
||||
}
|
||||
|
||||
if (!string.Equals(saveData.lastLoginDateStamp, currentDateStamp, StringComparison.Ordinal))
|
||||
{
|
||||
saveData.lastLoginDateStamp = currentDateStamp;
|
||||
AddMetric(GlobalAchievementMetricType.LoginDays, 1f);
|
||||
return;
|
||||
}
|
||||
|
||||
SaveNow();
|
||||
}
|
||||
|
||||
public void ReportCurrentCoins(int currentCoins)
|
||||
{
|
||||
// No current-coin achievement type now, but this remains available as a central probe point
|
||||
// for future expansion without changing economy call sites.
|
||||
}
|
||||
|
||||
public void ReportCoinsEarned(int amount)
|
||||
{
|
||||
if (amount <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
AddMetric(GlobalAchievementMetricType.TotalCoinsEarned, amount);
|
||||
}
|
||||
|
||||
public void RefreshOwnedHeroCount()
|
||||
{
|
||||
InitializeIfNeeded();
|
||||
PersistMetricsIfChanged(RefreshOwnedHeroCountInternal(true));
|
||||
}
|
||||
|
||||
public void RefreshOwnedSongCountAndScores()
|
||||
{
|
||||
InitializeIfNeeded();
|
||||
PersistMetricsIfChanged(RefreshOwnedSongCountAndScoresInternal(true));
|
||||
}
|
||||
|
||||
public void RefreshDerivedMetrics()
|
||||
{
|
||||
InitializeIfNeeded();
|
||||
StoreOwnershipLedger.EnsureInstance().ForceSyncMirrorFlags();
|
||||
|
||||
bool changed = false;
|
||||
changed |= RefreshOwnedHeroCountInternal(false);
|
||||
changed |= RefreshOwnedSongCountAndScoresInternal(false);
|
||||
PersistMetricsIfChanged(changed);
|
||||
}
|
||||
|
||||
public void SaveNow()
|
||||
{
|
||||
if (!initialized || saveData == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (Application.isPlaying && lastSaveFrame == Time.frameCount)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
lastSaveFrame = Application.isPlaying ? Time.frameCount : -1;
|
||||
SecureSaveVault.SaveJson(SaveCategory, SaveKey, saveData);
|
||||
}
|
||||
|
||||
private void EvaluateAll()
|
||||
{
|
||||
for (int i = 0; i < definitions.Count; i++)
|
||||
{
|
||||
GlobalAchievementSO definition = definitions[i];
|
||||
if (definition == null || definition.achievementId <= 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
GlobalAchievementStateEntry state = GetOrCreateState(definition.achievementId);
|
||||
if (state.unlocked)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
float currentValue = GetMetric(definition.metricType);
|
||||
if (currentValue + 0.0001f < Mathf.Max(0f, definition.targetValue))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Unlock(definition, state);
|
||||
}
|
||||
|
||||
SyncMirrorFlagsToDefinitions();
|
||||
}
|
||||
|
||||
private bool RefreshOwnedHeroCountInternal(bool syncOwnershipFirst)
|
||||
{
|
||||
if (syncOwnershipFirst)
|
||||
{
|
||||
StoreOwnershipLedger.EnsureInstance().ForceSyncMirrorFlags();
|
||||
}
|
||||
|
||||
AllyHero_SO[] heroes = Resources.LoadAll<AllyHero_SO>("so/ally");
|
||||
if (heroes == null || heroes.Length == 0)
|
||||
{
|
||||
return SetMetricValue(GlobalAchievementMetricType.OwnedHeroCount, 0f);
|
||||
}
|
||||
|
||||
var uniqueIds = new HashSet<int>();
|
||||
int unlockedCount = 0;
|
||||
for (int i = 0; i < heroes.Length; i++)
|
||||
{
|
||||
AllyHero_SO hero = heroes[i];
|
||||
if (hero == null || hero.ally_heroID <= 0 || !uniqueIds.Add(hero.ally_heroID))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (hero.isUnlocked)
|
||||
{
|
||||
unlockedCount++;
|
||||
}
|
||||
}
|
||||
|
||||
return SetMetricValue(GlobalAchievementMetricType.OwnedHeroCount, unlockedCount);
|
||||
}
|
||||
|
||||
private bool RefreshOwnedSongCountAndScoresInternal(bool syncOwnershipFirst)
|
||||
{
|
||||
if (syncOwnershipFirst)
|
||||
{
|
||||
StoreOwnershipLedger.EnsureInstance().ForceSyncMirrorFlags();
|
||||
}
|
||||
|
||||
SongData[] songs = Resources.LoadAll<SongData>("song_songIndex");
|
||||
if (songs == null || songs.Length == 0)
|
||||
{
|
||||
bool emptyChanged = false;
|
||||
emptyChanged |= SetMetricValue(GlobalAchievementMetricType.OwnedSongCount, 0f);
|
||||
emptyChanged |= SetMetricValue(GlobalAchievementMetricType.BestSingleSongTotalScore, 0f);
|
||||
emptyChanged |= SetMetricValue(GlobalAchievementMetricType.TotalSongBestScoreSum, 0f);
|
||||
return emptyChanged;
|
||||
}
|
||||
|
||||
var uniqueIds = new HashSet<int>();
|
||||
int ownedSongCount = 0;
|
||||
int bestSingleSongScore = 0;
|
||||
long totalSongBestScore = 0L;
|
||||
|
||||
for (int i = 0; i < songs.Length; i++)
|
||||
{
|
||||
SongData song = songs[i];
|
||||
if (song == null || song.songID <= 0 || !uniqueIds.Add(song.songID))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
song.LoadPersistent();
|
||||
|
||||
if (song.isUnlocked)
|
||||
{
|
||||
ownedSongCount++;
|
||||
}
|
||||
|
||||
int highestScore;
|
||||
int bestDifficulty;
|
||||
string bestDifficultyName;
|
||||
song.GetAbsoluteHighestScore(out highestScore, out bestDifficulty, out bestDifficultyName);
|
||||
if (highestScore > bestSingleSongScore)
|
||||
{
|
||||
bestSingleSongScore = highestScore;
|
||||
}
|
||||
|
||||
totalSongBestScore += Mathf.Max(0, highestScore);
|
||||
}
|
||||
|
||||
bool changed = false;
|
||||
changed |= SetMetricValue(GlobalAchievementMetricType.OwnedSongCount, ownedSongCount);
|
||||
changed |= SetMetricValue(GlobalAchievementMetricType.BestSingleSongTotalScore, bestSingleSongScore);
|
||||
changed |= SetMetricValue(GlobalAchievementMetricType.TotalSongBestScoreSum, totalSongBestScore > float.MaxValue ? float.MaxValue : totalSongBestScore);
|
||||
return changed;
|
||||
}
|
||||
|
||||
private bool SetMetricValue(GlobalAchievementMetricType metricType, float value)
|
||||
{
|
||||
GlobalAchievementMetricEntry metric = GetOrCreateMetric(metricType);
|
||||
float nextValue = Mathf.Max(0f, value);
|
||||
if (Mathf.Approximately(metric.value, nextValue))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
metric.value = nextValue;
|
||||
return true;
|
||||
}
|
||||
|
||||
private void PersistMetricsIfChanged(bool changed)
|
||||
{
|
||||
if (!changed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
EvaluateAll();
|
||||
SaveNow();
|
||||
}
|
||||
|
||||
private void Unlock(GlobalAchievementSO definition, GlobalAchievementStateEntry state)
|
||||
{
|
||||
state.unlocked = true;
|
||||
state.unlockedUtcTicks = DateTime.UtcNow.Ticks;
|
||||
definition.SetUnlockedState(true, state.unlockedUtcTicks);
|
||||
GlobalAchievementSteamBridge.TryUnlock(definition);
|
||||
if (OnAchievementUnlocked != null)
|
||||
{
|
||||
OnAchievementUnlocked(definition);
|
||||
}
|
||||
}
|
||||
|
||||
private GlobalAchievementMetricEntry GetOrCreateMetric(GlobalAchievementMetricType metricType)
|
||||
{
|
||||
GlobalAchievementMetricEntry metric;
|
||||
if (metricByType.TryGetValue(metricType, out metric))
|
||||
{
|
||||
return metric;
|
||||
}
|
||||
|
||||
metric = new GlobalAchievementMetricEntry
|
||||
{
|
||||
metricType = metricType,
|
||||
value = 0f
|
||||
};
|
||||
metricByType.Add(metricType, metric);
|
||||
saveData.metrics.Add(metric);
|
||||
return metric;
|
||||
}
|
||||
|
||||
private GlobalAchievementStateEntry GetOrCreateState(int achievementId)
|
||||
{
|
||||
GlobalAchievementStateEntry state;
|
||||
if (stateById.TryGetValue(achievementId, out state))
|
||||
{
|
||||
return state;
|
||||
}
|
||||
|
||||
state = new GlobalAchievementStateEntry
|
||||
{
|
||||
achievementId = achievementId,
|
||||
unlocked = false,
|
||||
unlockedUtcTicks = 0L
|
||||
};
|
||||
stateById.Add(achievementId, state);
|
||||
saveData.states.Add(state);
|
||||
return state;
|
||||
}
|
||||
|
||||
private void RebuildCaches()
|
||||
{
|
||||
stateById.Clear();
|
||||
metricByType.Clear();
|
||||
|
||||
if (saveData.metrics == null)
|
||||
{
|
||||
saveData.metrics = new List<GlobalAchievementMetricEntry>();
|
||||
}
|
||||
|
||||
if (saveData.states == null)
|
||||
{
|
||||
saveData.states = new List<GlobalAchievementStateEntry>();
|
||||
}
|
||||
|
||||
for (int i = 0; i < saveData.metrics.Count; i++)
|
||||
{
|
||||
GlobalAchievementMetricEntry entry = saveData.metrics[i];
|
||||
if (entry == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
metricByType[entry.metricType] = entry;
|
||||
}
|
||||
|
||||
for (int i = 0; i < saveData.states.Count; i++)
|
||||
{
|
||||
GlobalAchievementStateEntry entry = saveData.states[i];
|
||||
if (entry == null || entry.achievementId <= 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
stateById[entry.achievementId] = entry;
|
||||
}
|
||||
}
|
||||
|
||||
private static int CompareDefinitions(GlobalAchievementSO left, GlobalAchievementSO right)
|
||||
{
|
||||
if (left == null && right == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (left == null)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (right == null)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int seriesCompare = string.CompareOrdinal(left.achievementSeriesKey, right.achievementSeriesKey);
|
||||
if (seriesCompare != 0)
|
||||
{
|
||||
return seriesCompare;
|
||||
}
|
||||
|
||||
int levelCompare = left.achievementLevel.CompareTo(right.achievementLevel);
|
||||
if (levelCompare != 0)
|
||||
{
|
||||
return levelCompare;
|
||||
}
|
||||
|
||||
int sortCompare = left.sortOrder.CompareTo(right.sortOrder);
|
||||
if (sortCompare != 0)
|
||||
{
|
||||
return sortCompare;
|
||||
}
|
||||
|
||||
int metricCompare = left.metricType.CompareTo(right.metricType);
|
||||
if (metricCompare != 0)
|
||||
{
|
||||
return metricCompare;
|
||||
}
|
||||
|
||||
int targetCompare = left.targetValue.CompareTo(right.targetValue);
|
||||
if (targetCompare != 0)
|
||||
{
|
||||
return targetCompare;
|
||||
}
|
||||
|
||||
return left.achievementId.CompareTo(right.achievementId);
|
||||
}
|
||||
|
||||
private void SyncMirrorFlagsToDefinitions()
|
||||
{
|
||||
for (int i = 0; i < definitions.Count; i++)
|
||||
{
|
||||
GlobalAchievementSO definition = definitions[i];
|
||||
if (definition == null || definition.achievementId <= 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
GlobalAchievementStateEntry state;
|
||||
bool unlocked = stateById.TryGetValue(definition.achievementId, out state) && state != null && state.unlocked;
|
||||
definition.SetUnlockedState(unlocked, unlocked && state != null ? state.unlockedUtcTicks : 0L);
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a2d505205caa8e044a45b0e2f9742128
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
#if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX)
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
using Steamworks;
|
||||
#endif
|
||||
|
||||
public static class GlobalAchievementSteamBridge
|
||||
{
|
||||
public static bool TryUnlock(GlobalAchievementSO definition)
|
||||
{
|
||||
if (definition == null || !definition.syncWithSteam || string.IsNullOrWhiteSpace(definition.steamAchievementApiName))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
if (!SteamManager.Initialized)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool success = SteamUserStats.SetAchievement(definition.steamAchievementApiName);
|
||||
if (success)
|
||||
{
|
||||
SteamUserStats.StoreStats();
|
||||
}
|
||||
|
||||
return success;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bf76c26d20df2d74b962e90d0718e503
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f434937296e6d7d4a8b4d68734976ec1
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d01a922a7463b36418c80900c9ef668d
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+1
@@ -0,0 +1 @@
|
||||
Deprecated. Place GlobalAchievementSO assets in Assets/Resources/so/globalachievments instead.
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7f049e141d4f4444a9e650c5f9bbe2ea
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,217 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
public class uAchievementDisplayController : MonoBehaviour
|
||||
{
|
||||
[Header("prefabs")]
|
||||
public GameObject uAchievePrefab;
|
||||
public Transform contentParent;
|
||||
|
||||
[Header("sprite list")]
|
||||
public Sprite[] achievementSprites;
|
||||
|
||||
[Header("global achievement")]
|
||||
public bool initializeGlobalAchievementServiceOnEnable = true;
|
||||
public string runtimeResourcesPath = GlobalAchievementService.DefaultResourcesPath;
|
||||
public string editorAssetFolder = GlobalAchievementService.DefaultEditorAssetFolder;
|
||||
public List<GlobalAchievementSO> scannedGlobalAchievements = new List<GlobalAchievementSO>();
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
if (initializeGlobalAchievementServiceOnEnable)
|
||||
{
|
||||
GlobalAchievementService.EnsureInstance().LoadDefinitionsFromResources(runtimeResourcesPath);
|
||||
}
|
||||
|
||||
if (Application.isPlaying)
|
||||
{
|
||||
RefreshAchievementInstances();
|
||||
}
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
private void OnValidate()
|
||||
{
|
||||
if (Application.isPlaying)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ScanGlobalAchievementsInEditor();
|
||||
}
|
||||
#endif
|
||||
|
||||
public List<GlobalAchievementSnapshot> GetGlobalAchievementSnapshots()
|
||||
{
|
||||
return GlobalAchievementService.EnsureInstance().GetSnapshots();
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
if (Application.isPlaying)
|
||||
{
|
||||
RefreshAchievementInstances();
|
||||
}
|
||||
}
|
||||
|
||||
[ContextMenu("Scan Global Achievements")]
|
||||
public void ScanGlobalAchievements()
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
if (!Application.isPlaying)
|
||||
{
|
||||
ScanGlobalAchievementsInEditor();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
scannedGlobalAchievements.Clear();
|
||||
GlobalAchievementSO[] loaded = Resources.LoadAll<GlobalAchievementSO>(runtimeResourcesPath);
|
||||
if (loaded == null || loaded.Length == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
scannedGlobalAchievements.AddRange(loaded);
|
||||
}
|
||||
|
||||
public void RefreshAchievementInstances()
|
||||
{
|
||||
if (uAchievePrefab == null || contentParent == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ClearAchievementInstances();
|
||||
|
||||
List<GlobalAchievementSnapshot> snapshots = GetGlobalAchievementSnapshots();
|
||||
List<GlobalAchievementSnapshot> displaySnapshots = BuildHighestUnlockedSnapshotsPerSeries(snapshots);
|
||||
displaySnapshots.Sort(CompareSnapshots);
|
||||
for (int i = 0; i < displaySnapshots.Count; i++)
|
||||
{
|
||||
GlobalAchievementSnapshot snapshot = displaySnapshots[i];
|
||||
if (!snapshot.unlocked || snapshot.definition == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
GameObject instance = Instantiate(uAchievePrefab, contentParent);
|
||||
uAchievementPrefab controller = instance.GetComponent<uAchievementPrefab>();
|
||||
if (controller == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
controller.Setup(snapshot, GetBottomSprite(snapshot.definition.achievementLevel));
|
||||
}
|
||||
}
|
||||
|
||||
private static List<GlobalAchievementSnapshot> BuildHighestUnlockedSnapshotsPerSeries(List<GlobalAchievementSnapshot> snapshots)
|
||||
{
|
||||
var result = new List<GlobalAchievementSnapshot>();
|
||||
var bestBySeries = new Dictionary<string, GlobalAchievementSnapshot>();
|
||||
|
||||
for (int i = 0; i < snapshots.Count; i++)
|
||||
{
|
||||
GlobalAchievementSnapshot snapshot = snapshots[i];
|
||||
if (!snapshot.unlocked || snapshot.definition == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
string seriesKey = !string.IsNullOrWhiteSpace(snapshot.definition.achievementSeriesKey)
|
||||
? snapshot.definition.achievementSeriesKey
|
||||
: snapshot.definition.metricType.ToString();
|
||||
|
||||
GlobalAchievementSnapshot currentBest;
|
||||
if (!bestBySeries.TryGetValue(seriesKey, out currentBest))
|
||||
{
|
||||
bestBySeries[seriesKey] = snapshot;
|
||||
continue;
|
||||
}
|
||||
|
||||
int levelCompare = snapshot.definition.achievementLevel.CompareTo(currentBest.definition.achievementLevel);
|
||||
if (levelCompare > 0)
|
||||
{
|
||||
bestBySeries[seriesKey] = snapshot;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (levelCompare == 0 && snapshot.unlockedUtc < currentBest.unlockedUtc)
|
||||
{
|
||||
bestBySeries[seriesKey] = snapshot;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var pair in bestBySeries)
|
||||
{
|
||||
result.Add(pair.Value);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private void ClearAchievementInstances()
|
||||
{
|
||||
for (int i = contentParent.childCount - 1; i >= 0; i--)
|
||||
{
|
||||
Transform child = contentParent.GetChild(i);
|
||||
if (Application.isPlaying)
|
||||
{
|
||||
Destroy(child.gameObject);
|
||||
}
|
||||
else
|
||||
{
|
||||
DestroyImmediate(child.gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Sprite GetBottomSprite(int level)
|
||||
{
|
||||
if (achievementSprites == null || achievementSprites.Length == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int safeIndex = Mathf.Clamp(level, 0, achievementSprites.Length - 1);
|
||||
return achievementSprites[safeIndex];
|
||||
}
|
||||
|
||||
private static int CompareSnapshots(GlobalAchievementSnapshot left, GlobalAchievementSnapshot right)
|
||||
{
|
||||
int levelCompare = right.definition.achievementLevel.CompareTo(left.definition.achievementLevel);
|
||||
if (levelCompare != 0)
|
||||
{
|
||||
return levelCompare;
|
||||
}
|
||||
|
||||
return left.unlockedUtc.CompareTo(right.unlockedUtc);
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
private void ScanGlobalAchievementsInEditor()
|
||||
{
|
||||
scannedGlobalAchievements.Clear();
|
||||
if (string.IsNullOrWhiteSpace(editorAssetFolder))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
string[] guids = AssetDatabase.FindAssets("t:GlobalAchievementSO", new[] { editorAssetFolder });
|
||||
for (int i = 0; i < guids.Length; i++)
|
||||
{
|
||||
string assetPath = AssetDatabase.GUIDToAssetPath(guids[i]);
|
||||
GlobalAchievementSO definition = AssetDatabase.LoadAssetAtPath<GlobalAchievementSO>(assetPath);
|
||||
if (definition != null)
|
||||
{
|
||||
scannedGlobalAchievements.Add(definition);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 987b38d0b9b55094a812dc91a025b9ec
|
||||
@@ -0,0 +1,48 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class uAchievementPrefab : MonoBehaviour
|
||||
{
|
||||
[Header("infos")]
|
||||
public Image aBottomImage;
|
||||
public Image aIcon;
|
||||
public Text aName;
|
||||
public Text aGetDate;
|
||||
public Text aDescription;
|
||||
|
||||
public void Setup(GlobalAchievementSnapshot snapshot, Sprite bottomSprite)
|
||||
{
|
||||
GlobalAchievementSO definition = snapshot.definition;
|
||||
if (definition == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (aName != null)
|
||||
{
|
||||
aName.text = definition.displayName;
|
||||
}
|
||||
|
||||
if (aGetDate != null)
|
||||
{
|
||||
aGetDate.text = snapshot.unlockedDateTimeText;
|
||||
}
|
||||
|
||||
if (aDescription != null)
|
||||
{
|
||||
aDescription.text = definition.description;
|
||||
}
|
||||
|
||||
if (aIcon != null)
|
||||
{
|
||||
aIcon.sprite = definition.icon;
|
||||
aIcon.enabled = definition.icon != null;
|
||||
}
|
||||
|
||||
if (aBottomImage != null)
|
||||
{
|
||||
aBottomImage.sprite = bottomSprite;
|
||||
aBottomImage.enabled = bottomSprite != null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d89a2975d23b4e34b9a47d7d51cc583f
|
||||
@@ -0,0 +1,613 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &1549067601785280663
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1807029293904587218}
|
||||
- component: {fileID: 8601725193883887585}
|
||||
- component: {fileID: 7760466027318539489}
|
||||
m_Layer: 5
|
||||
m_Name: mskimg
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1807029293904587218
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1549067601785280663}
|
||||
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: 4286190042205812935}
|
||||
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: 220, y: 51}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &8601725193883887585
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1549067601785280663}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &7760466027318539489
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1549067601785280663}
|
||||
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: 21300000, guid: 4f084763b23303b4783af7665db60a33, 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 &2057447381607439721
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6945428158373363852}
|
||||
- component: {fileID: 6954052181346252657}
|
||||
- component: {fileID: 1893507208843142754}
|
||||
m_Layer: 5
|
||||
m_Name: des
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &6945428158373363852
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2057447381607439721}
|
||||
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: 452491335617731858}
|
||||
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: 17, y: -13.212}
|
||||
m_SizeDelta: {x: 130.172, y: 13.576}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &6954052181346252657
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2057447381607439721}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &1893507208843142754
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2057447381607439721}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, 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_FontData:
|
||||
m_Font: {fileID: 12800000, guid: bc54bd51ea8b84448ba1b65311872862, type: 3}
|
||||
m_FontSize: 13
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 1
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 3
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 1
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: "\u7B80\u4ECB\u6700\u591A\u4E5F\u5C31\u5341\u4E2A\u5B57\u6574"
|
||||
--- !u!1 &3853073308254161695
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6155334586977510247}
|
||||
- component: {fileID: 4151510886845045432}
|
||||
m_Layer: 5
|
||||
m_Name: uAchievementPrefab
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &6155334586977510247
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3853073308254161695}
|
||||
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: 452491335617731858}
|
||||
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: 205, y: 55}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &4151510886845045432
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3853073308254161695}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d89a2975d23b4e34b9a47d7d51cc583f, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
aBottomImage: {fileID: 7760466027318539489}
|
||||
aIcon: {fileID: 408771293922604001}
|
||||
aName: {fileID: 6612220277252403227}
|
||||
aGetDate: {fileID: 8035948722274830026}
|
||||
aDescription: {fileID: 1893507208843142754}
|
||||
--- !u!1 &4178773801772122773
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1685732796308453693}
|
||||
- component: {fileID: 2917781354974279582}
|
||||
- component: {fileID: 6612220277252403227}
|
||||
m_Layer: 5
|
||||
m_Name: title
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1685732796308453693
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4178773801772122773}
|
||||
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: 452491335617731858}
|
||||
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: 17, y: 11.528}
|
||||
m_SizeDelta: {x: 130.172, y: 16.944}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2917781354974279582
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4178773801772122773}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &6612220277252403227
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4178773801772122773}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, 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_FontData:
|
||||
m_Font: {fileID: 12800000, guid: dfa10de3e2846524089b5073175cd151, type: 3}
|
||||
m_FontSize: 16
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 1
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 0
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 1
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: "\u6210\u5C31\u540D\u5B57\u6700\u591A\u516B\u5B57"
|
||||
--- !u!1 &4442388964663260224
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 9126304612977524600}
|
||||
- component: {fileID: 3597828589541724163}
|
||||
- component: {fileID: 408771293922604001}
|
||||
m_Layer: 5
|
||||
m_Name: prof
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &9126304612977524600
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4442388964663260224}
|
||||
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: 452491335617731858}
|
||||
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: -74.9, y: 0}
|
||||
m_SizeDelta: {x: 40, y: 40}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &3597828589541724163
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4442388964663260224}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &408771293922604001
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4442388964663260224}
|
||||
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: 21300000, guid: 1a075b65c796bfc4aa14b8e5b412d38a, 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 &6911097261879657878
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 452491335617731858}
|
||||
- component: {fileID: 9016916423687245873}
|
||||
- component: {fileID: 661185216835996425}
|
||||
m_Layer: 5
|
||||
m_Name: boarder
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &452491335617731858
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6911097261879657878}
|
||||
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: 4286190042205812935}
|
||||
- {fileID: 9126304612977524600}
|
||||
- {fileID: 1685732796308453693}
|
||||
- {fileID: 3458573061627051884}
|
||||
- {fileID: 6945428158373363852}
|
||||
m_Father: {fileID: 6155334586977510247}
|
||||
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: 205, y: 55}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &9016916423687245873
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6911097261879657878}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &661185216835996425
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6911097261879657878}
|
||||
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!1 &8456038322340636303
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4286190042205812935}
|
||||
- component: {fileID: 7137554977806279391}
|
||||
- component: {fileID: 9201936408420364057}
|
||||
- component: {fileID: 6566656222579036843}
|
||||
m_Layer: 5
|
||||
m_Name: btm
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &4286190042205812935
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8456038322340636303}
|
||||
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: 1807029293904587218}
|
||||
m_Father: {fileID: 452491335617731858}
|
||||
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: 200, y: 50}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7137554977806279391
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8456038322340636303}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &9201936408420364057
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8456038322340636303}
|
||||
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!114 &6566656222579036843
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8456038322340636303}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_ShowMaskGraphic: 1
|
||||
--- !u!1 &8804789641353309784
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 3458573061627051884}
|
||||
- component: {fileID: 7917957300619336252}
|
||||
- component: {fileID: 8035948722274830026}
|
||||
m_Layer: 5
|
||||
m_Name: date
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &3458573061627051884
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8804789641353309784}
|
||||
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: 452491335617731858}
|
||||
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: 17, y: -6.3760014}
|
||||
m_SizeDelta: {x: 130.172, y: 18.864}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7917957300619336252
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8804789641353309784}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &8035948722274830026
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8804789641353309784}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, 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_FontData:
|
||||
m_Font: {fileID: 12800000, guid: bc54bd51ea8b84448ba1b65311872862, type: 3}
|
||||
m_FontSize: 10
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 1
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 0
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 1
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: '2026-03-11 20: 20'
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c42cf5fea198c5c408a5c7a8f17809b0
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user