This commit is contained in:
CortexCore
2025-03-04 16:34:31 +08:00
parent 4402ae533b
commit d6e6888bb7
18 changed files with 230 additions and 1 deletions

40
Src/Loot/ILootService.cs Normal file
View File

@@ -0,0 +1,40 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Cysharp.Threading.Tasks;
namespace Net.Project.B.Loot
{
/// <summary>
/// 可配置战利品
/// </summary>
public interface IScriptableLoot
{
public int Id { get; }
/// <summary>
/// 种子
/// </summary>
public int Seed { get; }
/// <summary>
/// 名称
/// </summary>
public string Name { get; }
/// <summary>
/// 物品和权重
/// </summary>
public IReadOnlyDictionary<int, int> ItemWeights { get; }
/// <summary>
/// 类型
/// </summary>
public IWorldLootType LootType { get; }
}
public interface IWorldLootType{}
public interface ILootService
{
public UniTask<IReadOnlyDictionary<int,int>> GetLoot(IWorldLootType type);
}
[Serializable]
public struct WorldContainerLoot:IWorldLootType{}
[Serializable]
public struct WorldItemLoot:IWorldLootType{}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: befc1e67d73162342acfab5e34e6a4ae
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,18 @@
{
"name": "Net.Project.B.Loot",
"rootNamespace": "",
"references": [
"GUID:14fe60d984bf9f84eac55c6ea033a8f4",
"GUID:d8b63aba1907145bea998dd612889d6b",
"GUID:f51ebe6a0ceec4240a699833d6309b23"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": true
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: e18d548755c9bc8458ca189e16813742
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: