Merge pull request 'refactor-assembly' (#1) from refactor-assembly into GPU-Instancing

Reviewed-on: #1
This commit is contained in:
SepComet 2026-06-04 22:25:23 +08:00
commit 117dd123de
1112 changed files with 86663 additions and 5258 deletions

View File

@ -22,7 +22,10 @@ namespace UnityGameFramework.Editor
"UnityGameFramework.Runtime",
#endif
"Assembly-CSharp",
"VampireLike"
"VampireLike",
"SepCore.Base",
"SepCore.Runtime",
"SepCore.Procedure"
};
private static readonly string[] RuntimeOrEditorAssemblyNames =
@ -36,7 +39,11 @@ namespace UnityGameFramework.Editor
#endif
"Assembly-CSharp-Editor",
"VampireLike",
"VampireLike.Editor"
"VampireLike.Editor",
"SepCore.Base",
"SepCore.Runtime",
"SepCore.Procedure",
"SepCore.Editor"
};
/// <summary>

View File

@ -4,7 +4,7 @@ MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
executionOrder: -20
icon: {instanceID: 0}
userData:
assetBundleName:

View File

@ -13,7 +13,6 @@ using UnityEngine.Networking;
#else
using UnityEngine.Experimental.Networking;
#endif
using Utility = GameFramework.Utility;
namespace UnityGameFramework.Runtime
{

View File

@ -14,7 +14,6 @@ using UnityEngine;
using UnityEngine.Networking;
#endif
using UnityEngine.SceneManagement;
using Utility = GameFramework.Utility;
namespace UnityGameFramework.Runtime
{

View File

@ -13,7 +13,6 @@ using UnityEngine.Networking;
#else
using UnityEngine.Experimental.Networking;
#endif
using Utility = GameFramework.Utility;
namespace UnityGameFramework.Runtime
{

View File

@ -3,7 +3,7 @@
<ResourceBuilder>
<Settings>
<InternalResourceVersion>1</InternalResourceVersion>
<Platforms>1</Platforms>
<Platforms>33</Platforms>
<AssetBundleCompression>1</AssetBundleCompression>
<CompressionHelperTypeName>UnityGameFramework.Runtime.DefaultCompressionHelper</CompressionHelperTypeName>
<AdditionalCompressionSelected>False</AdditionalCompressionSelected>

View File

@ -0,0 +1,529 @@
#if UNITY_EDITOR || DEVELOPMENT_BUILD
using System;
using System.Linq;
using SepCore.Event;
using SepCore.DataTable;
using SepCore.Definition;
using SepCore.Entity;
using SepCore.Components;
using SepCore.CustomUtility;
using SepCore.Simulation;
using SepCore.EnemyManager;
using SepCore.Procedure;
using UnityEngine;
using UnityGameFramework.Runtime;
#if ENABLE_INPUT_SYSTEM
using UnityEngine.InputSystem;
#endif
public class RuntimeDebugPanelComponent : MonoBehaviour
{
private const float MinSpawnRate = 0.1f;
private const float CornerTapWindow = 0.6f;
private const int RequiredCornerTapCount = 3;
private const int DebugHealAmount = 200;
[Header("Window Content")] [SerializeField]
private bool _showBuffSection = true;
[SerializeField] private bool _showBattleOverview = true;
[SerializeField] private bool _showCollisionStats = true;
[SerializeField] private bool _showSpawnControls = true;
[SerializeField] private bool _showBattleDurationControls = true;
[SerializeField] private bool _showPlayerWeaponControls = true;
[SerializeField] private bool _showPlayerHealthControls = true;
[SerializeField] private bool _showTips = true;
private Rect _windowRect = new Rect(20f, 60f, 460f, 800f);
private bool _isPanelVisible;
private int _windowId;
private string _searchText = string.Empty;
private int _selectedIndex;
private int _addCount = 1;
private Vector2 _buffScroll;
private float _spawnRateScaleInput = 1f;
private float _extendDurationSeconds = 30f;
private DRProp[] _allProps = Array.Empty<DRProp>();
private DRProp[] _filteredProps = Array.Empty<DRProp>();
private string[] _displayNames = Array.Empty<string>();
private int _cornerTapCount;
private float _lastCornerTapTime = -10f;
private bool _lockPlayerHealthToMax;
private void Awake()
{
_windowId = GetInstanceID();
}
private void Update()
{
if (IsTogglePressed())
{
_isPanelVisible = !_isPanelVisible;
}
HandleCornerTapGesture();
if (_lockPlayerHealthToMax)
{
KeepPlayerHealthAtMax();
}
}
private void OnGUI()
{
DrawToggleButton();
if (!_isPanelVisible) return;
_windowRect = GUI.Window(_windowId, _windowRect, DrawWindow, "Runtime Debug Panel");
}
private void DrawToggleButton()
{
const float width = 64f;
const float height = 30f;
Rect buttonRect = new Rect(Screen.width - width - 12f, 10f, width, height);
if (GUI.Button(buttonRect, "DEBUG"))
{
_isPanelVisible = !_isPanelVisible;
}
}
private void DrawWindow(int windowId)
{
if (_showBuffSection)
{
EnsurePropList();
}
GUILayout.BeginVertical();
bool hasPreviousSection = false;
if (_showBuffSection)
{
DrawBuffSection();
hasPreviousSection = true;
}
if (HasVisibleBattleSection())
{
if (hasPreviousSection)
{
GUILayout.Space(8f);
GUILayout.Label(string.Empty, GUI.skin.horizontalSlider);
GUILayout.Space(8f);
}
DrawBattleSection();
hasPreviousSection = true;
}
if (_showTips)
{
if (hasPreviousSection)
{
GUILayout.Space(8f);
}
GUILayout.Label("Tips: press `F8` or tap top-left corner 3 times to toggle.", GUILayout.Height(20f));
}
GUILayout.EndVertical();
GUI.DragWindow(new Rect(0, 0, 10000, 22));
}
private void DrawBuffSection()
{
GUILayout.Label("Buff Debug");
GUILayout.BeginHorizontal();
GUILayout.Label("Search", GUILayout.Width(52f));
_searchText = GUILayout.TextField(_searchText);
if (GUILayout.Button("Refresh", GUILayout.Width(80f)))
{
EnsurePropList(true);
}
GUILayout.EndHorizontal();
ApplyFilter(_searchText);
if (_displayNames.Length == 0)
{
GUILayout.Label("No Buff data. Enter battle and try again.");
return;
}
_selectedIndex = Mathf.Clamp(_selectedIndex, 0, _displayNames.Length - 1);
_buffScroll = GUILayout.BeginScrollView(_buffScroll, GUILayout.Height(120f));
_selectedIndex = GUILayout.SelectionGrid(_selectedIndex, _displayNames, 1);
GUILayout.EndScrollView();
DRProp selectedProp = GetSelectedProp();
if (selectedProp == null) return;
GUILayout.Label($"Selected: {selectedProp.Title} ({selectedProp.Rarity})");
GUILayout.Label(ItemDescUtility.CreatePropDescription(selectedProp.Modifiers), GUILayout.Height(40f));
GUILayout.BeginHorizontal();
GUILayout.Label("Count", GUILayout.Width(52f));
string addCountText = GUILayout.TextField(_addCount.ToString(), GUILayout.Width(60f));
if (!int.TryParse(addCountText, out _addCount)) _addCount = 1;
_addCount = Mathf.Clamp(_addCount, 1, 99);
if (GUILayout.Button("Add Buff To Player", GUILayout.Height(24f)))
{
AddSelectedBuffToPlayer(selectedProp, _addCount);
}
GUILayout.EndHorizontal();
}
private void DrawBattleSection()
{
GUILayout.Label("Battle Debug");
ProcedureGame procedure = GameEntry.Procedure.CurrentProcedure as ProcedureGame;
EnemyManagerComponent enemyManager = GameEntry.EnemyManager;
Player player = FindPlayer();
HealthComponent playerHealth = player != null ? player.GetComponent<HealthComponent>() : null;
if (enemyManager == null)
{
GUILayout.Label("EnemyManager unavailable.");
return;
}
if (procedure == null)
{
GUILayout.Label("ProcedureGame unavailable.");
return;
}
if (_showBattleOverview)
{
GUILayout.Label($"Spawn Rate: {enemyManager.SpawnRateScale:F2}");
GUILayout.Label(
$"Battle Time: {enemyManager.ElapsedBattleTime:F1}s / {enemyManager.BattleDuration:F1}s");
GUILayout.Label($"Enemy Count: {enemyManager.CurrentEnemyCount}");
}
SimulationWorld simulationWorld = GameEntry.SimulationWorld;
if (_showCollisionStats && simulationWorld != null)
{
GUILayout.Space(4f);
GUILayout.Label(
$"Collision Queries: total {simulationWorld.LastCollisionQueryCount} (Projectile {simulationWorld.LastProjectileCollisionQueryCount} / Area {simulationWorld.LastAreaCollisionQueryCount})");
GUILayout.Label(
$"Collision Candidates: total {simulationWorld.LastCollisionCandidateCount} (Projectile {simulationWorld.LastProjectileCollisionCandidateCount} / Area {simulationWorld.LastAreaCollisionCandidateCount})");
GUILayout.Label(
$"Area Resolve: hits {simulationWorld.LastResolvedAreaHitCount}");
GUILayout.Label(
$"Broad Phase: cell {simulationWorld.LastCollisionCellSize:F2}, hasEnemyTargets {(simulationWorld.LastCollisionHasEnemyTargets ? "Yes" : "No")}");
if (simulationWorld.LastCollisionCandidateCount != 0)
{
Log.Info($"LastCollisionCandidateCount:{simulationWorld.LastCollisionCandidateCount}");
}
if (simulationWorld.LastResolvedAreaHitCount != 0)
{
Log.Info($"LastResolvedAreaHitCount:{simulationWorld.LastResolvedAreaHitCount}");
}
}
if (_showSpawnControls)
{
GUILayout.BeginHorizontal();
GUILayout.Label("Rate", GUILayout.Width(52f));
string rateText = GUILayout.TextField(_spawnRateScaleInput.ToString("F2"), GUILayout.Width(60f));
if (float.TryParse(rateText, out float parsedRate))
{
_spawnRateScaleInput = Mathf.Clamp(parsedRate, MinSpawnRate, 50f);
}
if (GUILayout.Button("Apply", GUILayout.Width(70f)))
{
enemyManager.SetSpawnRateScale(_spawnRateScaleInput);
}
if (GUILayout.Button("x0.5", GUILayout.Width(60f)))
{
_spawnRateScaleInput = Mathf.Max(MinSpawnRate, enemyManager.SpawnRateScale * 0.5f);
enemyManager.SetSpawnRateScale(_spawnRateScaleInput);
}
if (GUILayout.Button("x2", GUILayout.Width(60f)))
{
_spawnRateScaleInput = enemyManager.SpawnRateScale * 2f;
enemyManager.SetSpawnRateScale(_spawnRateScaleInput);
}
GUILayout.EndHorizontal();
}
if (_showBattleDurationControls)
{
GUILayout.BeginHorizontal();
GUILayout.Label("Add Sec", GUILayout.Width(52f));
string durationText = GUILayout.TextField(_extendDurationSeconds.ToString("F0"), GUILayout.Width(60f));
if (float.TryParse(durationText, out float parsedDuration))
{
_extendDurationSeconds = Mathf.Clamp(parsedDuration, 1f, 3600f);
}
if (GUILayout.Button("Extend Battle", GUILayout.Height(24f)))
{
if (procedure.CurrentGameState is GameStateBattle gameState)
{
gameState.AddBattleDuration(_extendDurationSeconds);
}
}
GUILayout.EndHorizontal();
}
if (_showPlayerWeaponControls)
{
GUILayout.Label(
$"Player Weapon: {(player == null ? "Player not found" : (player.WeaponEnabled ? "Enabled" : "Disabled"))}");
GUILayout.BeginHorizontal();
GUI.enabled = player != null;
if (GUILayout.Button("Disable Weapons", GUILayout.Height(24f)))
{
player.SetWeaponEnabled(false);
}
if (GUILayout.Button("Enable Weapons", GUILayout.Height(24f)))
{
player.SetWeaponEnabled(true);
}
GUI.enabled = true;
GUILayout.EndHorizontal();
}
if (_showPlayerHealthControls)
{
GUILayout.Space(4f);
GUILayout.Label(
$"Player HP: {(playerHealth == null ? "Unavailable" : $"{playerHealth.CurrentHealth}/{playerHealth.MaxHealth}")}");
GUILayout.BeginHorizontal();
GUI.enabled = playerHealth != null;
if (GUILayout.Button($"+{DebugHealAmount} HP", GUILayout.Height(24f)))
{
AddPlayerHealth(playerHealth, DebugHealAmount);
}
if (GUILayout.Button(_lockPlayerHealthToMax ? "GodMode: ON" : "GodMode: OFF", GUILayout.Height(24f)))
{
_lockPlayerHealthToMax = !_lockPlayerHealthToMax;
if (_lockPlayerHealthToMax)
{
RestorePlayerHealthToMax(playerHealth);
}
}
GUI.enabled = true;
GUILayout.EndHorizontal();
}
}
private bool HasVisibleBattleSection()
{
return _showBattleOverview ||
_showCollisionStats ||
_showSpawnControls ||
_showBattleDurationControls ||
_showPlayerWeaponControls ||
_showPlayerHealthControls;
}
private void EnsurePropList(bool force = false)
{
if (!force && _allProps != null && _allProps.Length > 0) return;
if (GameEntry.DataTable == null)
{
_allProps = Array.Empty<DRProp>();
_filteredProps = Array.Empty<DRProp>();
_displayNames = Array.Empty<string>();
return;
}
var table = GameEntry.DataTable.GetDataTable<DRProp>();
_allProps = table != null ? table.ToArray() : Array.Empty<DRProp>();
_selectedIndex = Mathf.Clamp(_selectedIndex, 0, Mathf.Max(0, _allProps.Length - 1));
ApplyFilter(_searchText);
}
private void ApplyFilter(string keyword)
{
if (_allProps == null || _allProps.Length == 0)
{
_filteredProps = Array.Empty<DRProp>();
_displayNames = Array.Empty<string>();
return;
}
if (string.IsNullOrWhiteSpace(keyword))
{
_filteredProps = _allProps;
}
else
{
string search = keyword.Trim();
_filteredProps = _allProps.Where(p =>
p != null &&
(p.Title?.IndexOf(search, StringComparison.OrdinalIgnoreCase) >= 0 ||
p.Id.ToString().Contains(search))).ToArray();
}
_displayNames = _filteredProps.Select(p => $"[{p.Id}] {p.Title} ({p.Rarity})").ToArray();
if (_displayNames.Length == 0) _selectedIndex = 0;
else _selectedIndex = Mathf.Clamp(_selectedIndex, 0, _displayNames.Length - 1);
}
private DRProp GetSelectedProp()
{
if (_filteredProps == null || _filteredProps.Length == 0) return null;
_selectedIndex = Mathf.Clamp(_selectedIndex, 0, _filteredProps.Length - 1);
return _filteredProps[_selectedIndex];
}
private static Player FindPlayer()
{
return UnityEngine.Object.FindObjectOfType<Player>();
}
private void KeepPlayerHealthAtMax()
{
Player player = FindPlayer();
if (player == null) return;
HealthComponent playerHealth = player.GetComponent<HealthComponent>();
if (playerHealth == null) return;
RestorePlayerHealthToMax(playerHealth);
}
private static void AddPlayerHealth(HealthComponent playerHealth, int amount)
{
if (playerHealth == null || amount <= 0) return;
if (playerHealth.CurrentHealth <= 0) return;
int maxHealth = playerHealth.MaxHealth;
if (maxHealth <= 0) return;
int nextHealth = Mathf.Clamp(playerHealth.CurrentHealth + amount, 0, maxHealth);
if (nextHealth == playerHealth.CurrentHealth) return;
playerHealth.CurrentHealth = nextHealth;
PublishPlayerHealthChanged(playerHealth);
}
private static void RestorePlayerHealthToMax(HealthComponent playerHealth)
{
if (playerHealth == null) return;
if (playerHealth.CurrentHealth <= 0) return;
int maxHealth = playerHealth.MaxHealth;
if (maxHealth <= 0 || playerHealth.CurrentHealth >= maxHealth) return;
playerHealth.CurrentHealth = maxHealth;
PublishPlayerHealthChanged(playerHealth);
}
private static void PublishPlayerHealthChanged(HealthComponent playerHealth)
{
if (playerHealth == null || GameEntry.Event == null) return;
GameEntry.Event.Fire(null,
PlayerHealthChangeEventArgs.Create(0, playerHealth.CurrentHealth, playerHealth.MaxHealth));
}
private static void AddSelectedBuffToPlayer(DRProp prop, int count)
{
Player player = FindPlayer();
if (player == null || prop == null || prop.Modifiers == null) return;
int applyCount = Mathf.Clamp(count, 1, 99);
for (int i = 0; i < applyCount; i++)
{
player.AddProp(new PropItem(prop.Modifiers, prop.Rarity, prop.Title, prop.IconAssetName));
}
}
private void HandleCornerTapGesture()
{
if (!TryGetTouchReleased(out Vector2 touchPosition)) return;
if (touchPosition.x > 80f || touchPosition.y < Screen.height - 80f) return;
float now = Time.unscaledTime;
if (now - _lastCornerTapTime > CornerTapWindow)
{
_cornerTapCount = 0;
}
_lastCornerTapTime = now;
_cornerTapCount++;
if (_cornerTapCount >= RequiredCornerTapCount)
{
_cornerTapCount = 0;
_isPanelVisible = !_isPanelVisible;
}
}
private static bool IsTogglePressed()
{
#if ENABLE_INPUT_SYSTEM
Keyboard keyboard = Keyboard.current;
if (keyboard == null) return false;
return keyboard.backquoteKey.wasPressedThisFrame || keyboard.f8Key.wasPressedThisFrame;
#else
return Input.GetKeyDown(KeyCode.BackQuote) || Input.GetKeyDown(KeyCode.F8);
#endif
}
private static bool TryGetTouchReleased(out Vector2 touchPosition)
{
#if ENABLE_INPUT_SYSTEM
Touchscreen touchscreen = Touchscreen.current;
if (touchscreen == null)
{
touchPosition = default;
return false;
}
var touch = touchscreen.primaryTouch;
if (!touch.press.wasReleasedThisFrame)
{
touchPosition = default;
return false;
}
touchPosition = touch.position.ReadValue();
return true;
#else
if (Input.touchCount <= 0)
{
touchPosition = default;
return false;
}
Touch touch = Input.GetTouch(0);
if (touch.phase != TouchPhase.Ended)
{
touchPosition = default;
return false;
}
touchPosition = touch.position;
return true;
#endif
}
}
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,66 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!850595691 &4890085278179872738
LightingSettings:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: MenuSettings
serializedVersion: 6
m_GIWorkflowMode: 1
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_RealtimeEnvironmentLighting: 1
m_BounceScale: 1
m_AlbedoBoost: 1
m_IndirectOutputScale: 1
m_UsingShadowmask: 0
m_BakeBackend: 0
m_LightmapMaxSize: 1024
m_BakeResolution: 50
m_Padding: 2
m_LightmapCompression: 0
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 0
m_CompAOExponentDirect: 0
m_ExtractAO: 0
m_MixedBakeMode: 1
m_LightmapsBakeMode: 1
m_FilterMode: 1
m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0}
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_RealtimeResolution: 1
m_ForceWhiteAlbedo: 0
m_ForceUpdates: 0
m_FinalGather: 0
m_FinalGatherRayCount: 1024
m_FinalGatherFiltering: 1
m_PVRCulling: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVREnvironmentSampleCount: 512
m_PVREnvironmentReferencePointCount: 2048
m_LightProbeSampleCountMultiplier: 4
m_PVRBounces: 2
m_PVRMinBounces: 2
m_PVREnvironmentImportanceSampling: 0
m_PVRFilteringMode: 0
m_PVRDenoiserTypeDirect: 0
m_PVRDenoiserTypeIndirect: 0
m_PVRDenoiserTypeAO: 0
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_PVRTiledBaking: 0
m_NumRaysToShootPerTexel: -1
m_RespectSceneVisibilityWhenBakingGI: 0

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 427f5be66b5f35b4a898d6e812a0e7bc
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 4890085278179872738
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,9 +1,8 @@
fileFormatVersion: 2
guid: edd16bf2e418bec43bc774c7fc6c60d6
guid: 5ed0f22b675178e488a2cc585b6f78cb
folderAsset: yes
timeCreated: 1528026145
licenseType: Pro
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,15 +1,8 @@
//------------------------------------------------------------
// Game Framework
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
// Homepage: https://gameframework.cn/
// Feedback: mailto:ellan@gameframework.cn
//------------------------------------------------------------
using System;
using System;
using System.IO;
using UnityEngine;
namespace DataTable
namespace SepCore.DataTable
{
public static class BinaryReaderExtension
{

View File

@ -1,6 +1,6 @@
using UnityGameFramework.Runtime;
namespace DataTable
namespace SepCore.DataTable
{
/// <summary>
/// Bullet config table.

View File

@ -2,7 +2,7 @@ using System;
using System.Collections.Generic;
using UnityGameFramework.Runtime;
namespace DataTable
namespace SepCore.DataTable
{
public class DREnemy : DataRowBase
{

View File

@ -1,18 +1,8 @@
//------------------------------------------------------------
// Game Framework
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
// Homepage: https://gameframework.cn/
// Feedback: mailto:ellan@gameframework.cn
//------------------------------------------------------------
// 此文件由工具自动生成,请勿直接修改。
// 生成时间2021-06-16 21:54:35.576
//------------------------------------------------------------
using System.IO;
using System.IO;
using System.Text;
using UnityGameFramework.Runtime;
namespace DataTable
namespace SepCore.DataTable
{
/// <summary>
/// 实体表。
@ -71,4 +61,4 @@ namespace DataTable
{
}
}
}
}

View File

@ -1,8 +1,8 @@
using Definition.Enum;
using CustomUtility;
using SepCore.Definition;
using SepCore.CustomUtility;
using UnityGameFramework.Runtime;
namespace DataTable
namespace SepCore.DataTable
{
public class DRGoods : DataRowBase
{

View File

@ -1,9 +1,9 @@
using System;
using CustomUtility;
using Definition.Enum;
using SepCore.CustomUtility;
using SepCore.Definition;
using UnityGameFramework.Runtime;
namespace DataTable
namespace SepCore.DataTable
{
public class DRLevel : DataRowBase
{

View File

@ -1,6 +1,6 @@
using UnityGameFramework.Runtime;
namespace DataTable
namespace SepCore.DataTable
{
public class DRLevelRarity : DataRowBase
{

View File

@ -1,10 +1,9 @@
using Definition.DataStruct;
using Definition.Enum;
using SepCore.Definition;
using Newtonsoft.Json;
using CustomUtility;
using SepCore.CustomUtility;
using UnityGameFramework.Runtime;
namespace DataTable
namespace SepCore.DataTable
{
public class DRLevelUpReward : DataRowBase
{

View File

@ -1,22 +1,8 @@
//------------------------------------------------------------
// Game Framework
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
// Homepage: https://gameframework.cn/
// Feedback: mailto:ellan@gameframework.cn
//------------------------------------------------------------
// 此文件由工具自动生成,请勿直接修改。
// 生成时间2021-06-16 21:54:35.591
//------------------------------------------------------------
using GameFramework;
using System;
using System.Collections.Generic;
using System.IO;
using System.IO;
using System.Text;
using UnityEngine;
using UnityGameFramework.Runtime;
namespace DataTable
namespace SepCore.DataTable
{
/// <summary>
/// 音乐配置表。
@ -75,4 +61,4 @@ namespace DataTable
{
}
}
}
}

View File

@ -1,10 +1,9 @@
using Definition.DataStruct;
using SepCore.Definition;
using Newtonsoft.Json;
using CustomUtility;
using SepCore.CustomUtility;
using UnityGameFramework.Runtime;
using Definition.Enum;
namespace DataTable
namespace SepCore.DataTable
{
public class DRProp : DataRowBase
{

View File

@ -1,14 +1,10 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using Definition.DataStruct;
using Definition.Enum;
using GameFramework;
using StarForce;
using SepCore.Definition;
using UnityGameFramework.Runtime;
namespace DataTable
namespace SepCore.DataTable
{
public class DRRole : DataRowBase
{
@ -136,4 +132,4 @@ namespace DataTable
ExpRequires = expRequires.ToArray();
}
}
}
}

View File

@ -1,18 +1,8 @@
//------------------------------------------------------------
// Game Framework
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
// Homepage: https://gameframework.cn/
// Feedback: mailto:ellan@gameframework.cn
//------------------------------------------------------------
// 此文件由工具自动生成,请勿直接修改。
// 生成时间2021-06-16 21:54:35.610
//------------------------------------------------------------
using System.IO;
using System.IO;
using System.Text;
using UnityGameFramework.Runtime;
namespace DataTable
namespace SepCore.DataTable
{
/// <summary>
/// 场景配置表。
@ -78,4 +68,4 @@ namespace DataTable
{
}
}
}
}

View File

@ -1,22 +1,8 @@
//------------------------------------------------------------
// Game Framework
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
// Homepage: https://gameframework.cn/
// Feedback: mailto:ellan@gameframework.cn
//------------------------------------------------------------
// 此文件由工具自动生成,请勿直接修改。
// 生成时间2021-06-16 21:54:35.625
//------------------------------------------------------------
using GameFramework;
using System;
using System.Collections.Generic;
using System.IO;
using System.IO;
using System.Text;
using UnityEngine;
using UnityGameFramework.Runtime;
namespace DataTable
namespace SepCore.DataTable
{
/// <summary>
/// 声音配置表。
@ -110,4 +96,4 @@ namespace DataTable
{
}
}
}
}

View File

@ -1,22 +1,8 @@
//------------------------------------------------------------
// Game Framework
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
// Homepage: https://gameframework.cn/
// Feedback: mailto:ellan@gameframework.cn
//------------------------------------------------------------
// 此文件由工具自动生成,请勿直接修改。
// 生成时间2021-06-16 21:54:35.652
//------------------------------------------------------------
using GameFramework;
using System;
using System.Collections.Generic;
using System.IO;
using System.IO;
using System.Text;
using UnityEngine;
using UnityGameFramework.Runtime;
namespace DataTable
namespace SepCore.DataTable
{
/// <summary>
/// 界面配置表。
@ -96,4 +82,4 @@ namespace DataTable
{
}
}
}
}

View File

@ -1,22 +1,8 @@
//------------------------------------------------------------
// Game Framework
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
// Homepage: https://gameframework.cn/
// Feedback: mailto:ellan@gameframework.cn
//------------------------------------------------------------
// 此文件由工具自动生成,请勿直接修改。
// 生成时间2021-06-16 21:54:35.666
//------------------------------------------------------------
using GameFramework;
using System;
using System.Collections.Generic;
using System.IO;
using System.IO;
using System.Text;
using UnityEngine;
using UnityGameFramework.Runtime;
namespace DataTable
namespace SepCore.DataTable
{
/// <summary>
/// 声音配置表。
@ -89,4 +75,4 @@ namespace DataTable
{
}
}
}
}

View File

@ -1,14 +1,12 @@
using System;
using System.Collections.Generic;
using Definition.DataStruct;
using Definition.Enum;
using GameFramework;
using CustomUtility;
using SepCore.Definition;
using SepCore.CustomUtility;
using Newtonsoft.Json.Linq;
using UnityEngine;
using UnityGameFramework.Runtime;
namespace DataTable
namespace SepCore.DataTable
{
/// <summary>
/// 武器表。
@ -23,7 +21,7 @@ namespace DataTable
public override int Id => m_Id;
public int EntityTypeId { get; private set; }
/// <summary>
/// 获取武器名称。
/// </summary>
@ -38,12 +36,12 @@ namespace DataTable
/// 获取武器稀有度
/// </summary>
public ItemRarity Rarity { get; private set; }
/// <summary>
/// 获取武器价值
/// </summary>
public int Price { get; private set; }
/// <summary>
/// 获取武器价值浮动率
/// </summary>
@ -114,7 +112,7 @@ namespace DataTable
private void GeneratePropertyArray()
{
}
/// <summary>
/// 解参数
/// </summary>

View File

@ -1,21 +1,14 @@
//------------------------------------------------------------
// Game Framework
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
// Homepage: https://gameframework.cn/
// Feedback: mailto:ellan@gameframework.cn
//------------------------------------------------------------
using GameFramework.DataTable;
using GameFramework.DataTable;
using System;
using Definition;
using SepCore.Definition;
using UnityEngine;
using UnityGameFramework.Runtime;
namespace DataTable
namespace SepCore.DataTable
{
public static class DataTableExtension
{
private const string DataRowClassPrefixName = "DataTable.DR";
private const string DataRowClassPrefixName = "SepCore.DataTable.DR";
internal static readonly char[] DataSplitSeparators = new char[] { '\t' };
internal static readonly char[] DataTrimSeparators = new char[] { '\"' };
@ -101,4 +94,4 @@ namespace DataTable
return dataTableComponent.GetDataTable<T>().GetDataRow(id);
}
}
}
}

View File

@ -5,7 +5,7 @@
// Feedback: mailto:ellan@gameframework.cn
//------------------------------------------------------------
namespace Definition
namespace SepCore.Definition
{
public static partial class Constant
{

View File

@ -7,7 +7,7 @@
using UnityEngine;
namespace Definition
namespace SepCore.Definition
{
public static partial class Constant
{

View File

@ -5,7 +5,7 @@
// Feedback: mailto:ellan@gameframework.cn
//------------------------------------------------------------
namespace Definition
namespace SepCore.Definition
{
public static partial class Constant
{

View File

@ -5,7 +5,7 @@
// Feedback: mailto:ellan@gameframework.cn
//------------------------------------------------------------
namespace Definition.DataStruct
namespace SepCore.Definition
{
public class BuildInfo
{

View File

@ -6,9 +6,9 @@
//------------------------------------------------------------
using System.Runtime.InteropServices;
using Definition.Enum;
using SepCore.Definition;
namespace Definition.DataStruct
namespace SepCore.Definition
{
[StructLayout(LayoutKind.Auto)]
public struct ImpactData

View File

@ -1,8 +1,6 @@
using Components;
using DataTable;
using Definition.Enum;
using SepCore.DataTable;
namespace Definition.DataStruct
namespace SepCore.Definition
{
public class PropItem
{
@ -34,23 +32,5 @@ namespace Definition.DataStruct
Rarity = rarity;
IconAssetName = iconAssetName;
}
public void OnAttach(StatComponent statComponent)
{
if (_modifiers == null || statComponent == null) return;
foreach (var modifier in _modifiers)
{
statComponent.AddModifier(modifier);
}
}
public void OnDetach(StatComponent statComponent)
{
if (_modifiers == null || statComponent == null) return;
foreach (var modifier in _modifiers)
{
statComponent.RemoveModifier(modifier);
}
}
}
}
}

View File

@ -1,9 +1,9 @@
using System;
using Definition.Enum;
using CustomUtility;
using SepCore.Definition;
using SepCore.CustomUtility;
using UnityGameFramework.Runtime;
namespace Definition.DataStruct
namespace SepCore.Definition
{
public class StatModifier
{

View File

@ -1,4 +1,4 @@
namespace Definition.DataStruct
namespace SepCore.Definition
{
public class StatProperty
{

View File

@ -5,7 +5,7 @@
// Feedback: mailto:ellan@gameframework.cn
//------------------------------------------------------------
namespace Definition.DataStruct
namespace SepCore.Definition
{
public class VersionInfo
{

View File

@ -1,4 +1,4 @@
namespace Definition.Enum
namespace SepCore.Definition
{
public enum BulletType : byte
{

View File

@ -5,7 +5,7 @@
// Feedback: mailto:ellan@gameframework.cn
//------------------------------------------------------------
namespace Definition.Enum
namespace SepCore.Definition
{
/// <summary>
/// 阵营类型。

View File

@ -1,4 +1,4 @@
namespace Definition.Enum
namespace SepCore.Definition
{
public enum EnemyType : byte
{

View File

@ -1,4 +1,4 @@
namespace Definition.Enum
namespace SepCore.Definition
{
public enum GoodsType
{

View File

@ -1,4 +1,4 @@
namespace Definition.Enum
namespace SepCore.Definition
{
public enum ItemRarity
{

View File

@ -5,7 +5,7 @@
// Feedback: mailto:ellan@gameframework.cn
//------------------------------------------------------------
namespace Definition.Enum
namespace SepCore.Definition
{
/// <summary>
/// 关系类型。

View File

@ -1,4 +1,4 @@
namespace Scene
namespace SepCore.Definition
{
public enum SceneId : byte
{

View File

@ -1,4 +1,4 @@
namespace Definition.Enum
namespace SepCore.Definition
{
public enum StatType
{

View File

@ -5,14 +5,14 @@
// Feedback: mailto:ellan@gameframework.cn
//------------------------------------------------------------
namespace Definition.Enum
namespace SepCore.Definition
{
/// <summary>
/// 界面编号。
/// </summary>
public enum UIFormType : byte
{
TUIForm = 0,
Undefined = 0,
/// <summary>
/// 弹出框。
@ -22,7 +22,7 @@ namespace Definition.Enum
/// <summary>
/// 主菜单。
/// </summary>
MenuForm = 100,
MenuForm = 200,
/// <summary>
/// 设置。
@ -33,22 +33,17 @@ namespace Definition.Enum
/// 关于。
/// </summary>
AboutForm = 102,
/// <summary>
/// 主菜单。
/// </summary>
StartMenuForm = 200,
/// <summary>
/// 选择角色。
/// </summary>
SelectRoleForm = 201,
/// <summary>
/// 游戏商店。
/// </summary>
ShopForm = 202,
/// <summary>
/// 游戏HUD。
/// </summary>
@ -58,7 +53,7 @@ namespace Definition.Enum
/// 升级选择。
/// </summary>
LevelUpForm = 204,
/// <summary>
/// 物品信息展示页
/// </summary>

View File

@ -1,4 +1,4 @@
namespace Definition.Enum
namespace SepCore.Definition
{
public enum WeaponType : byte
{

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 7d69a94fcc50f4c4ca1dc45e4338560e
guid: cedb6e3c4b92edf4bbbe5fb34bb043ba
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@ -0,0 +1,31 @@
using System;
using SepCore.Definition;
using UnityEngine;
namespace SepCore.Entity
{
[Serializable]
public abstract class AccessoryObjectData : EntityDataBase
{
[SerializeField] private int _ownerId = 0;
[SerializeField] private CampType _ownerCamp = CampType.Unknown;
public AccessoryObjectData(int entityId, int typeId, int ownerId, CampType ownerCamp)
: base(entityId, typeId)
{
_ownerId = ownerId;
_ownerCamp = ownerCamp;
}
/// <summary>
/// 拥有者编号。
/// </summary>
public int OwnerId => _ownerId;
/// <summary>
/// 拥有者阵营。
/// </summary>
public CampType OwnerCamp => _ownerCamp;
}
}

View File

@ -1,4 +1,4 @@
namespace Entity.EntityData
namespace SepCore.Entity
{
public class CoinData : EntityDataBase
{

View File

@ -0,0 +1,20 @@
using System;
using UnityEngine;
namespace SepCore.Entity
{
[Serializable]
public class EffectData : EntityDataBase
{
[SerializeField]
private float _keepTime = 0f;
public EffectData(int entityId, int typeId)
: base(entityId, typeId)
{
_keepTime = 3f;
}
public float KeepTime => _keepTime;
}
}

View File

@ -1,32 +1,22 @@
using System;
using System.Collections.Generic;
using DataTable;
using Definition.Enum;
using SepCore.DataTable;
using SepCore.Definition;
using UnityEngine;
namespace Entity.EntityData
namespace SepCore.Entity
{
[Serializable]
public class EnemyData : TargetableObjectData
{
[SerializeField] private DREnemy _drEnemy;
private DREnemy _drEnemy;
public EnemyData(int entityId, EnemyType enemyType, int level) : base(
entityId, (int)enemyType, CampType.Enemy)
public EnemyData(int entityId, DREnemy drEnemy, int level) : base(
entityId, drEnemy.Id, CampType.Enemy)
{
DREnemy enemyRow = GameEntry.DataTable.GetDataTableRow<DREnemy>((int)enemyType);
if (enemyRow == null)
{
throw new Exception($"Enemy data table row is missing, EnemyType='{enemyType}'.");
}
else
{
_drEnemy = enemyRow;
}
_drEnemy = drEnemy;
int effectiveLevel = Mathf.Max(1, level);
MaxHealthBase = enemyRow.MaxHealth + enemyRow.HpAddPerLevel * (effectiveLevel - 1);
MaxHealthBase = _drEnemy.MaxHealth + _drEnemy.HpAddPerLevel * (effectiveLevel - 1);
}
public EnemyType EnemyType => (EnemyType)_drEnemy.Id;

Some files were not shown because too many files have changed in this diff Show More