mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 10:46:17 +00:00
提交GAS
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9fc319df13794dafaafc817e1f0d28e0
|
||||
timeCreated: 1729684521
|
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 245e55c61ef243a8a4fb6700840bbfbe
|
||||
timeCreated: 1729684529
|
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user