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

8
Src/AI.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e0dca4188e0035d4daa067afab73b7a0
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Src/Loot.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 88b3a36957ed97f43b8deada786c6e23
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

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:

8
Src/Npc.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6df2dc75acc724d49a83cee78cc7a7e1
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,11 @@
using System.Collections;
using System.Collections.Generic;
namespace Net.Project.B.AI
{
public interface INpcSpawnService
{
public int MaxNpcCount { get; set; }
}
}

View File

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

View File

@ -0,0 +1,11 @@
using System.Collections;
using System.Collections.Generic;
namespace Net.Project.B.AI
{
public interface IScriptableNpcSpawn
{
IReadOnlyDictionary<string, int> NpcWeights { get; }
}
}

View File

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

View File

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

View File

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

View File

@ -6,7 +6,8 @@
"GUID:d750d221812bb1d48baff92e6ef73e28",
"GUID:49b49c76ee64f6b41bf28ef951cb0e50",
"GUID:f51ebe6a0ceec4240a699833d6309b23",
"GUID:e527b3ce3106f974585be5134b6200e9"
"GUID:e527b3ce3106f974585be5134b6200e9",
"GUID:e18d548755c9bc8458ca189e16813742"
],
"includePlatforms": [],
"excludePlatforms": [],

View File

@ -0,0 +1,19 @@
using System;
using System.Collections;
using System.Collections.Generic;
using BITKit;
using BITKit.WorldNode;
using UnityEngine;
namespace Net.Project.B.WorldNode
{
[Serializable]
public class UnityLootNode : IWorldNode
{
#if UNITY_5_3_OR_NEWER
[SerializeReference, SubclassSelector] private IReference lootName;
public string LootName=> lootName?.Value;
#endif
}
}

View File

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

View File

@ -0,0 +1,18 @@
using System;
using System.Collections;
using System.Collections.Generic;
using BITKit.WorldNode;
using UnityEngine;
namespace Net.Project.B.WorldNode
{
[Serializable]
public class UnityNpcSpawnAreaNode : IWorldNode
{
public float spawnRadius = 20f; // 刷怪区域半径
public int maxSpawnPoints = 10; // 最大刷怪点数量
public float minDistanceBetweenSpawns = 5f; // 最小刷怪点间距
public float clearanceCheckDistance = 3f; // 空旷度检测半径
}
}

View File

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