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,8 @@ MonoBehaviour:
|
||||
m_Name: ASC_Player
|
||||
m_EditorClassIdentifier:
|
||||
Description:
|
||||
AttributeSets: []
|
||||
AttributeSets:
|
||||
- BaseAttribute
|
||||
BaseTags: []
|
||||
BaseAbilities:
|
||||
- {fileID: 11400000, guid: b78ae002fbbf510419a39987f22201f1, type: 2}
|
||||
|
@@ -29,18 +29,25 @@ MonoBehaviour:
|
||||
DurationalCues:
|
||||
- trackName: "\u6301\u7EEDGameplayCue\u8F68\u9053"
|
||||
clipEvents:
|
||||
- startFrame: 6
|
||||
durationFrame: 34
|
||||
- startFrame: 0
|
||||
durationFrame: 53
|
||||
cue: {fileID: 11400000, guid: 0a77e9c8e20008944a99814e0b5a4aed, type: 2}
|
||||
InstantCues:
|
||||
- trackName: "\u5373\u65F6Cue\u8F68\u9053"
|
||||
markEvents: []
|
||||
markEvents:
|
||||
- startFrame: 55
|
||||
cues:
|
||||
- {fileID: 11400000, guid: 041f193225d7b1e49a75af0003a4111b, type: 2}
|
||||
ReleaseGameplayEffect:
|
||||
- trackName: "GameplayEffect\u91CA\u653E\u8F68\u9053"
|
||||
markEvents: []
|
||||
BuffGameplayEffects:
|
||||
- trackName: Buff
|
||||
clipEvents: []
|
||||
clipEvents:
|
||||
- startFrame: 8
|
||||
durationFrame: 30
|
||||
buffTarget: 0
|
||||
gameplayEffect: {fileID: 11400000, guid: 25ef9a2206b693c4f9b93af896a038a8, type: 2}
|
||||
InstantTasks:
|
||||
- trackName: "\u5373\u65F6Task\u8F68\u9053"
|
||||
markEvents: []
|
||||
|
@@ -15,5 +15,11 @@ MonoBehaviour:
|
||||
Description:
|
||||
RequiredTags: []
|
||||
ImmunityTags: []
|
||||
start: {x: 0, y: 0, z: 0}
|
||||
end: {x: 10, y: 0, z: 0}
|
||||
start:
|
||||
X: 0
|
||||
Y: 0
|
||||
Z: 0
|
||||
end:
|
||||
X: 10000
|
||||
Y: 0
|
||||
Z: 0
|
||||
|
@@ -0,0 +1,17 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 725500c3ce824f8daa3a4be247f4f131, type: 3}
|
||||
m_Name: GCue_PlayerDemo02
|
||||
m_EditorClassIdentifier:
|
||||
Description:
|
||||
RequiredTags: []
|
||||
ImmunityTags: []
|
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2aa1d58fb62dc104484f4f2bf1673303
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,73 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: b9395a0be3e547f48bd1c8320edc6c58, type: 3}
|
||||
m_Name: GE_JisolDemo1
|
||||
m_EditorClassIdentifier:
|
||||
Description: "\u7B80\u5355\u65BD\u52A0 debuff \u548C \u6263\u8840"
|
||||
DurationPolicy: 3
|
||||
Duration: 10000
|
||||
Period: 0
|
||||
PeriodExecution: {fileID: 0}
|
||||
Stacking:
|
||||
stackingType: 0
|
||||
stackingCodeName:
|
||||
limitCount: 0
|
||||
durationRefreshPolicy: 0
|
||||
periodResetPolicy: 0
|
||||
expirationPolicy: 0
|
||||
denyOverflowApplication: 0
|
||||
clearStackOnOverflow: 0
|
||||
overflowEffects: []
|
||||
GrantedAbilities: []
|
||||
Modifiers:
|
||||
- AttributeName: AS_BaseAttribute.HP
|
||||
AttributeSetName: AS_BaseAttribute
|
||||
AttributeShortName: HP
|
||||
ModiferMagnitude: 10
|
||||
Operation: 3
|
||||
MMC: {fileID: 11400000, guid: 331222964d02d1349b1a9c717605c8e9, type: 2}
|
||||
AssetTags:
|
||||
- _name: DeBuff
|
||||
_hashCode: -251087900
|
||||
_shortName: DeBuff
|
||||
_ancestorHashCodes:
|
||||
_ancestorNames: []
|
||||
- _name: Buff
|
||||
_hashCode: 937056111
|
||||
_shortName: Buff
|
||||
_ancestorHashCodes:
|
||||
_ancestorNames: []
|
||||
GrantedTags:
|
||||
- _name: Buff
|
||||
_hashCode: 937056111
|
||||
_shortName: Buff
|
||||
_ancestorHashCodes:
|
||||
_ancestorNames: []
|
||||
- _name: DeBuff
|
||||
_hashCode: -251087900
|
||||
_shortName: DeBuff
|
||||
_ancestorHashCodes:
|
||||
_ancestorNames: []
|
||||
ApplicationRequiredTags: []
|
||||
OngoingRequiredTags: []
|
||||
RemoveGameplayEffectsWithTags: []
|
||||
ApplicationImmunityTags: []
|
||||
CueOnExecute: []
|
||||
CueDurational: []
|
||||
CueOnAdd:
|
||||
- {fileID: 11400000, guid: 041f193225d7b1e49a75af0003a4111b, type: 2}
|
||||
CueOnRemove:
|
||||
- {fileID: 11400000, guid: 2aa1d58fb62dc104484f4f2bf1673303, type: 2}
|
||||
CueOnActivate: []
|
||||
CueOnDeactivate: []
|
||||
SnapshotPolicy: 0
|
||||
SpecifiedSnapshotConfigs: []
|
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 25ef9a2206b693c4f9b93af896a038a8
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,15 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: b964e9ee395740d6b0f8e42978c1ba35, type: 3}
|
||||
m_Name: MMC_AttrModCalculation
|
||||
m_EditorClassIdentifier:
|
||||
Description: "\u57FA\u7840\u8FD0\u7B97"
|
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 331222964d02d1349b1a9c717605c8e9
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,17 +0,0 @@
|
||||
using GAS.Runtime;
|
||||
using JNGame.Sync.Entity;
|
||||
|
||||
namespace GASSamples.Scripts
|
||||
{
|
||||
public class AbilitySystemSamplesComponent : AbilitySystemComponent
|
||||
{
|
||||
|
||||
public JNEntity Entity { get; protected set; }
|
||||
|
||||
public AbilitySystemSamplesComponent(JNEntity entity)
|
||||
{
|
||||
Entity = entity;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1384fe4e23ec4d718ac4df20198da171
|
||||
timeCreated: 1729247365
|
@@ -1,5 +1,9 @@
|
||||
using GAS.General;
|
||||
using GAS.Runtime;
|
||||
using GASSamples.Scripts;
|
||||
using GASSamples.Scripts.Game.GAS;
|
||||
using JNGame.Math;
|
||||
using JNGame.Runtime.Odin.TypeCustomize;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -10,10 +14,10 @@ namespace Demo.Scripts.GAS.GameplayCue
|
||||
|
||||
[BoxGroup]
|
||||
[LabelText("开始位置")]
|
||||
public Vector3 start;
|
||||
public OdinLVector3 start;
|
||||
[BoxGroup]
|
||||
[LabelText("结束位置")]
|
||||
public Vector3 end;
|
||||
public OdinLVector3 end;
|
||||
|
||||
public override GameplayCueDurationalSpec CreateSpec(GameplayCueParameters parameters)
|
||||
{
|
||||
@@ -23,11 +27,11 @@ namespace Demo.Scripts.GAS.GameplayCue
|
||||
#if UNITY_EDITOR
|
||||
public override void OnEditorPreview(GameObject previewObject, int frameIndex, int startFrame, int endFrame)
|
||||
{
|
||||
Debug.Log($"GameplayCue_PlayerDemo01 {previewObject} {frameIndex}");
|
||||
Debug.Log($"GameplayCueDurational_PlayerDemo01 {previewObject} {frameIndex}");
|
||||
|
||||
if (frameIndex >= startFrame && frameIndex <= endFrame)
|
||||
{
|
||||
previewObject.transform.position = Vector3.Lerp(start, end, (float)(frameIndex - startFrame) / endFrame);
|
||||
previewObject.transform.position = Vector3.Lerp(start.ToVector3(), end.ToVector3(), (float)(frameIndex - startFrame) / endFrame);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -38,13 +42,10 @@ namespace Demo.Scripts.GAS.GameplayCue
|
||||
public class GameplayCueDurational_PlayerDemo01_Spec : GameplayCueDurationalSpec<GameplayCueDurational_PlayerDemo01>
|
||||
{
|
||||
|
||||
private GameplayCueDurational_PlayerDemo01 Cue;
|
||||
|
||||
public GameplayCueDurational_PlayerDemo01_Spec(GameplayCueDurational_PlayerDemo01 cue, GameplayCueParameters parameters) : base(cue, parameters)
|
||||
{
|
||||
Cue = cue;
|
||||
}
|
||||
|
||||
|
||||
public override void OnAdd(int frame,int startFrame,int endFrame)
|
||||
{
|
||||
Debug.Log("GameplayCueDurational_PlayerDemo01_Spec OnAdd");
|
||||
@@ -67,7 +68,10 @@ namespace Demo.Scripts.GAS.GameplayCue
|
||||
|
||||
public override void OnTick(int frame,int startFrame,int endFrame)
|
||||
{
|
||||
|
||||
Debug.Log($"GameplayCueDurational_PlayerDemo01_Spec OnTick {frame}");
|
||||
((GAbilitySystemComponent)Owner).Entity.Transform.Position = LVector3.Lerp(cue.start.ToLVector3(), cue.end.ToLVector3(), (LFloat)(frame - startFrame) / endFrame);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,6 @@
|
||||
using GAS.Runtime;
|
||||
using GASSamples.Scripts.Game.GAS;
|
||||
using JNGame.Math;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Demo.Scripts.GAS.GameplayCue
|
||||
@@ -10,14 +12,6 @@ namespace Demo.Scripts.GAS.GameplayCue
|
||||
Debug.Log($"GameplayCue_PlayerDemo01 CreateSpec");
|
||||
return new GameplayCue_PlayerDemo01_Spec(this,parameters);
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
public override void OnEditorPreview(GameObject previewObject, int frame, int startFrame)
|
||||
{
|
||||
Debug.Log($"GameplayCue_PlayerDemo01 {previewObject}");
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
public class GameplayCue_PlayerDemo01_Spec : GameplayCueInstantSpec
|
||||
@@ -29,6 +23,7 @@ namespace Demo.Scripts.GAS.GameplayCue
|
||||
|
||||
public override void Trigger()
|
||||
{
|
||||
((GAbilitySystemComponent)Owner).Entity.Transform.Scale = new LVector3(LFloat.L05,LFloat.L05,LFloat.L05);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,32 @@
|
||||
using GAS.Runtime;
|
||||
using GASSamples.Scripts.Game.GAS;
|
||||
using JNGame.Math;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Demo.Scripts.GAS.GameplayCue
|
||||
{
|
||||
public class GameplayCue_PlayerDemo02 : GameplayCueInstant
|
||||
{
|
||||
public override GameplayCueInstantSpec CreateSpec(GameplayCueParameters parameters)
|
||||
{
|
||||
Debug.Log($"GameplayCue_PlayerDemo02 CreateSpec");
|
||||
return new GameplayCue_PlayerDemo02_Spec(this,parameters);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class GameplayCue_PlayerDemo02_Spec : GameplayCueInstantSpec
|
||||
{
|
||||
|
||||
public GameplayCue_PlayerDemo02_Spec(GameplayCueInstant cue, GameplayCueParameters parameters) : base(cue, parameters)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Trigger()
|
||||
{
|
||||
((GAbilitySystemComponent)Owner).Entity.Transform.Scale = new LVector3(1,1,1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 725500c3ce824f8daa3a4be247f4f131
|
||||
timeCreated: 1729419424
|
3
JNFrame2/Assets/Scripts/GASSamples/Scripts/GAS/MMC.meta
Normal file
3
JNFrame2/Assets/Scripts/GASSamples/Scripts/GAS/MMC.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dd4c4a195812409f935d57313ac16614
|
||||
timeCreated: 1729418595
|
@@ -0,0 +1,19 @@
|
||||
using GAS.Runtime;
|
||||
using JNGame.Math;
|
||||
using UnityEngine;
|
||||
|
||||
namespace GASSamples.Scripts.GAS.MMC
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 基础运算
|
||||
/// </summary>
|
||||
[CreateAssetMenu(fileName = "AttrModCalculation", menuName = "GAS/MMC/AttrModCalculation")]
|
||||
public class AttrModCalculation : ModifierMagnitudeCalculation
|
||||
{
|
||||
public override float CalculateMagnitude(GameplayEffectSpec spec, float modifierMagnitude)
|
||||
{
|
||||
return modifierMagnitude;
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b964e9ee395740d6b0f8e42978c1ba35
|
||||
timeCreated: 1729418602
|
@@ -4,6 +4,7 @@ using GASSamples.Scripts.Game.Entity.Contexts;
|
||||
using JNGame.Sync.System;
|
||||
using JNGame.Sync.System.Data;
|
||||
using JNGame.Sync.System.Data.Type;
|
||||
using UnityEngine.Serialization;
|
||||
using NotImplementedException = System.NotImplementedException;
|
||||
|
||||
namespace GASSamples.Scripts.Game.Logic.Data
|
||||
@@ -17,7 +18,8 @@ namespace GASSamples.Scripts.Game.Logic.Data
|
||||
[Serializable]
|
||||
public class JNGASBoxValue
|
||||
{
|
||||
public DValuePosition Position = null;
|
||||
public NDataLVector3 Position = null;
|
||||
public NDataLVector3 Scale = null;
|
||||
}
|
||||
|
||||
public class JNGASBoxData : ISData
|
||||
@@ -47,7 +49,8 @@ namespace GASSamples.Scripts.Game.Logic.Data
|
||||
{
|
||||
Value = new ()
|
||||
{
|
||||
Position = DValuePosition.Build(entity.Position)
|
||||
Position = NDataLVector3.Build(entity.Position),
|
||||
Scale = NDataLVector3.Build(entity.Scale)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@@ -1,39 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
using GAS.Runtime;
|
||||
|
||||
namespace GASSamples.Scripts.Game.GAS
|
||||
{
|
||||
|
||||
public class GAbilitySystemComponent : AbilitySystemComponent
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,54 @@
|
||||
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
|
||||
{
|
||||
public class JNGASComponent : JNComponent
|
||||
{
|
||||
|
||||
private GAbilitySystemComponent _asc;
|
||||
public GAbilitySystemComponent ASC => _asc;
|
||||
|
||||
public override void OnSyncStart()
|
||||
{
|
||||
base.OnSyncStart();
|
||||
_asc = new (Entity);
|
||||
//注册ASC
|
||||
GetSystem<JNGASSystem>().Register(ASC);
|
||||
}
|
||||
|
||||
public override void OnSyncDestroy()
|
||||
{
|
||||
base.OnSyncDestroy();
|
||||
//取消注册ASC
|
||||
GetSystem<JNGASSystem>().Unregister(ASC);
|
||||
}
|
||||
|
||||
public void InitWithPreset(AbilitySystemComponentPreset ascPreset,int level)
|
||||
{
|
||||
ASC.SetPreset(ascPreset);
|
||||
ASC.SetLevel(level);
|
||||
ASC.InitWithPreset(ASC.Level,ASC.Preset);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 附加效果给自己
|
||||
/// </summary>
|
||||
public void ApplyGameplayEffectToSelf(GameplayEffect gameplayEffect)
|
||||
{
|
||||
ASC.ApplyGameplayEffectToSelf(gameplayEffect);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 激活技能
|
||||
/// </summary>
|
||||
public void TryActivateAbility(string name)
|
||||
{
|
||||
ASC.TryActivateAbility(name);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -1,4 +1,7 @@
|
||||
using Game.Logic.System.Usual;
|
||||
using GAS.Runtime;
|
||||
using GASSamples.Scripts.Game.Entity.Nodes.Component.Components;
|
||||
using JNGame.Runtime.Sync.System.Logic;
|
||||
using JNGame.Sync.Entity.Component;
|
||||
|
||||
namespace GASSamples.Scripts.Game.Entity.Nodes.Component.Controller
|
||||
@@ -10,13 +13,19 @@ namespace GASSamples.Scripts.Game.Entity.Nodes.Component.Controller
|
||||
|
||||
public override void OnSyncStart()
|
||||
{
|
||||
|
||||
|
||||
base.OnSyncStart();
|
||||
|
||||
//设置GAS 角色
|
||||
// GAS.SetPreset();
|
||||
|
||||
|
||||
GAS.InitWithPreset(GetSystem<DDataSystem>().Preset,1);
|
||||
|
||||
//附加效果测试
|
||||
// GAS.ApplyGameplayEffectToSelf(new GameplayEffect(GetSystem<DDataSystem>().GE_JisolDemo1));
|
||||
|
||||
//释放技能
|
||||
GAS.TryActivateAbility(GAbilityLib.JisolDemo1.Name);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@@ -15,15 +15,15 @@ namespace GASSamples.Scripts.Game.Entity.Nodes.Component.Lookup
|
||||
protected override void BindIndex()
|
||||
{
|
||||
base.BindIndex();
|
||||
Controller = Next();
|
||||
GAS = Next();
|
||||
Controller = Next();
|
||||
}
|
||||
|
||||
protected override void BindType(KeyValue<int, Type> types)
|
||||
{
|
||||
base.BindType(types);
|
||||
types.Add(Controller,typeof(JNGASBoxController));
|
||||
types.Add(GAS,typeof(JNGASComponent));
|
||||
types.Add(Controller,typeof(JNGASBoxController));
|
||||
}
|
||||
|
||||
}
|
@@ -1,4 +1,6 @@
|
||||
using GASSamples.Scripts.Game.Entity.Nodes;
|
||||
using GASSamples.Scripts.Game.Entity.Nodes.Component.Components;
|
||||
using GASSamples.Scripts.Game.Entity.Nodes.Component.Controller;
|
||||
using JNGame.Sync.Frame.Entity;
|
||||
|
||||
namespace GASSamples.Scripts.Game.Entity.Contexts
|
||||
@@ -8,6 +10,8 @@ namespace GASSamples.Scripts.Game.Entity.Contexts
|
||||
protected override JNGASBox BindComponent(JNGASBox entity)
|
||||
{
|
||||
base.BindComponent(entity);
|
||||
entity.AddComponent<JNGASComponent>();
|
||||
entity.AddComponent<JNGASBoxController>();
|
||||
return entity;
|
||||
}
|
||||
}
|
@@ -1,3 +1,4 @@
|
||||
using GASSamples.Scripts.Game.Entity.Nodes.Component.Components;
|
||||
using GASSamples.Scripts.Game.Entity.Nodes.Component.Controller;
|
||||
using GASSamples.Scripts.Game.Entity.Nodes.Component.Lookup;
|
||||
using JNGame.Sync.Entity;
|
||||
@@ -8,6 +9,7 @@ namespace GASSamples.Scripts.Game.Entity.Nodes
|
||||
public class JNGASBox : JNEntity
|
||||
{
|
||||
|
||||
public JNGASComponent GAS => CLookup.Query<JNGASComponent>(this);
|
||||
public JNGASBoxController Controller => CLookup.Query<JNGASBoxController>(this);
|
||||
|
||||
public override JNEntityLookup NewCLookup()
|
@@ -0,0 +1,20 @@
|
||||
using GAS.Runtime;
|
||||
using JNGame.Sync.Entity;
|
||||
|
||||
namespace GASSamples.Scripts.Game.GAS
|
||||
{
|
||||
|
||||
public class GAbilitySystemComponent : AbilitySystemComponent
|
||||
{
|
||||
|
||||
|
||||
public IJNEntity Entity { get; protected set; }
|
||||
|
||||
public GAbilitySystemComponent(IJNEntity entity)
|
||||
{
|
||||
Entity = entity;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 796b9c926a8f40ab9361c6955888747c
|
||||
timeCreated: 1729410298
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ae051ac88cb04928b9d55f4e7c6fdc07
|
||||
timeCreated: 1729410272
|
@@ -0,0 +1,23 @@
|
||||
using GAS.Runtime;
|
||||
using GASSamples.Scripts;
|
||||
using JNGame.Sync.System;
|
||||
|
||||
namespace Game.Logic.System.Usual
|
||||
{
|
||||
/// <summary>
|
||||
/// 游戏数据
|
||||
/// </summary>
|
||||
public class DDataSystem : SLogicSystem
|
||||
{
|
||||
|
||||
public AbilitySystemComponentPreset Preset { get; private set; }
|
||||
public IGameplayEffectData GE_JisolDemo1 { get; private set; }
|
||||
|
||||
public override void OnSyncStart()
|
||||
{
|
||||
base.OnSyncStart();
|
||||
Preset = App.Resource.Preset;
|
||||
GE_JisolDemo1 = App.Resource.GE_JisolDemo1;
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 743622b492f0406895154855d13ed6db
|
||||
timeCreated: 1729410339
|
@@ -19,12 +19,13 @@ namespace GASSamples.Scripts.Game.View.Entity
|
||||
public override void ViewUpdate(JNGASBoxData data, GameObject view)
|
||||
{
|
||||
view.transform.DOMove(data.Value.Position.ToVector3(),0.5f);
|
||||
view.transform.DOScale(data.Value.Scale.ToVector3(),0.5f);
|
||||
}
|
||||
|
||||
public override GameObject NewView(JNGASBoxData data)
|
||||
{
|
||||
var view = Object.Instantiate(Box, World.transform);
|
||||
view.name = $"Boss_{data.Id}";
|
||||
view.name = $"Box_{data.Id}";
|
||||
return view;
|
||||
}
|
||||
|
||||
|
@@ -17,7 +17,7 @@ namespace GAS.Runtime
|
||||
public Type AbilityClassType;
|
||||
}
|
||||
|
||||
public static AbilityInfo JisolDemo1 = new AbilityInfo { Name = "JisolDemo1", AssetPath = "Assets/Demo/GAS/Config/GameplayAbilityLib/JisolDemo1.asset",AbilityClassType = typeof(GAS.Runtime.TimelineAbility) };
|
||||
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>
|
||||
|
@@ -9,10 +9,13 @@ namespace GAS.Runtime
|
||||
{
|
||||
public static class GAttrLib
|
||||
{
|
||||
/// <summary>血量</summary>
|
||||
public const string HP = "HP";
|
||||
|
||||
// For facilitating the creation of a Value Dropdown in the editor.
|
||||
public static readonly IReadOnlyList<string> AttributeNames = new List<string>
|
||||
{
|
||||
HP,
|
||||
};
|
||||
}
|
||||
}
|
@@ -8,18 +8,68 @@ using System.Collections.Generic;
|
||||
|
||||
namespace GAS.Runtime
|
||||
{
|
||||
public class AS_BaseAttribute : AttributeSet
|
||||
{
|
||||
#region HP
|
||||
|
||||
/// <summary>血量</summary>
|
||||
public AttributeBase HP { get; } = new("AS_BaseAttribute", "HP", 0f, CalculateMode.Stacking, (SupportedOperation)31, float.MinValue, float.MaxValue);
|
||||
|
||||
public void InitHP(float value) => HP.Init(value);
|
||||
public void SetCurrentHP(float value) => HP.SetCurrentValue(value);
|
||||
public void SetBaseHP(float value) => HP.SetBaseValue(value);
|
||||
public void SetMinHP(float value) => HP.SetMinValue(value);
|
||||
public void SetMaxHP(float value) => HP.SetMaxValue(value);
|
||||
public void SetMinMaxHP(float min, float max) => HP.SetMinMaxValue(min, max);
|
||||
|
||||
#endregion HP
|
||||
|
||||
public override AttributeBase this[string key]
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (key)
|
||||
{
|
||||
case "HP":
|
||||
return HP;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public override string[] AttributeNames { get; } =
|
||||
{
|
||||
"HP",
|
||||
};
|
||||
|
||||
public override void SetOwner(AbilitySystemComponent owner)
|
||||
{
|
||||
_owner = owner;
|
||||
HP.SetOwner(owner);
|
||||
}
|
||||
|
||||
public static class Lookup
|
||||
{
|
||||
public const string HP = "AS_BaseAttribute.HP";
|
||||
}
|
||||
}
|
||||
|
||||
public static class GAttrSetLib
|
||||
{
|
||||
public static readonly IReadOnlyDictionary<string, Type> AttrSetTypeDict = new Dictionary<string, Type>
|
||||
{
|
||||
{ "BaseAttribute", typeof(AS_BaseAttribute) },
|
||||
};
|
||||
|
||||
public static readonly IReadOnlyDictionary<Type, string> TypeToName = new Dictionary<Type, string>
|
||||
{
|
||||
{ typeof(AS_BaseAttribute), nameof(AS_BaseAttribute) },
|
||||
};
|
||||
|
||||
public static readonly IReadOnlyList<string> AttributeFullNames = new List<string>
|
||||
{
|
||||
"AS_BaseAttribute.HP",
|
||||
};
|
||||
}
|
||||
}
|
@@ -9,12 +9,16 @@ namespace GAS.Runtime
|
||||
{
|
||||
public static class GTagLib
|
||||
{
|
||||
/// <summary>Ability</summary>
|
||||
public static GameplayTag Ability { get; } = new("Ability");
|
||||
/// <summary>Buff</summary>
|
||||
public static GameplayTag Buff { get; } = new("Buff");
|
||||
|
||||
/// <summary>DeBuff</summary>
|
||||
public static GameplayTag DeBuff { get; } = new("DeBuff");
|
||||
|
||||
public static readonly IReadOnlyDictionary<string, GameplayTag> TagMap = new Dictionary<string, GameplayTag>
|
||||
{
|
||||
["Ability"] = Ability,
|
||||
["Buff"] = Buff,
|
||||
["DeBuff"] = DeBuff,
|
||||
};
|
||||
}
|
||||
}
|
@@ -1,4 +1,5 @@
|
||||
using System.Threading.Tasks;
|
||||
using GAS.Runtime;
|
||||
using JNGame.Network;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -11,11 +12,18 @@ namespace GASSamples.Scripts
|
||||
|
||||
//Box
|
||||
public GameObject Box;
|
||||
|
||||
//Preset
|
||||
public AbilitySystemComponentPreset Preset;
|
||||
|
||||
//GE_JisolDemo1
|
||||
public IGameplayEffectData GE_JisolDemo1;
|
||||
|
||||
public override Task OnInit()
|
||||
{
|
||||
|
||||
return base.OnInit();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using DefaultNamespace;
|
||||
using GAS.Runtime;
|
||||
using JNGame.Runtime;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -10,7 +11,10 @@ namespace GASSamples.Scripts
|
||||
|
||||
public GameObject World;
|
||||
public GameObject Box;
|
||||
public AbilitySystemComponentPreset Preset;
|
||||
public GameplayEffectAsset GE_JisolDemo1;
|
||||
|
||||
|
||||
private JNGASFrameSystem _frameSystem;
|
||||
private int _totalTime;
|
||||
private int _frameIndex;
|
||||
@@ -21,6 +25,8 @@ namespace GASSamples.Scripts
|
||||
await JNetGame.Instance.Init(App.AllSystem());
|
||||
App.Resource.World = World;
|
||||
App.Resource.Box = Box;
|
||||
App.Resource.Preset = Preset;
|
||||
App.Resource.GE_JisolDemo1 = GE_JisolDemo1;
|
||||
|
||||
_frameSystem = new JNGASFrameSystem();
|
||||
_frameSystem.Initialize();
|
||||
@@ -35,6 +41,7 @@ namespace GASSamples.Scripts
|
||||
//自动推帧
|
||||
if (_totalTime >= _frameSystem.NSyncTime)
|
||||
{
|
||||
_totalTime -= _frameSystem.NSyncTime;
|
||||
_frameSystem.AddFrame(new JNFrameInfo()
|
||||
{
|
||||
Index = _frameIndex++
|
||||
|
@@ -1,5 +1,6 @@
|
||||
using Cysharp.Threading.Tasks;
|
||||
using Game.Input;
|
||||
using Game.Logic.System.Usual;
|
||||
using GASSamples.Scripts.Game.Entity;
|
||||
using GASSamples.Scripts.Game.Logic.Data;
|
||||
using GASSamples.Scripts.Game.Logic.System;
|
||||
@@ -19,8 +20,8 @@ namespace DefaultNamespace
|
||||
{
|
||||
return new SLogicSystem[]
|
||||
{
|
||||
//基础数据
|
||||
new DInputSystem(), //游戏输入
|
||||
new DDataSystem(), //数据 系统
|
||||
new JNGASSystem(), //GAS 系统
|
||||
new DWorldSystem(), //世界逻辑
|
||||
};
|
||||
|
Reference in New Issue
Block a user