G1-01 + G1-02

This commit is contained in:
SepComet
2026-03-12 13:20:02 +08:00
parent 1c45205e92
commit 99ed963faa
24 changed files with 424 additions and 32 deletions
@@ -5,6 +5,7 @@ using System;
using GeometryTD.CustomEvent;
using GeometryTD.CustomUtility;
using GeometryTD.Definition;
using GeometryTD.Factory;
using GeometryTD.UI;
using UnityGameFramework.Runtime;
@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using GeometryTD.CustomUtility;
using GeometryTD.Definition;
using GeometryTD.Factory;
namespace GeometryTD.Procedure
{
@@ -1,58 +0,0 @@
using System.Collections.Generic;
using GeometryTD.Definition;
namespace GeometryTD.Procedure
{
public static class RunStateFactory
{
public static RunState CreateFixedRun(
LevelThemeType themeType,
BackpackInventoryData initialInventorySnapshot,
string runId = null,
int runSeed = 0)
{
IReadOnlyList<RunNodeSeed> fixedNodeSeeds = FixedRunNodeSequenceBuilder.Build(themeType);
return Create(themeType, initialInventorySnapshot, fixedNodeSeeds, runId, runSeed);
}
public static RunState Create(
LevelThemeType themeType,
BackpackInventoryData initialInventorySnapshot,
IEnumerable<RunNodeSeed> nodeSeeds,
string runId = null,
int runSeed = 0)
{
List<RunNodeState> nodes = new List<RunNodeState>();
if (nodeSeeds != null)
{
int sequenceIndex = 0;
foreach (RunNodeSeed seed in nodeSeeds)
{
if (seed == null)
{
continue;
}
nodes.Add(new RunNodeState
{
NodeId = seed.NodeId > 0 ? seed.NodeId : sequenceIndex + 1,
NodeType = seed.NodeType,
ThemeType = seed.ThemeType == LevelThemeType.None ? themeType : seed.ThemeType,
LinkedLevelId = seed.LinkedLevelId,
SequenceIndex = seed.SequenceIndex >= 0 ? seed.SequenceIndex : sequenceIndex,
Status = sequenceIndex == 0 ? RunNodeStatus.Available : RunNodeStatus.Locked
});
sequenceIndex++;
}
}
return new RunState(runId, runSeed, themeType, nodes, initialInventorySnapshot);
}
public static int CreateRunSeed()
{
int seed = System.Guid.NewGuid().GetHashCode();
return seed == 0 ? 1 : seed;
}
}
}
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 9b14d5010eb149678d2f4b269d6b8401
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: