提交GAS

This commit is contained in:
PC-20230316NUNE\Administrator
2024-10-23 20:13:31 +08:00
parent 1953e7c25f
commit 9303606b31
28 changed files with 4203 additions and 3300 deletions

View File

@@ -61,7 +61,7 @@ namespace GAS.Editor
{
if (frameIndex < startFrame || frameIndex > endFrame) return;
var ongoingAbilityTask = TaskClipData.Load();
ongoingAbilityTask.OnEditorPreview( frameIndex, startFrame, endFrame);
ongoingAbilityTask.OnEditorPreview( AbilityTimelineEditorWindow.Instance.PreviewObject,frameIndex, startFrame, endFrame);
}
public override UnityEngine.Object DataInspector => TaskClipEditor.Create(this);

View File

@@ -174,14 +174,16 @@ namespace GAS.Editor
var assembly = assemblies[i];
if (assembly == null) { continue; }
var assName = assembly.GetName().Name;
if (!"GAS.UnityExt.Runtime".Equals(assName)) { continue; }
if ("JNGame.Runtime".Equals(assName)) { continue; }
if ("JNGame.Root".Equals(assName)) { continue; }
if ("JNGame.Editor".Equals(assName)) { continue; }
// 筛选非抽象的ModifierMagnitudeCalculation派生类
var lst = assembly.GetTypes().Where(
clsType => !clsType.IsAbstract && clsType.IsSubclassOf(typeof(ModifierMagnitudeCalculation)) && outFilter.IndexOf(clsType.Name) < 0
);
subTypeFromScriptableMMC.AddRange(lst);
}
var dir = "Assets/GameScript/HotFix/GAS.UnityExt/Runtime/CodeGen";// gasSetting.LogicCodeGeneratePath;
var dir = gasSetting.LogicCodeGeneratePath;// gasSetting.LogicCodeGeneratePath;
CodeGenScriptableMMCInjecter.GenCode(new CodeGenInfo()
{
codeGenNameSpace = "JNGame.GAS",

View File

@@ -1,5 +1,6 @@

using JNGame.Serialization;
using UnityEngine;
namespace GAS.Runtime
{
@@ -13,10 +14,11 @@ namespace GAS.Runtime
/// 编辑器预览用
/// 【注意】 覆写时记得用UNITY_EDITOR宏包裹这是预览表现用的函数不该被编译。
/// </summary>
/// <param name="preview"></param>
/// <param name="frame"></param>
/// <param name="startFrame"></param>
/// <param name="endFrame"></param>
public virtual void OnEditorPreview(int frame, int startFrame, int endFrame)
public virtual void OnEditorPreview(GameObject preview,int frame, int startFrame, int endFrame)
{
}
#endif

View File

@@ -18,7 +18,7 @@ namespace JNGame.Runtime.GAS.Runtime
#endif
//---------------- 全局信息 ------------------------------------------------------------------------------------------
private static int _TimeLineAbilityTickTime = 20;
private static int _TimeLineAbilityTickTime = 100;
public static int TimeLineAbilityTickTime => _TimeLineAbilityTickTime;
public static int FrameRateValue => 1000 / _TimeLineAbilityTickTime;

View File

@@ -289,7 +289,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!4 &1449950259
Transform:
m_ObjectHideFlags: 0

View File

@@ -23,11 +23,13 @@ namespace JNGame.GAS
private void OnStartChanged()
{
_task.start = start;
Save();
}
private void OnEndChanged()
{
_task.end = end;
Save();
}

View File

@@ -27,16 +27,10 @@ MonoBehaviour:
frameCount: 60
durationalCues:
- trackName: "\u6301\u7EEDGameplayCue\u8F68\u9053"
clipEvents:
- startFrame: 0
durationFrame: 53
cue: {fileID: 11400000, guid: 0a77e9c8e20008944a99814e0b5a4aed, type: 2}
clipEvents: []
instantCues:
- trackName: "\u5373\u65F6Cue\u8F68\u9053"
markEvents:
- startFrame: 55
cues:
- {fileID: 11400000, guid: 041f193225d7b1e49a75af0003a4111b, type: 2}
markEvents: []
releaseGameplayEffect:
- trackName: "GameplayEffect\u91CA\u653E\u8F68\u9053"
markEvents: []
@@ -53,12 +47,12 @@ MonoBehaviour:
ongoingTasks:
- trackName: Task Clips
clipEvents:
- startFrame: 19
durationFrame: 20
- startFrame: 9
durationFrame: 46
ongoingTask:
taskData:
Type: JNGame.GAS.OngoingAbility_Debug
Data: '{"start":{"x":{"rawValue":0,"MilliRawValue":0},"y":{"rawValue":0,"MilliRawValue":0},"z":{"rawValue":0,"MilliRawValue":0},"RawX":0,"RawY":0,"RawZ":0,"Magnitude":{"rawValue":0,"MilliRawValue":0},"SqrMagnitude":{"rawValue":0,"MilliRawValue":0},"RawSqrMagnitude":0},"end":{"x":{"rawValue":0,"MilliRawValue":0},"y":{"rawValue":0,"MilliRawValue":0},"z":{"rawValue":0,"MilliRawValue":0},"RawX":0,"RawY":0,"RawZ":0,"Magnitude":{"rawValue":0,"MilliRawValue":0},"SqrMagnitude":{"rawValue":0,"MilliRawValue":0},"RawSqrMagnitude":0},"TypeId":2001}'
Data: '{"start":{"x":{"rawValue":0,"MilliRawValue":0},"y":{"rawValue":0,"MilliRawValue":0},"z":{"rawValue":0,"MilliRawValue":0},"RawX":0,"RawY":0,"RawZ":0,"Magnitude":{"rawValue":0,"MilliRawValue":0},"SqrMagnitude":{"rawValue":0,"MilliRawValue":0},"RawSqrMagnitude":0},"end":{"x":{"rawValue":10000000,"MilliRawValue":10000},"y":{"rawValue":0,"MilliRawValue":0},"z":{"rawValue":0,"MilliRawValue":0},"RawX":10000000,"RawY":0,"RawZ":0,"Magnitude":{"rawValue":10000000,"MilliRawValue":10000},"SqrMagnitude":{"rawValue":100000000,"MilliRawValue":100000},"RawSqrMagnitude":100000000000000},"TypeId":2001}'
passiveGameplayEffects:
- trackName: Passive
clipEvents: []

View File

@@ -13,8 +13,8 @@ MonoBehaviour:
m_Name: GE_Player
m_EditorClassIdentifier: JNGame.Runtime:GAS.Runtime:GameplayEffectAsset
description:
durationPolicy: 2
duration: 0
durationPolicy: 3
duration: 1000
period: 0
periodExecutionId: 0
periodExecution: {fileID: 0}
@@ -29,9 +29,36 @@ MonoBehaviour:
clearStackOnOverflow: 0
overflowEffects: []
grantedAbilities: []
modifiers: []
assetTags: []
grantedTags: []
modifiers:
- attributeName: AS_BaseAttribute.HP
attributeSetName: AS_BaseAttribute
attributeShortName: HP
modiferMagnitude:
rawValue: -10000000
operation: 0
mmc: {fileID: 11400000, guid: 331222964d02d1349b1a9c717605c8e9, type: 2}
assetTags:
- name: Buff
hashCode: 937056111
shortName: Buff
ancestorHashCodes:
ancestorNames: []
- name: DeBuff
hashCode: -251087900
shortName: DeBuff
ancestorHashCodes:
ancestorNames: []
grantedTags:
- name: Buff
hashCode: 937056111
shortName: Buff
ancestorHashCodes:
ancestorNames: []
- name: DeBuff
hashCode: -251087900
shortName: DeBuff
ancestorHashCodes:
ancestorNames: []
applicationRequiredTags: []
ongoingRequiredTags: []
removeGameplayEffectsWithTags: []

View File

@@ -12,4 +12,4 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: b964e9ee395740d6b0f8e42978c1ba35, type: 3}
m_Name: MMC_AttrModCalculation
m_EditorClassIdentifier:
Description: "\u57FA\u7840\u8FD0\u7B97"
description:

View File

@@ -2,14 +2,13 @@ using GAS.Runtime;
using JNGame.Math;
using UnityEngine;
namespace GASSamples.Scripts.GAS.MMC
namespace JNGame.GAS
{
/// <summary>
/// 基础运算
/// </summary>
[CreateAssetMenu(fileName = "AttrModCalculation", menuName = "GAS/MMC/AttrModCalculation")]
public class AttrModCalculation : ModifierMagnitudeCalculation
public partial class AttrModCalculation : ModifierMagnitudeCalculation
{
public override LFloat CalculateMagnitude(GameplayEffectSpec spec, LFloat modifierMagnitude)
{

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 9fc319df13794dafaafc817e1f0d28e0
timeCreated: 1729684521

View File

@@ -0,0 +1,13 @@
using GAS.Runtime;
using JNGame.Math;
namespace JNGame.GAS
{
public partial class PureAttrModCalculation : PureModifierMagnitudeCalculation
{
public override LFloat CalculateMagnitude(GameplayEffectSpec spec, LFloat modifierMagnitude)
{
return modifierMagnitude;
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 245e55c61ef243a8a4fb6700840bbfbe
timeCreated: 1729684529

View File

@@ -1,4 +1,5 @@
using GAS.Runtime;
using GASSamples.Scripts.Game.GAS;
using JNGame.Math;
using UnityEngine;
@@ -15,13 +16,19 @@ namespace JNGame.GAS
/// 编辑器预览用
/// 【注意】 覆写时记得用UNITY_EDITOR宏包裹这是预览表现用的函数不该被编译。
/// </summary>
/// <param name="preview"></param>
/// <param name="frame"></param>
/// <param name="startFrame"></param>
/// <param name="endFrame"></param>
public override void OnEditorPreview(int frame, int startFrame, int endFrame)
public override void OnEditorPreview(GameObject preview,int frame, int startFrame, int endFrame)
{
Debug.Log($"OnEditorPreview {Vector3.Lerp(start.ToVector3(),end.ToVector3(),(float)frame / (float)endFrame)}");
// _spec.Owner.gameObject.transform.position = Vector3.Lerp(start, end, (float)startFrame / endFrame);
if (frame >= startFrame && frame <= endFrame)
{
preview.transform.position = Vector3.Lerp(start.ToVector3(), end.ToVector3(), (float)(frame - startFrame) / endFrame);
}
}
#endif
@@ -37,7 +44,8 @@ namespace JNGame.GAS
public override void OnTick(int frameIndex, int startFrame, int endFrame)
{
Debug.Log("OnTick");
Debug.Log($"OnTick {frameIndex} {startFrame} {endFrame}");
((GAbilitySystemComponent)m_Spec.Owner).Entity.Transform.Position = LVector3.Lerp(start, end, (LFloat)(frameIndex - startFrame) / endFrame);
}
}
}

View File

@@ -10,6 +10,7 @@ namespace JNGame.GAS
/// </summary>
public enum EnumGameMMCType
{
PureAttrModCalculation = 11,
}
@@ -19,6 +20,7 @@ namespace JNGame.GAS
{
private partial void InternalMMCInject()
{
MMCFactory.Register((ushort)EnumGameMMCType.PureAttrModCalculation, () => new JNGame.GAS.PureAttrModCalculation());
}
}
@@ -27,6 +29,7 @@ namespace JNGame.GAS
#region MMC枚举ID自动生成
public partial class PureAttrModCalculation { public override ushort TypeId => (ushort)EnumGameMMCType.PureAttrModCalculation; }
#endregion

View File

@@ -0,0 +1,15 @@
// auto generate by tools, DO NOT Modify it!!!
using GAS.Runtime;
namespace JNGame.GAS
{
#region MMC枚举ID自动生成
public partial class AttrModCalculation { public override ushort TypeId => (ushort)EnumGameMMCType.PureAttrModCalculation; }
#endregion
}

View File

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

View File

@@ -0,0 +1,6 @@
// auto generate by tools, DO NOT Modify it!!!
using GAS.Runtime;
using JNGame.Serialization;

View File

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