提交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

@@ -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);
}
}
}