forked from Shardstone/trail-into-darkness
updated linq calls to zero allocation zlinq
This commit is contained in:
@@ -3,7 +3,7 @@ using Jovian.ZoneSystem;
|
||||
using Nox.Core;
|
||||
using Nox.Platform;
|
||||
using Nox.Game.UI;
|
||||
using System.Linq;
|
||||
using ZLinq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
using PlayMode = Nox.Core.PlayMode;
|
||||
@@ -65,7 +65,7 @@ namespace Nox.Game {
|
||||
partyMovementHandler.ConsumeNextClick();
|
||||
return;
|
||||
}
|
||||
Addressables.LoadSceneAsync(bootstrapSettings.gameModeData.FirstOrDefault(g => g.playMode == PlayMode.Adventure)?.scene)
|
||||
Addressables.LoadSceneAsync(bootstrapSettings.gameModeData.AsValueEnumerable().FirstOrDefault(g => g.playMode == PlayMode.Adventure)?.scene)
|
||||
.WaitForCompletion().ActivateAsync().completed += InitializeGameMode;
|
||||
}
|
||||
|
||||
@@ -74,13 +74,13 @@ namespace Nox.Game {
|
||||
inputActions.UI.PauseMenu.Enable();
|
||||
Debug.Log("Entering Adventure Play Mode");
|
||||
if(partyDefinition == null) {
|
||||
var sessions = saveSystem.GetAllSessions().OrderByDescending(s => s.lastSaveDateUtc).ToList();
|
||||
var sessions = saveSystem.GetAllSessions().AsValueEnumerable().OrderByDescending(s => s.lastSaveDateUtc).ToList();
|
||||
if(sessions.Count == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var latestSession = sessions[0];
|
||||
var slots = saveSystem.GetSlots(latestSession.sessionId).OrderByDescending(s => s.timestampUtc).ToList();
|
||||
var slots = saveSystem.GetSlots(latestSession.sessionId).AsValueEnumerable().OrderByDescending(s => s.timestampUtc).ToList();
|
||||
if(slots.Count == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user