mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
临时提交 我困了睡觉了
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c0b4adcd267e40ce862cac6801946216
|
||||
timeCreated: 1729283406
|
@@ -0,0 +1,39 @@
|
||||
using GAS.Runtime;
|
||||
using GASSamples.Scripts.Game.GAS;
|
||||
using JNGame.Runtime.Sync.System.Logic;
|
||||
using JNGame.Sync.Entity.Component;
|
||||
|
||||
namespace GASSamples.Scripts.Game.Entity.Nodes.Component.Components
|
||||
{
|
||||
public class JNGASComponent : JNComponent
|
||||
{
|
||||
|
||||
private GAbilitySystemComponent ASC = new ();
|
||||
|
||||
public override void OnSyncStart()
|
||||
{
|
||||
base.OnSyncStart();
|
||||
|
||||
//初始化ASC
|
||||
GetSystem<JNGASSystem>().Register(ASC);
|
||||
}
|
||||
|
||||
public void SetPreset(AbilitySystemComponentPreset ascPreset)
|
||||
{
|
||||
ASC.SetPreset(ascPreset);
|
||||
}
|
||||
|
||||
public void SetLevel(int level)
|
||||
{
|
||||
ASC.SetLevel(level);
|
||||
}
|
||||
|
||||
public override void OnSyncDestroy()
|
||||
{
|
||||
base.OnSyncDestroy();
|
||||
|
||||
//销毁ASC
|
||||
GetSystem<JNGASSystem>().Unregister(ASC);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: acdb37e4e7c0494084eed1be8171efc6
|
||||
timeCreated: 1729283417
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cef9fd36c2e54625bb161cf4062337b9
|
||||
timeCreated: 1729282849
|
@@ -0,0 +1,22 @@
|
||||
using GASSamples.Scripts.Game.Entity.Nodes.Component.Components;
|
||||
using JNGame.Sync.Entity.Component;
|
||||
|
||||
namespace GASSamples.Scripts.Game.Entity.Nodes.Component.Controller
|
||||
{
|
||||
public class JNGASBoxController : JNComponent
|
||||
{
|
||||
|
||||
public JNGASComponent GAS => Entity.GetComponent<JNGASComponent>();
|
||||
|
||||
public override void OnSyncStart()
|
||||
{
|
||||
|
||||
base.OnSyncStart();
|
||||
|
||||
//设置GAS 角色
|
||||
// GAS.SetPreset();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2ac7f2bb23fb47efb3a21d1160e962ac
|
||||
timeCreated: 1729282871
|
@@ -1,3 +1,7 @@
|
||||
using System;
|
||||
using GASSamples.Scripts.Game.Entity.Nodes.Component.Components;
|
||||
using GASSamples.Scripts.Game.Entity.Nodes.Component.Controller;
|
||||
using JNGame.Runtime.Util.Types;
|
||||
using JNGame.Sync.Entity.Component;
|
||||
|
||||
namespace GASSamples.Scripts.Game.Entity.Nodes.Component.Lookup
|
||||
@@ -5,5 +9,22 @@ namespace GASSamples.Scripts.Game.Entity.Nodes.Component.Lookup
|
||||
public class JNGASBoxLookup : JNEntityLookup
|
||||
{
|
||||
|
||||
public int Controller { get; set; }
|
||||
public int GAS { get; set; }
|
||||
|
||||
protected override void BindIndex()
|
||||
{
|
||||
base.BindIndex();
|
||||
Controller = Next();
|
||||
GAS = Next();
|
||||
}
|
||||
|
||||
protected override void BindType(KeyValue<int, Type> types)
|
||||
{
|
||||
base.BindType(types);
|
||||
types.Add(Controller,typeof(JNGASBoxController));
|
||||
types.Add(GAS,typeof(JNGASComponent));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -1,3 +1,4 @@
|
||||
using GASSamples.Scripts.Game.Entity.Nodes.Component.Controller;
|
||||
using GASSamples.Scripts.Game.Entity.Nodes.Component.Lookup;
|
||||
using JNGame.Sync.Entity;
|
||||
using JNGame.Sync.Entity.Component;
|
||||
@@ -6,9 +7,13 @@ namespace GASSamples.Scripts.Game.Entity.Nodes
|
||||
{
|
||||
public class JNGASBox : JNEntity
|
||||
{
|
||||
|
||||
public JNGASBoxController Controller => CLookup.Query<JNGASBoxController>(this);
|
||||
|
||||
public override JNEntityLookup NewCLookup()
|
||||
{
|
||||
return new JNGASBoxLookup();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
3
JNFrame2/Assets/Scripts/GASSamples/Scripts/Game/GAS.meta
Normal file
3
JNFrame2/Assets/Scripts/GASSamples/Scripts/Game/GAS.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 09af0fe6bc634405a389bf3e8640507c
|
||||
timeCreated: 1729283193
|
@@ -0,0 +1,11 @@
|
||||
using GAS.Runtime;
|
||||
|
||||
namespace GASSamples.Scripts.Game.GAS
|
||||
{
|
||||
|
||||
public class GAbilitySystemComponent : AbilitySystemComponent
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f91a65c731e64bceb375e9f6eb571dd1
|
||||
timeCreated: 1729283247
|
@@ -4,6 +4,7 @@ using GASSamples.Scripts.Game.Entity;
|
||||
using GASSamples.Scripts.Game.Logic.Data;
|
||||
using GASSamples.Scripts.Game.Logic.System;
|
||||
using GASSamples.Scripts.Game.View;
|
||||
using JNGame.Runtime.Sync.System.Logic;
|
||||
using JNGame.Sync.Entity;
|
||||
using JNGame.Sync.Frame;
|
||||
using JNGame.Sync.System;
|
||||
@@ -20,6 +21,7 @@ namespace DefaultNamespace
|
||||
{
|
||||
//基础数据
|
||||
new DInputSystem(), //游戏输入
|
||||
new JNGASSystem(), //GAS 系统
|
||||
new DWorldSystem(), //世界逻辑
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user