提交Unity 联机Pro

This commit is contained in:
PC-20230316NUNE\Administrator
2024-08-17 14:27:18 +08:00
parent f00193b000
commit 894100ae37
7448 changed files with 854473 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 0cc4a62c9f984472a75d9dcce3e117bb
timeCreated: 1720864778

View File

@@ -0,0 +1,12 @@
using Entitas;
using JNGame.Math;
using JNGame.Sync.Entity.Component;
using JNGame.Sync.Frame.Entity.Components;
namespace JNGame.Sync.Frame.Entity.Component.Components
{
public class JNTransformComponent : JNComponent
{
public LVector3 Position = new();
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: de8c1bdf52c14049b969b7d4ec7052cd
timeCreated: 1720700573

View File

@@ -0,0 +1,30 @@
using Entitas;
using JNGame.Sync.System;
using NotImplementedException = System.NotImplementedException;
namespace JNGame.Sync.Entity.Component
{
/// <summary>
/// 组件
/// </summary>
public class JNComponent : IComponent,IJNSyncCycle
{
public IJNEntity Entity;
public void OnInit(IJNEntity entity)
{
this.Entity = entity;
}
public T GetSystem<T>() where T : SLogicSystem
{
return Entity.GetContext().GetSync().GetSystem<T>();
}
//生命周期
public virtual void OnSyncStart(){}
public virtual void OnSyncUpdate(){}
public virtual void OnSyncDestroy(){}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 1d7ede39ee1a4ac6a40ea7e0b5334765
timeCreated: 1720864842

View File

@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using Entitas;
using JNGame.EntitasExtend;
using JNGame.Sync.Frame.Entity.Component.Components;
using JNGame.Util.Types;
namespace JNGame.Sync.Frame.Entity.Components
{
public class JNEntityLookup : EntitasExtend.JNLookup
{
//位置组件
public int Transform { get; set; }
//绑定索引
protected override void BindIndex()
{
Transform = Next();
}
//绑定类型
protected override void BindType(KeyValue<int, Type> types)
{
types.Add(Transform,typeof(JNTransformComponent));
}
//查询组件
public T Query<T>(Entitas.Entity entity) where T : class, IComponent
{
return entity.GetComponent(GetIndex<T>()) as T;
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 76bb4b74188d47beb992777c9fc19d8c
timeCreated: 1720749419