(client) chore:Clean code
This commit is contained in:
@ -195,6 +195,8 @@ TilemapRenderer:
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_ForceMeshLod: -1
|
||||
m_MeshLodSelectionBias: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
@ -216,6 +218,7 @@ TilemapRenderer:
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_GlobalIlluminationMeshLod: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
@ -242,37 +245,6 @@ Transform:
|
||||
m_Children: []
|
||||
m_Father: {fileID: 613797070}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &309861628
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 309861630}
|
||||
m_Layer: 0
|
||||
m_Name: "\u5B9E\u4F53\u5C42"
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &309861630
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 309861628}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0.17242, y: 0.05575, z: 1}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &613797067
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -290,7 +262,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!114 &613797068
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -388,7 +360,6 @@ MonoBehaviour:
|
||||
m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_RequiresDepthTexture: 0
|
||||
m_RequiresColorTexture: 0
|
||||
m_Version: 2
|
||||
m_TaaSettings:
|
||||
m_Quality: 3
|
||||
m_FrameInfluence: 0.1
|
||||
@ -396,6 +367,7 @@ MonoBehaviour:
|
||||
m_MipBias: 0
|
||||
m_VarianceClampScale: 0.9
|
||||
m_ContrastAdaptiveSharpening: 0
|
||||
m_Version: 2
|
||||
--- !u!81 &1057087088
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -546,6 +518,8 @@ TilemapRenderer:
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_ForceMeshLod: -1
|
||||
m_MeshLodSelectionBias: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
@ -567,6 +541,7 @@ TilemapRenderer:
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_GlobalIlluminationMeshLod: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
@ -593,51 +568,6 @@ Transform:
|
||||
m_Children: []
|
||||
m_Father: {fileID: 613797070}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1371068281
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1371068282}
|
||||
- component: {fileID: 1371068283}
|
||||
m_Layer: 0
|
||||
m_Name: Loader
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1371068282
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1371068281}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &1371068283
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1371068281}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 147e91e6929d90a4fb877c0b0a6b608c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
entityManager: {fileID: 2036983433}
|
||||
--- !u!1 &2036983430
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -655,7 +585,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!4 &2036983432
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -684,8 +614,11 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
isGlobal: 1
|
||||
entityLevel: {fileID: 309861628}
|
||||
entityPrefab: {fileID: 3332598847335032684, guid: 6cd8b01a0f57372438dc30c864ae1530, type: 3}
|
||||
characterPrefab: {fileID: 0}
|
||||
monsterPrefab: {fileID: 0}
|
||||
buildingPrefab: {fileID: 0}
|
||||
bulletPrefab: {fileID: 0}
|
||||
pickupPrefab: {fileID: 0}
|
||||
defaultEntityPrefab: {fileID: 7975757421877276383, guid: 89661daa5f100c64783f0ad9cd37a7ff, type: 3}
|
||||
--- !u!114 &2036983434
|
||||
MonoBehaviour:
|
||||
@ -716,7 +649,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &2104915507
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -751,6 +684,4 @@ SceneRoots:
|
||||
- {fileID: 1057087090}
|
||||
- {fileID: 613797070}
|
||||
- {fileID: 2104915508}
|
||||
- {fileID: 309861630}
|
||||
- {fileID: 2036983432}
|
||||
- {fileID: 1371068282}
|
||||
|
@ -1,9 +1,7 @@
|
||||
using Data;
|
||||
using Parsing;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Text.RegularExpressions;
|
||||
using Data;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AI
|
||||
{
|
||||
|
@ -1,10 +1,8 @@
|
||||
using System;
|
||||
using AI;
|
||||
using Data;
|
||||
using System;
|
||||
|
||||
namespace Utils
|
||||
namespace AI
|
||||
{
|
||||
|
||||
public static class BehaviorTree
|
||||
{
|
||||
/// <summary>
|
@ -1,9 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using Base;
|
||||
using Data;
|
||||
using Managers;
|
||||
using Prefab;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AI
|
||||
|
@ -1,6 +1,6 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Base
|
||||
|
@ -1,8 +1,7 @@
|
||||
// C#
|
||||
using Managers; // 确保日志命名空间正确
|
||||
using System.Collections;
|
||||
using System.Collections.Generic; // 新增,用于List
|
||||
using Logging;
|
||||
using Managers; // 确保日志命名空间正确
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
@ -96,7 +95,7 @@ namespace Base
|
||||
// 在 Awake 中初始化管理器列表并注册,确保在 Start 之前完成
|
||||
_managersToLoad = new List<ILaunchManager>
|
||||
{
|
||||
new Logging.LoggerManagerWrapper(), // UnityLogger的包装器
|
||||
Logging.UnityLogger.Instance, // UnityLogger的包装器
|
||||
Managers.DefineManager.Instance,
|
||||
Managers.PackagesImageManager.Instance,
|
||||
Managers.TileManager.Instance,
|
||||
|
@ -1,10 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UI;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
namespace Base
|
||||
{
|
||||
|
@ -1,13 +1,10 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Networking;
|
||||
using Formatting = Newtonsoft.Json.Formatting;
|
||||
|
||||
namespace Configs
|
||||
|
@ -1,10 +1,3 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Xml.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Data
|
||||
{
|
||||
public class CharacterDef : EntityDef
|
||||
|
@ -1,7 +1,4 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Xml.Linq;
|
||||
|
@ -1,3 +1,4 @@
|
||||
using Configs;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
@ -5,9 +6,7 @@ using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Xml.Linq;
|
||||
using Configs;
|
||||
using UnityEngine;
|
||||
using Object = System.Object;
|
||||
|
||||
namespace Data
|
||||
{
|
||||
|
@ -1,8 +1,3 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Data
|
||||
{
|
||||
public class EntityDef : Define
|
||||
|
@ -1,5 +1,3 @@
|
||||
using Base;
|
||||
using Data;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Entity
|
||||
|
@ -1,7 +1,5 @@
|
||||
using System;
|
||||
using Base;
|
||||
using Data;
|
||||
using Prefab;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Entity
|
||||
|
@ -1,10 +1,6 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Data;
|
||||
using Item;
|
||||
using Managers;
|
||||
using UnityEngine;
|
||||
using Utils;
|
||||
// 添加 System 命名空间以使用 Action
|
||||
|
||||
namespace Entity
|
||||
|
@ -1,13 +1,13 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using AI;
|
||||
using Base;
|
||||
using Data;
|
||||
using Item;
|
||||
using Managers;
|
||||
using Prefab;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
@ -177,7 +177,7 @@ namespace Entity
|
||||
public virtual void Init(EntityDef entityDef)
|
||||
{
|
||||
attributes = new Attributes(entityDef.attributes);
|
||||
aiTree = Utils.BehaviorTree.ConvertToAIBase(entityDef.behaviorTree);
|
||||
aiTree = AI.BehaviorTree.ConvertToAIBase(entityDef.behaviorTree);
|
||||
affiliation = entityDef.affiliation?.defName;
|
||||
InitBody(entityDef.drawingOrder);
|
||||
this.entityDef = entityDef;
|
||||
|
@ -1,6 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Item;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Entity
|
||||
|
@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using Managers;
|
||||
using Prefab;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Base;
|
||||
using Data;
|
||||
using Item;
|
||||
using Prefab;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Entity
|
||||
|
@ -1,5 +1,3 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Item
|
||||
{
|
||||
public class ItemBase
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Data;
|
||||
using Managers;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Item
|
||||
|
@ -1,10 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq; // Added for LINQ
|
||||
using Base;
|
||||
using Data;
|
||||
using Entity;
|
||||
using Prefab;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
|
@ -27,8 +27,10 @@ namespace Logging
|
||||
public static int MaxLogs
|
||||
{
|
||||
get => _maxLogs;
|
||||
set {
|
||||
lock (_lock) {
|
||||
set
|
||||
{
|
||||
lock (_lock)
|
||||
{
|
||||
_maxLogs = Mathf.Max(value, 1); // 最小值为1
|
||||
TrimExcess();
|
||||
}
|
||||
|
@ -1,17 +0,0 @@
|
||||
using Managers;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Logging
|
||||
{
|
||||
public class LoggerManagerWrapper : ILaunchManager
|
||||
{
|
||||
public string StepDescription => "初始化日志";
|
||||
public void Init()
|
||||
{
|
||||
Logging.UnityLogger.Init();
|
||||
}
|
||||
public void Clear()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ffa9f8b447ee49f486398248d438f7ca
|
||||
timeCreated: 1756128101
|
@ -1,55 +1,64 @@
|
||||
using Managers;
|
||||
using Serilog;
|
||||
using UnityEngine;
|
||||
using Utils;
|
||||
using SerilogLogger = Serilog.Core.Logger;
|
||||
|
||||
namespace Logging
|
||||
{
|
||||
public static class UnityLogger
|
||||
public class UnityLogger : Singleton<UnityLogger>, ILaunchManager
|
||||
{
|
||||
private static readonly SerilogLogger Logger = new LoggerConfiguration()
|
||||
private bool _initialized = false;
|
||||
private readonly SerilogLogger _logger = new LoggerConfiguration()
|
||||
.WriteTo.File("Logs/UnityLog.txt")
|
||||
.CreateLogger();
|
||||
private static bool _initialized = false;
|
||||
public static void Init()
|
||||
|
||||
public void Init()
|
||||
{
|
||||
if(_initialized)
|
||||
return;
|
||||
Application.logMessageReceived += OnLogMessageReceived;
|
||||
if (_initialized) return;
|
||||
|
||||
Application.logMessageReceivedThreaded += OnLogMessageReceived;
|
||||
_initialized = true;
|
||||
}
|
||||
|
||||
private static void OnLogMessageReceived(string logString, string stackTrace, LogType type)
|
||||
public void Clear()
|
||||
{
|
||||
}
|
||||
|
||||
public string StepDescription => "初始化日志";
|
||||
|
||||
private void OnLogMessageReceived(string logString, string stackTrace, LogType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case LogType.Assert:
|
||||
{
|
||||
Logger.Warning("\nContent: {0}", logString);
|
||||
_logger.Warning("\nContent: {0}", logString);
|
||||
break;
|
||||
}
|
||||
case LogType.Log:
|
||||
{
|
||||
Logger.Information("\nContent: {0}", logString);
|
||||
_logger.Information("\nContent: {0}", logString);
|
||||
break;
|
||||
}
|
||||
case LogType.Warning:
|
||||
{
|
||||
Logger.Warning("\nContent: {0}", logString);
|
||||
_logger.Warning("\nContent: {0}", logString);
|
||||
break;
|
||||
}
|
||||
case LogType.Error:
|
||||
{
|
||||
Logger.Error("\nContent: {0}\nStackTrace:\n{1}", logString, stackTrace[..^1]);
|
||||
_logger.Error("\nContent: {0}\nStackTrace:\n{1}", logString, stackTrace[..^1]);
|
||||
break;
|
||||
}
|
||||
case LogType.Exception:
|
||||
{
|
||||
Logger.Fatal("\nContent: {0}\nStackTrace:\n{1}", logString, stackTrace[..^1]);
|
||||
_logger.Fatal("\nContent: {0}\nStackTrace:\n{1}", logString, stackTrace[..^1]);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
Logger.Information("\nContent: {0}", logString);
|
||||
_logger.Information("\nContent: {0}", logString);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
using Data;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Data;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Managers
|
||||
|
@ -1,9 +1,9 @@
|
||||
using Data;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Data;
|
||||
using UnityEngine;
|
||||
using Utils;
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Base;
|
||||
using Data;
|
||||
using Entity;
|
||||
using Prefab;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using Data;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using EventType = Data.EventType;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Data;
|
||||
using Item;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Managers
|
||||
|
@ -1,8 +1,8 @@
|
||||
using Data;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Data;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Managers
|
||||
|
@ -1,5 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using Prefab;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using Data;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Tilemaps;
|
||||
using Utils;
|
||||
|
@ -1,5 +1,3 @@
|
||||
using System;
|
||||
using Managers;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Map
|
||||
@ -12,7 +10,8 @@ namespace Map
|
||||
{
|
||||
[SerializeField] private bool defaultOpen = false;
|
||||
|
||||
[SerializeField] [Tooltip("此维度的唯一标识符。如果为空,将使用GameObject的名称。")]
|
||||
[SerializeField]
|
||||
[Tooltip("此维度的唯一标识符。如果为空,将使用GameObject的名称。")]
|
||||
private string _dimensionId;
|
||||
|
||||
[SerializeField] public MapGenerator mapGenerator;
|
||||
|
@ -1,8 +1,6 @@
|
||||
using System;
|
||||
using Managers;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Data;
|
||||
using Managers;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Tilemaps;
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Tilemaps;
|
||||
|
||||
namespace Map
|
||||
{
|
||||
|
@ -1,8 +1,9 @@
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using Grpc.Net.Client;
|
||||
using Grpc.Net.Client.Web;
|
||||
using Protocol;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using Utils;
|
||||
|
||||
namespace Network
|
||||
@ -18,21 +19,17 @@ namespace Network
|
||||
|
||||
public GrpcClient()
|
||||
{
|
||||
var httpHandler = new GrpcWebHandler(GrpcWebMode.GrpcWeb, new HttpClientHandler());
|
||||
var channelOptions = new GrpcChannelOptions
|
||||
{
|
||||
HttpHandler = httpHandler
|
||||
HttpHandler = new GrpcWebHandler(GrpcWebMode.GrpcWeb, new HttpClientHandler())
|
||||
};
|
||||
|
||||
_channel = GrpcChannel.ForAddress(ServerAddress, channelOptions);
|
||||
|
||||
_general = new GeneralService.GeneralServiceClient(_channel);
|
||||
_game = new GameService.GameServiceClient(_channel);
|
||||
}
|
||||
|
||||
~GrpcClient()
|
||||
{
|
||||
_channel.ShutdownAsync().Wait();
|
||||
Application.quitting += () => _channel.ShutdownAsync().Wait();
|
||||
}
|
||||
|
||||
public async Task<ServerInfo> GetServerInfo()
|
||||
|
8
Client/Assets/Scripts/Parsing.meta
Normal file
8
Client/Assets/Scripts/Parsing.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ef7f384f3b5dc0049ba97561d579cd03
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -5,7 +5,7 @@ using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace AI
|
||||
namespace Parsing
|
||||
{
|
||||
public static class ConditionDelegateFactory
|
||||
{
|
@ -1,9 +1,4 @@
|
||||
using System;
|
||||
using Data;
|
||||
using Managers;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AI
|
||||
namespace Parsing
|
||||
{
|
||||
public static class ConditionFunctions
|
||||
{
|
||||
@ -12,7 +7,6 @@ namespace AI
|
||||
return entity.attributes.health >= minHealth;
|
||||
}
|
||||
|
||||
|
||||
public static bool HasEnemyInSight(Entity.Entity entity)
|
||||
{
|
||||
return Managers.EntityManage.Instance.ExistsHostile(entity.currentDimensionId, entity.entityPrefab);
|
@ -2,7 +2,7 @@ using System;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
|
||||
namespace Utils
|
||||
namespace Parsing
|
||||
{
|
||||
public static class Resolver
|
||||
{
|
@ -1,11 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using AI;
|
||||
using Base;
|
||||
using Data;
|
||||
using Entity;
|
||||
using Unity.VisualScripting;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Prefab
|
||||
|
@ -1,4 +1,3 @@
|
||||
using System;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
@ -1,4 +1,3 @@
|
||||
using Base;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Prefab
|
||||
|
@ -1,4 +1,3 @@
|
||||
using System;
|
||||
using Base;
|
||||
using UnityEngine;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
using Map;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Map;
|
||||
using UnityEngine;
|
||||
using Utils;
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
using Base;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
|
||||
namespace UI
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using Base;
|
||||
using Entity;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
// 确保 Character 类在此命名空间下
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
using Base;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
namespace UI
|
||||
|
@ -1,5 +1,5 @@
|
||||
using System;
|
||||
using Base;
|
||||
using System;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
|
@ -1,6 +1,6 @@
|
||||
using Prefab;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Prefab;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
using System;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UI
|
||||
|
@ -1,5 +1,5 @@
|
||||
using System.Globalization;
|
||||
using Base;
|
||||
using System.Globalization;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
@ -2,20 +2,18 @@ using System;
|
||||
|
||||
namespace Utils
|
||||
{
|
||||
public class PerlinNoise : Utils.Singleton<PerlinNoise>
|
||||
public class PerlinNoise : Singleton<PerlinNoise>
|
||||
{
|
||||
private int[] _p; // 混淆表
|
||||
private const int DefaultSeed = 0; // 默认种子
|
||||
private readonly int[] _p = new int[512]; // 混淆表
|
||||
|
||||
public PerlinNoise()
|
||||
{
|
||||
Initialize(DefaultSeed);
|
||||
Initialize();
|
||||
}
|
||||
|
||||
// 初始化混淆表
|
||||
private void Initialize(int seed)
|
||||
private void Initialize(int seed = 0)
|
||||
{
|
||||
_p = new int[512]; // 混淆表加倍以方便使用
|
||||
var permutation = new int[256];
|
||||
var random = new Random(seed);
|
||||
|
||||
@ -26,9 +24,8 @@ namespace Utils
|
||||
for (var i = 0; i < 256; i++)
|
||||
{
|
||||
var swapIndex = random.Next(256);
|
||||
var temp = permutation[i];
|
||||
permutation[i] = permutation[swapIndex];
|
||||
permutation[swapIndex] = temp;
|
||||
|
||||
(permutation[i], permutation[swapIndex]) = (permutation[swapIndex], permutation[i]);
|
||||
}
|
||||
|
||||
// 将打乱后的数组复制两次,生成512个元素的混淆表
|
||||
|
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user