临时提交

This commit is contained in:
DESKTOP-5RP3AKU\Jisol
2024-10-19 03:51:59 +08:00
parent 425f2eabea
commit 1315802fa2
162 changed files with 16452 additions and 11111 deletions
+302 -290
View File
File diff suppressed because it is too large Load Diff
@@ -43,13 +43,13 @@
<ItemGroup> <ItemGroup>
<None Include="Assets\Plugins\Sirenix\Odin Inspector\Assets\Editor\Bootstrap License.txt" /> <None Include="Assets\Plugins\Sirenix\Odin Inspector\Assets\Editor\Bootstrap License.txt" />
<Reference Include="UnityEngine"> <Reference Include="UnityEngine">
<HintPath>D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.dll</HintPath> <HintPath>C:\APP\UnityEdit\2022.3.16f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.dll</HintPath>
</Reference> </Reference>
<Reference Include="UnityEngine.CoreModule"> <Reference Include="UnityEngine.CoreModule">
<HintPath>D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll</HintPath> <HintPath>C:\APP\UnityEdit\2022.3.16f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll</HintPath>
</Reference> </Reference>
<Reference Include="UnityEditor"> <Reference Include="UnityEditor">
<HintPath>D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.dll</HintPath> <HintPath>C:\APP\UnityEdit\2022.3.16f1c1\Editor\Data\Managed\UnityEngine\UnityEditor.dll</HintPath>
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -8,16 +8,17 @@ namespace GAS.Runtime
public class JexGasManager public class JexGasManager
{ {
/// <summary>
/// GAS 专用对象池 (只限制当前管理器)
/// </summary>
private JexGasObjectPool ObjectPool = new JexGasObjectPool();
public static void Awake() public static void Awake()
{ {
//初始化 GAS 对象池
JexGasObjectPool.Awake();
} }
public static void Destroy() public static void Destroy()
{ {
//销毁 GAS 对象池
JexGasObjectPool.Destroy();
} }
public static void Update() public static void Update()
@@ -77,8 +77,6 @@ namespace JNGame.Sync.Frame
dtTotal += deltaTime; dtTotal += deltaTime;
dtInputTotal += deltaTime; dtInputTotal += deltaTime;
try
{
int nSyncTime = this.DyTime(); int nSyncTime = this.DyTime();
@@ -118,12 +116,6 @@ namespace JNGame.Sync.Frame
OnRunInput(); OnRunInput();
} }
}
catch (Exception e)
{
Debug.LogError(e.Message);
}
} }
@@ -1,8 +1,5 @@
using System; using System.Collections.Generic;
using System.Collections.Generic;
using JNGame.Sync.Entity;
using JNGame.Sync.Frame.Entity; using JNGame.Sync.Frame.Entity;
using JNGame.Sync.Frame.Entity.Components;
using UnityEngine; using UnityEngine;
namespace JNGame.Sync.State.Tile.Entity namespace JNGame.Sync.State.Tile.Entity
@@ -1,6 +1,5 @@
using JNGame.Sync.Entity; using JNGame.Sync.Entity;
using JNGame.Sync.Frame.Entity; using JNGame.Sync.Frame.Entity;
using JNGame.Sync.Frame.Entity.Components;
using JNGame.Sync.State.Tile.Entity.Component; using JNGame.Sync.State.Tile.Entity.Component;
using JNGame.Sync.System.Data; using JNGame.Sync.System.Data;
using NotImplementedException = System.NotImplementedException; using NotImplementedException = System.NotImplementedException;
@@ -1,7 +1,5 @@
using Entitas; using JNGame.Math;
using JNGame.Math;
using JNGame.Sync.Entity.Component; using JNGame.Sync.Entity.Component;
using JNGame.Sync.Frame.Entity.Components;
namespace JNGame.Sync.Frame.Entity.Component.Components namespace JNGame.Sync.Frame.Entity.Component.Components
{ {
@@ -4,7 +4,7 @@ using System;
using Entitas; using Entitas;
using JNGame.Runtime.Util.Types; using JNGame.Runtime.Util.Types;
namespace JNGame.Sync.Frame.Entity.Components namespace JNGame.Sync.Entity.Component
{ {
public class JNEntityLookup : JNLookup public class JNEntityLookup : JNLookup
{ {
@@ -3,8 +3,8 @@ using System.Collections.Generic;
using Entitas; using Entitas;
using JNGame.Runtime.Sync; using JNGame.Runtime.Sync;
using JNGame.Sync.Entity; using JNGame.Sync.Entity;
using JNGame.Sync.Entity.Component;
using JNGame.Sync.Frame.Entity.Component.Components; using JNGame.Sync.Frame.Entity.Component.Components;
using JNGame.Sync.Frame.Entity.Components;
using JNGame.Sync.System; using JNGame.Sync.System;
namespace JNGame.Sync.Frame.Entity namespace JNGame.Sync.Frame.Entity
@@ -3,7 +3,6 @@ using JNGame.Math;
using JNGame.Sync.Entity.Component; using JNGame.Sync.Entity.Component;
using JNGame.Sync.Frame.Entity; using JNGame.Sync.Frame.Entity;
using JNGame.Sync.Frame.Entity.Component.Components; using JNGame.Sync.Frame.Entity.Component.Components;
using JNGame.Sync.Frame.Entity.Components;
using JNGame.Sync.Frame.Service; using JNGame.Sync.Frame.Service;
using JNGame.Sync.System; using JNGame.Sync.System;
@@ -18,11 +18,19 @@ namespace JNGame.Runtime.Sync
public JNContexts Contexts; public JNContexts Contexts;
/// <summary>
/// 是否开始游戏
/// </summary>
public abstract bool IsStartGame { get; } public abstract bool IsStartGame { get; }
/// <summary>
/// 子线程
/// </summary>
private Thread thread; private Thread thread;
//执行时间 /// <summary>
/// 执行时间
/// </summary>
protected int TickTime; protected int TickTime;
@@ -114,7 +122,7 @@ namespace JNGame.Runtime.Sync
/// <param name="ms"></param> /// <param name="ms"></param>
public void MExecute(int ms = -1) public void MExecute(int ms = -1)
{ {
if (ms <= -1) ms = (int)Time.deltaTime * 1000; if (ms <= -1) ms = (int)(Time.deltaTime * 1000);
TickTime = ms; TickTime = ms;
Execute(); Execute();
} }
@@ -129,11 +137,11 @@ namespace JNGame.Runtime.Sync
thread = new Thread(() => thread = new Thread(() =>
{ {
while (thread.ThreadState != ThreadState.Aborted) while (thread is not null && thread.ThreadState != ThreadState.Aborted)
{ {
Thread.Sleep(ms); Thread.Sleep(ms);
TickTime = ms; TickTime = ms;
Execute(); if(thread is not null) Execute();
} }
}); });
thread.Start(); thread.Start();
@@ -147,7 +155,7 @@ namespace JNGame.Runtime.Sync
/// <summary> /// <summary>
/// 推逻辑帧 /// 推逻辑帧
/// </summary> /// </summary>
public void Simulate() protected virtual void Simulate()
{ {
#if (!ENTITAS_DISABLE_VISUAL_DEBUGGING && UNITY_EDITOR) #if (!ENTITAS_DISABLE_VISUAL_DEBUGGING && UNITY_EDITOR)
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 5ac3500978fa4ddea0bc31deeeb97fc8
timeCreated: 1729277104
@@ -1,8 +1,8 @@
using System; using System;
using JNGame.Math; using JNGame.Math;
using UnityEngine; using UnityEngine;
namespace Game.JNGState.Logic.Data namespace JNGame.Sync.System.Data.Type
{ {
[Serializable] [Serializable]
public class DValuePosition public class DValuePosition
@@ -31,5 +31,16 @@ namespace Game.JNGState.Logic.Data
{ {
return new LVector3(new LFloat(true,x), new LFloat(true,y), new LFloat(true,z)); return new LVector3(new LFloat(true,x), new LFloat(true,y), new LFloat(true,z));
} }
public static DValuePosition Build(LVector3 vec3)
{
return new DValuePosition()
{
x = vec3.x.rawValue,
y = vec3.y.rawValue,
z = vec3.z.rawValue,
};
}
} }
} }
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 61dc0f629c2e4039b3d0a3a09a6dd9e4
timeCreated: 1729277108
@@ -0,0 +1,24 @@
using GAS.Runtime;
using JNGame.Sync.System;
namespace JNGame.Runtime.Sync.System.Logic
{
/// <summary>
/// GAS 系统
/// </summary>
public class JNGASSystem : SLogicSystem
{
/// <summary>
/// GAS 管理器
/// </summary>
private JexGasManager _gas = new JexGasManager();
public JexGasManager GAS => _gas;
public override void OnSyncStart()
{
base.OnSyncStart();
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: a2ad6a2528004e829e468bd37c84b181
timeCreated: 1729280850
@@ -132,7 +132,7 @@ namespace JNGame.Sync.System.View
/// </summary> /// </summary>
/// <typeparam name="T"></typeparam> /// <typeparam name="T"></typeparam>
/// <returns></returns> /// <returns></returns>
public T Input<T>() where T : JNInputBase,new() public T UIInput<T>() where T : JNInputBase,new()
{ {
lock (UIInputs) lock (UIInputs)
{ {
@@ -145,10 +145,10 @@ namespace JNGame.Sync.System.View
} }
/// <summary> /// <summary>
/// 移出输入 /// 移出 UI 输入
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public JNFrameInputs Dequeue() public JNFrameInputs UIInputDequeue()
{ {
lock (UIInputs) lock (UIInputs)
{ {
@@ -169,7 +169,7 @@ namespace JNGame.Sync.System.View
/// <summary> /// <summary>
/// 移入输入 /// 移入输入
/// </summary> /// </summary>
public void UpdateSInputs() private void UpdateSInputs()
{ {
SInputs.Clear(); SInputs.Clear();
@@ -49,13 +49,6 @@ namespace JNGame.Sync.System
//数据集 //数据集
public ConcurrentDictionary<ulong, T> Data = new(); public ConcurrentDictionary<ulong, T> Data = new();
public virtual T[] Datas {
get
{
return Data.Values.ToArray();
}
}
public override void OnSyncStart() public override void OnSyncStart()
{ {
//设置数据唯一Id //设置数据唯一Id
@@ -3,7 +3,7 @@
namespace JNGame.Sync.System namespace JNGame.Sync.System
{ {
/// <summary> /// <summary>
/// 帧同步 - 视图系统 /// 视图系统
/// </summary> /// </summary>
public class SViewSystem : SBaseSystem,IJNSyncCycle,IExecuteSystem public class SViewSystem : SBaseSystem,IJNSyncCycle,IExecuteSystem
{ {
@@ -1,4 +1,5 @@
using System.Collections.Generic; using System.Collections.Concurrent;
using System.Collections.Generic;
using JNGame.Sync.System; using JNGame.Sync.System;
using UnityEngine; using UnityEngine;
@@ -29,9 +30,9 @@ namespace JNGame.Sync.View
{ {
Update++; Update++;
var dataList = GetData(); var dataList = GetData().Values;
bool isRest = dataList.Length != views.Count; bool isRest = dataList.Count != views.Count;
foreach (var data in dataList){ foreach (var data in dataList){
@@ -68,7 +69,7 @@ namespace JNGame.Sync.View
} }
public abstract void ViewUpdate(T data,GameObject view); public abstract void ViewUpdate(T data,GameObject view);
public abstract GameObject NewView(T data); public abstract GameObject NewView(T data);
public abstract T[] GetData(); public abstract ConcurrentDictionary<ulong, T> GetData();
public abstract void ViewRemove(GameObject view); public abstract void ViewRemove(GameObject view);
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ded57070405cfaa4f83d57d3d6a1f428
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,107 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &7403693568755579174
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1418229812123219311}
- component: {fileID: 2195934723901734943}
- component: {fileID: 6293353922950916548}
- component: {fileID: 5607204378896621617}
m_Layer: 0
m_Name: Cube
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1418229812123219311
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7403693568755579174}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 1, 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!33 &2195934723901734943
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7403693568755579174}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &6293353922950916548
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7403693568755579174}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!65 &5607204378896621617
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7403693568755579174}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 2e5d0c510b71c714aaccc714aca99afc
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -209,119 +209,14 @@ Transform:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 28019073} m_GameObject: {fileID: 28019073}
serializedVersion: 2
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0} m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!1 &857251289
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 857251293}
- component: {fileID: 857251292}
- component: {fileID: 857251291}
- component: {fileID: 857251290}
m_Layer: 0
m_Name: Cube
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!65 &857251290
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 857251289}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!23 &857251291
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 857251289}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!33 &857251292
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 857251289}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &857251293
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 857251289}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 1, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1745439352 --- !u!1 &1745439352
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -351,6 +246,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0c3aa2f58b904ebe9fc64cc367c63d68, type: 3} m_Script: {fileID: 11500000, guid: 0c3aa2f58b904ebe9fc64cc367c63d68, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
World: {fileID: 2144549411}
Box: {fileID: 7403693568755579174, guid: 2e5d0c510b71c714aaccc714aca99afc, type: 3}
--- !u!4 &1745439354 --- !u!4 &1745439354
Transform: Transform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -358,13 +255,13 @@ Transform:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1745439352} m_GameObject: {fileID: 1745439352}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2104190881 --- !u!1 &2104190881
GameObject: GameObject:
@@ -450,11 +347,50 @@ Transform:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2104190881} m_GameObject: {fileID: 2104190881}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: -10} m_LocalPosition: {x: 0, y: 1, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2144549411
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2144549412}
m_Layer: 0
m_Name: World
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2144549412
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2144549411}
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!1660057539 &9223372036854775807
SceneRoots:
m_ObjectHideFlags: 0
m_Roots:
- {fileID: 28019075}
- {fileID: 2104190884}
- {fileID: 2144549412}
- {fileID: 1745439354}
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: af2308f3772036840a24618e20d4371f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,20 @@
{
"name": "GASSamples.Editor",
"rootNamespace": "",
"references": [
"GUID:a6f7937b7f28906409a3ea3ceb2316c6",
"GUID:a035c483e4ff50f4c92f84afd22778cf",
"GUID:5f32be912cdeb7c4f8a601d2040de4e5",
"GUID:5b05c448a9d6e154e8eb3f1ef2291f24",
"GUID:f51ebe6a0ceec4240a699833d6309b23"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 1fa2098483891ae4a932af080478a6c8
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,18 @@
{
"name": "GASSamples",
"rootNamespace": "",
"references": [
"GUID:a035c483e4ff50f4c92f84afd22778cf",
"GUID:a6f7937b7f28906409a3ea3ceb2316c6",
"GUID:f51ebe6a0ceec4240a699833d6309b23"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 5b05c448a9d6e154e8eb3f1ef2291f24
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,18 @@
using JNGame.Runtime.System;
namespace GASSamples.Scripts
{
public class App
{
public static readonly JNGResService Resource = new JNGResService();
public static SystemBase[] AllSystem()
{
return new SystemBase[]
{
Resource
};
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: f3e00a9df020484eb50717285a43b5ef
timeCreated: 1729273609
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 878a2703693549d4b29a70a1977c5dc1
timeCreated: 1729273912
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 948b04fc24754ee587ad380cc15a923a
timeCreated: 1729276738
@@ -0,0 +1,57 @@
using System;
using System.Collections.Concurrent;
using GASSamples.Scripts.Game.Entity.Contexts;
using JNGame.Sync.System;
using JNGame.Sync.System.Data;
using JNGame.Sync.System.Data.Type;
using NotImplementedException = System.NotImplementedException;
namespace GASSamples.Scripts.Game.Logic.Data
{
public enum JNGASBoxValueCode : int
{
Auth = 201
}
[Serializable]
public class JNGASBoxValue
{
public DValuePosition Position = null;
}
public class JNGASBoxData : ISData
{
public JNGASBoxValue Value;
public override bool IsEquals(ISData data)
{
return true;
}
}
public class JNGASBoxDataSystem : SFrameDataSystem<JNGASBoxData>
{
public JNGASBoxContext NodeContext => Contexts.GetContext<JNGASBoxContext>();
private ConcurrentDictionary<ulong, JNGASBoxData> DataCache = new();
public override ConcurrentDictionary<ulong, JNGASBoxData> GetLatest()
{
DataCache.Clear();
foreach (var entity in NodeContext.GetEntities())
{
DataCache.TryAdd(entity.Id,new JNGASBoxData()
{
Value = new ()
{
Position = DValuePosition.Build(entity.Position)
}
});
}
return DataCache;
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 83c5b3168ed74b8e981a1fc232d7330d
timeCreated: 1729276758
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: ed36be30121349c08ceeaab6cef326f7
timeCreated: 1729275942
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 1887a92680244fa5a4b2035d03a3bc77
timeCreated: 1729276479
@@ -0,0 +1,14 @@
using GASSamples.Scripts.Game.Entity.Nodes;
using JNGame.Sync.Frame.Entity;
namespace GASSamples.Scripts.Game.Entity.Contexts
{
public class JNGASBoxContext : JNContext<JNGASBox>
{
protected override JNGASBox BindComponent(JNGASBox entity)
{
base.BindComponent(entity);
return entity;
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: be628b374d154c98b85694955b4cda4b
timeCreated: 1729276498
@@ -0,0 +1,13 @@
using Entitas;
using GASSamples.Scripts.Game.Entity.Contexts;
using JNGame.Sync.Entity;
namespace GASSamples.Scripts.Game.Entity
{
public class EDContexts : JNContexts
{
public override IContext[] allContexts { get; } = { new JNGASBoxContext() };
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 781261aba7f946b297d7c655cf953acd
timeCreated: 1729275955
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: c9ed407f62c44feaa88de076fbc503f3
timeCreated: 1729276082
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 52e508ba3ff44352bb0f463042536728
timeCreated: 1729276165
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: d7e90ad7c34d49eb90791ea5a1a9ffe8
timeCreated: 1729276182
@@ -0,0 +1,9 @@
using JNGame.Sync.Entity.Component;
namespace GASSamples.Scripts.Game.Entity.Nodes.Component.Lookup
{
public class JNGASBoxLookup : JNEntityLookup
{
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: ee66d5996b334ea1850e8bf9e150e15b
timeCreated: 1729276195
@@ -0,0 +1,14 @@
using GASSamples.Scripts.Game.Entity.Nodes.Component.Lookup;
using JNGame.Sync.Entity;
using JNGame.Sync.Entity.Component;
namespace GASSamples.Scripts.Game.Entity.Nodes
{
public class JNGASBox : JNEntity
{
public override JNEntityLookup NewCLookup()
{
return new JNGASBoxLookup();
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 69b1a0b196ea4395990aeabd34fe28fc
timeCreated: 1729276118
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 1393a03eb1b743a2a5347cbf505f3692
timeCreated: 1729273918
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using JNGame.Runtime.Util.Types;
using JNGame.Sync.System.View;
namespace Game.Input
{
public class DInputSystem : JNInputSystem
{
private KeyValue<Type, int> _tClass = new KeyValue<Type, int>();
protected override KeyValue<Type, int> TClass => _tClass;
protected override void OnInit()
{
base.OnInit();
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: a531fb10faef4b5ca7e947adb946d7df
timeCreated: 1729273925
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 21cf75d98dcc4a89855767a1e60af869
timeCreated: 1729275624
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 41ff96ba3e4748b5a1a2114a635f821a
timeCreated: 1729275629
@@ -0,0 +1,19 @@
using GASSamples.Scripts.Game.Entity.Contexts;
using JNGame.Math;
using JNGame.Sync.System;
namespace GASSamples.Scripts.Game.Logic.System
{
public class DWorldSystem : SLogicSystem
{
public JNGASBoxContext BoxContext => Contexts.GetContext<JNGASBoxContext>();
public override void OnSyncStart()
{
base.OnSyncStart();
BoxContext.CreateEntity();
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 1a28375952b744eb85bae40b66f7ef81
timeCreated: 1729275863
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: d7ad083af7024cf7855026315132abe5
timeCreated: 1729277967
@@ -0,0 +1,31 @@
using GASSamples.Scripts.Game.View.Entity;
using JNGame.Runtime.Util;
using JNGame.Sync.System;
using JNGame.Sync.View;
namespace GASSamples.Scripts.Game.View
{
public class DViewSystem : SViewSystem
{
private readonly IViewData[] views;
public DViewSystem()
{
views = new IViewData[] {
new VDBox(this), //显示Demo实体
};
}
public override void OnSyncUpdate(int dt)
{
base.OnSyncUpdate(dt);
foreach (var view in views)
{
//视图逻辑交给主线程运行
UnityMainThreadDispatcher.Instance.Enqueue(view.Execute);
}
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: d8f87d86e0a34f3b9719bebe4383fe29
timeCreated: 1729277970
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: ca9b410a5ca741b0b90219e999c290c9
timeCreated: 1729278058
@@ -0,0 +1,41 @@
using System.Collections.Concurrent;
using DG.Tweening;
using GASSamples.Scripts.Game.Logic.Data;
using JNGame.Sync.System;
using JNGame.Sync.View;
using UnityEngine;
namespace GASSamples.Scripts.Game.View.Entity
{
public class VDBox : ViewData<JNGASBoxData>
{
public GameObject World => App.Resource.World;
public GameObject Box => App.Resource.Box;
public VDBox(SViewSystem root) : base(root)
{
}
public override void ViewUpdate(JNGASBoxData data, GameObject view)
{
view.transform.DOMove(data.Value.Position.ToVector3(),0.5f);
}
public override GameObject NewView(JNGASBoxData data)
{
var view = Object.Instantiate(Box, World.transform);
view.name = $"Boss_{data.Id}";
return view;
}
public override ConcurrentDictionary<ulong, JNGASBoxData> GetData()
{
return GetService<JNGASBoxDataSystem>().Data;
}
public override void ViewRemove(GameObject view)
{
Object.Destroy(view);
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 6ad7eb0cc9c84346b06e5c32cda46266
timeCreated: 1729278090
@@ -0,0 +1,21 @@
using System.Threading.Tasks;
using JNGame.Network;
using UnityEngine;
namespace GASSamples.Scripts
{
public class JNGResService : JNServerBase
{
public GameObject World;
//Box
public GameObject Box;
public override Task OnInit()
{
return base.OnInit();
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 123c85e1eb584e4682234f65e4fe4ec9
timeCreated: 1729279133

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