mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
提交
This commit is contained in:
@@ -13,7 +13,7 @@ MonoBehaviour:
|
||||
m_Name: GE_Player
|
||||
m_EditorClassIdentifier: JNGame.Runtime:GAS.Runtime:GameplayEffectAsset
|
||||
description:
|
||||
durationPolicy: 1
|
||||
durationPolicy: 2
|
||||
duration: 0
|
||||
period: 0
|
||||
periodExecutionId: 0
|
||||
|
@@ -1,8 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using GAS.Runtime;
|
||||
using GASSamples.Scripts.Game.GAS;
|
||||
using JNGame.Runtime.Sync.System.Logic;
|
||||
using JNGame.Sync.Entity.Component;
|
||||
using UnityEngine;
|
||||
|
||||
namespace GASSamples.Scripts.Game.Entity.Nodes.Component.Components
|
||||
{
|
||||
@@ -32,7 +33,12 @@ namespace GASSamples.Scripts.Game.Entity.Nodes.Component.Components
|
||||
ASC.SetPreset(ascPreset);
|
||||
ASC.SetLevel(level);
|
||||
if (ASC.Preset == null) return;
|
||||
// ASC.Init(asc.PresetBaseTags(), asc.PresetAttributeSetTypes(), asc.Preset.LinkAbilities, entityId, level);
|
||||
|
||||
var attrSetTypes = new Type[ASC.Preset.AttributeSets.Length];
|
||||
for (var i = 0; i < ASC.Preset.AttributeSets.Length; i++)
|
||||
attrSetTypes[i] = GetSystem<JNGASSystem>().GetAttrSetTypeDict()[ASC.Preset.AttributeSets[i]];
|
||||
|
||||
ASC.Init(ASC.Preset.BaseTags, attrSetTypes, ASC.Preset.LinkAbilities, Entity.Id, level);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
using Game.Logic.System.Usual;
|
||||
using GAS.Runtime;
|
||||
using GASSamples.Scripts.Game.Entity.Nodes.Component.Components;
|
||||
using GASSamples.Scripts.Game.GAS;
|
||||
using JNGame.Runtime.Sync.System.Logic;
|
||||
using JNGame.Sync.Entity.Component;
|
||||
|
||||
@@ -17,13 +18,13 @@ namespace GASSamples.Scripts.Game.Entity.Nodes.Component.Controller
|
||||
base.OnSyncStart();
|
||||
|
||||
//设置GAS 角色
|
||||
// GAS.InitWithPreset(GetSystem<DDataSystem>().Preset,1);
|
||||
GAS.InitWithPreset(GetSystem<DGASSystem>().GetASCPresetAsset("ASC_Demo1"),1);
|
||||
|
||||
//附加效果测试
|
||||
// GAS.ApplyGameplayEffectToSelf(new GameplayEffect(GetSystem<DDataSystem>().GE_JisolDemo1));
|
||||
|
||||
//释放技能
|
||||
// GAS.TryActivateAbility(GAbilityLib.JisolDemo1.Name);
|
||||
GAS.TryActivateAbility(GAbilityLib.JisolDemo1.Name);
|
||||
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Game.Logic.System.Usual;
|
||||
using GAS.Runtime;
|
||||
using JNGame.Runtime.Sync.System.Logic;
|
||||
|
||||
namespace GASSamples.Scripts.Game.GAS
|
||||
{
|
||||
public class DGASSystem : JNGASSystem
|
||||
{
|
||||
|
||||
public override void OnInitAbilityAssetData()
|
||||
{
|
||||
SetAbilityAssetData(ByteToAbility(GetSystem<DDataSystem>().Ability));
|
||||
}
|
||||
|
||||
public override void OnInitGameplayEffectData()
|
||||
{
|
||||
SetGameplayEffectData(ByteToGE(GetSystem<DDataSystem>().GE));
|
||||
}
|
||||
|
||||
public override void OnInitASCPresetAssetData()
|
||||
{
|
||||
SetASCPresetAssetData(ByteToASC(GetSystem<DDataSystem>().ASC));
|
||||
}
|
||||
|
||||
public override Dictionary<string, Type> GetAttrSetTypeDict()
|
||||
{
|
||||
return GAttrSetLib.AttrSetTypeDict;
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eebf87e24e6740be8f5013969bca0ca3
|
||||
timeCreated: 1729652027
|
@@ -1,4 +1,5 @@
|
||||
using GAS.Runtime;
|
||||
using JNGame.Runtime.Sync.System.Logic;
|
||||
using JNGame.Sync.Entity;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -14,6 +15,7 @@ namespace GASSamples.Scripts.Game.GAS
|
||||
public GAbilitySystemComponent(IJNEntity entity)
|
||||
{
|
||||
Entity = entity;
|
||||
GASResService = Entity.GetContext().GetSync().GetSystem<JNGASSystem>();
|
||||
}
|
||||
|
||||
public override void OnGExecute(GameplayEffectSpec geSpec)
|
||||
|
@@ -12,12 +12,21 @@ namespace Game.Logic.System.Usual
|
||||
|
||||
public AbilitySystemComponentPreset Preset { get; private set; }
|
||||
public IGameplayEffectData GE_JisolDemo1 { get; private set; }
|
||||
|
||||
public byte[] Ability { get; private set; }
|
||||
public byte[] GE { get; private set; }
|
||||
public byte[] ASC { get; private set; }
|
||||
|
||||
public override void OnSyncStart()
|
||||
{
|
||||
base.OnSyncStart();
|
||||
Preset = App.Resource.Preset;
|
||||
GE_JisolDemo1 = App.Resource.GE_JisolDemo1;
|
||||
|
||||
Ability = App.Resource.Ability;
|
||||
GE = App.Resource.GE;
|
||||
ASC = App.Resource.ASC;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,27 @@
|
||||
///////////////////////////////////
|
||||
//// This is a generated file. ////
|
||||
//// Do not modify it. ////
|
||||
///////////////////////////////////
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace GAS.Runtime
|
||||
{
|
||||
public static class GASCPresetLib
|
||||
{
|
||||
public struct ASCPresetInfo
|
||||
{
|
||||
public string Name;
|
||||
public string AssetPath;
|
||||
}
|
||||
|
||||
public static ASCPresetInfo ASC_Demo1 = new ASCPresetInfo { Name = "ASC_Demo1", AssetPath = "Assets/Scripts/GASSamples/GAS/Config/AbilitySystemComponentLib/ASC_Demo1.asset"};
|
||||
|
||||
|
||||
public static Dictionary<string, ASCPresetInfo> ASCPresetMap = new Dictionary<string, ASCPresetInfo>
|
||||
{
|
||||
["ASC_Demo1"] = ASC_Demo1,
|
||||
};
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ec7b55df34c66be4d933fd550a032c52
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,28 @@
|
||||
///////////////////////////////////
|
||||
//// This is a generated file. ////
|
||||
//// Do not modify it. ////
|
||||
///////////////////////////////////
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace GAS.Runtime
|
||||
{
|
||||
public static class GAbilityLib
|
||||
{
|
||||
public struct AbilityInfo
|
||||
{
|
||||
public string Name;
|
||||
public string AssetPath;
|
||||
public Type AbilityClassType;
|
||||
}
|
||||
|
||||
public static AbilityInfo JisolDemo1 = new AbilityInfo { Name = "JisolDemo1", AssetPath = "Assets/Scripts/GASSamples/GAS/Config/GameplayAbilityLib/JisolDemo1.asset",AbilityClassType = typeof(GAS.Runtime.TimelineAbility) };
|
||||
|
||||
|
||||
public static Dictionary<string, AbilityInfo> AbilityMap = new Dictionary<string, AbilityInfo>
|
||||
{
|
||||
["JisolDemo1"] = JisolDemo1,
|
||||
};
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4f87dae0ef06e5b43a93fbe6c182c8c9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,27 @@
|
||||
///////////////////////////////////
|
||||
//// This is a generated file. ////
|
||||
//// Do not modify it. ////
|
||||
///////////////////////////////////
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace GAS.Runtime
|
||||
{
|
||||
public static class GGameplayEffectLib
|
||||
{
|
||||
public struct GameplayEffectAssetInfo
|
||||
{
|
||||
public string Name;
|
||||
public string AssetPath;
|
||||
}
|
||||
|
||||
public static GameplayEffectAssetInfo GE_Player = new GameplayEffectAssetInfo { Name = "GE_Player", AssetPath = "Assets/Scripts/GASSamples/GAS/Config/GameplayEffectLib/GE_Player.asset"};
|
||||
|
||||
|
||||
public static Dictionary<string, GameplayEffectAssetInfo> GameplayEffectMap = new Dictionary<string, GameplayEffectAssetInfo>
|
||||
{
|
||||
["GE_Player"] = GE_Player,
|
||||
};
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1c5edef4175b8f54fab71d79979e19af
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -18,10 +18,14 @@ namespace GASSamples.Scripts
|
||||
|
||||
//GE_JisolDemo1
|
||||
public IGameplayEffectData GE_JisolDemo1;
|
||||
|
||||
|
||||
public byte[] Ability;
|
||||
public byte[] GE;
|
||||
public byte[] ASC;
|
||||
|
||||
public override Task OnInit()
|
||||
{
|
||||
|
||||
return base.OnInit();
|
||||
}
|
||||
|
||||
|
@@ -13,6 +13,9 @@ namespace GASSamples.Scripts
|
||||
public GameObject Box;
|
||||
public AbilitySystemComponentPreset Preset;
|
||||
public GameplayEffectAsset GE_JisolDemo1;
|
||||
public TextAsset AbilityAsset;
|
||||
public TextAsset GEAsset;
|
||||
public TextAsset ASCAsset;
|
||||
|
||||
|
||||
private JNGASFrameSystem _frameSystem;
|
||||
@@ -28,6 +31,12 @@ namespace GASSamples.Scripts
|
||||
App.Resource.Preset = Preset;
|
||||
App.Resource.GE_JisolDemo1 = GE_JisolDemo1;
|
||||
|
||||
App.Resource.Ability = AbilityAsset.bytes;
|
||||
App.Resource.GE = GEAsset.bytes;
|
||||
App.Resource.ASC = ASCAsset.bytes;
|
||||
|
||||
|
||||
|
||||
_frameSystem = new JNGASFrameSystem();
|
||||
_frameSystem.Initialize();
|
||||
_frameSystem.TStartExecute();
|
||||
|
@@ -2,10 +2,10 @@ using Cysharp.Threading.Tasks;
|
||||
using Game.Input;
|
||||
using Game.Logic.System.Usual;
|
||||
using GASSamples.Scripts.Game.Entity;
|
||||
using GASSamples.Scripts.Game.GAS;
|
||||
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;
|
||||
@@ -22,7 +22,7 @@ namespace DefaultNamespace
|
||||
{
|
||||
new DInputSystem(), //游戏输入
|
||||
new DDataSystem(), //数据 系统
|
||||
new JNGASSystem(), //GAS 系统
|
||||
new DGASSystem(), //GAS 系统
|
||||
new DWorldSystem(), //世界逻辑
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user