This commit is contained in:
PC-20230316NUNE\Administrator
2024-02-01 19:06:51 +08:00
parent aa4d6c3ce2
commit 877dca3b43
7518 changed files with 653768 additions and 162059 deletions

View File

@@ -0,0 +1,16 @@
using Plugins.JNGame.Sync.Frame;
using Plugins.JNGame.Sync.Frame.game;
namespace Game.Plugins.App.Sync
{
public abstract class JNGSyncFrame<T> : JNSyncFrameComponent<T>
{
protected override JNSyncFrame GetSync()
{
return App.Sync;
}
public override void OnSyncLoad(){}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 54720b15a706406c974db4ac581e6dbc
timeCreated: 1706519239

View File

@@ -0,0 +1,11 @@
using UnityEngine;
namespace Game.Plugins.App.Sync
{
public class JNGSyncFrameDefault : JNGSyncFrame<Object>
{
public override void OnSyncUpdate(int dt, JNFrameInfo frame, Object input)
{
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 67efd019640f42afb3840659516d244a
timeCreated: 1706773209

View File

@@ -0,0 +1,52 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Plugins.JNGame.Sync.Frame.game;
using UnityEngine;
namespace Game.Plugins.App.Sync
{
public class JNGSyncFrameEntrust : JNGSyncFrameDefault
{
private IEnumerable<Component> _components;
public IEnumerable<Component> Components => _components;
public Component[] allow;
public override void OnSyncLoad()
{
//获取非同步的组件
_components = this.GetComponents<Component>()
.Where(item => !(item is IJNSyncFrameComponent))
.Where(item => !(item is Transform))
.Where(item => !(allow.Contains(item)));
Debug.Log($"{this.NID} 有{Components.Count()}组件不是同步组件 尝试接管同步 请保证被接管的组件有enabled 同时被接管的组件 enabled 禁止修改");
foreach (var component in Components)
{
var property = component.GetType().GetProperty("enabled");
if (property == null)
{
Debug.Log($"{this.NID} 有组件不是同步组件 并且没有 enabled 为了防止不同步 直接删除!");
Destroy(component);
continue;
}
property.SetValue(component,false);
}
_components = this.GetComponents<Component>()
.Where(item => !(item.GetType().IsAssignableFrom(typeof(IJNSyncFrameComponent))));
}
public override void OnSyncUpdate(int dt, JNFrameInfo frame, Object input)
{
base.OnSyncUpdate(dt, frame, input);
}
}
}

View File

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