mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 10:46:17 +00:00
提交
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1384fe4e23ec4d718ac4df20198da171
|
||||
timeCreated: 1729247365
|
3
JNFrame2/Assets/Scripts/GASSamples/Scripts/GAS.meta
Normal file
3
JNFrame2/Assets/Scripts/GASSamples/Scripts/GAS.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 93d542b5cd7d40219abcee66ef046f93
|
||||
timeCreated: 1729220421
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 70bc0ba32472468e8765e4c1f7acbcdf
|
||||
timeCreated: 1729224096
|
@@ -0,0 +1,74 @@
|
||||
using GAS.General;
|
||||
using GAS.Runtime;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Demo.Scripts.GAS.GameplayCue
|
||||
{
|
||||
public class GameplayCueDurational_PlayerDemo01 : GameplayCueDurational
|
||||
{
|
||||
|
||||
[BoxGroup]
|
||||
[LabelText("开始位置")]
|
||||
public Vector3 start;
|
||||
[BoxGroup]
|
||||
[LabelText("结束位置")]
|
||||
public Vector3 end;
|
||||
|
||||
public override GameplayCueDurationalSpec CreateSpec(GameplayCueParameters parameters)
|
||||
{
|
||||
return new GameplayCueDurational_PlayerDemo01_Spec(this,parameters);
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
public override void OnEditorPreview(GameObject previewObject, int frameIndex, int startFrame, int endFrame)
|
||||
{
|
||||
Debug.Log($"GameplayCue_PlayerDemo01 {previewObject} {frameIndex}");
|
||||
|
||||
if (frameIndex >= startFrame && frameIndex <= endFrame)
|
||||
{
|
||||
previewObject.transform.position = Vector3.Lerp(start, end, (float)(frameIndex - startFrame) / endFrame);
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
public override void OnRemove(int frame,int startFrame,int endFrame)
|
||||
{
|
||||
Debug.Log("GameplayCueDurational_PlayerDemo01_Spec OnRemove");
|
||||
}
|
||||
|
||||
public override void OnGameplayEffectActivate()
|
||||
{
|
||||
Debug.Log("GameplayCueDurational_PlayerDemo01_Spec OnGameplayEffectActivate");
|
||||
}
|
||||
|
||||
public override void OnGameplayEffectDeactivate()
|
||||
{
|
||||
Debug.Log("GameplayCueDurational_PlayerDemo01_Spec OnGameplayEffectDeactivate");
|
||||
}
|
||||
|
||||
public override void OnTick(int frame,int startFrame,int endFrame)
|
||||
{
|
||||
Debug.Log($"GameplayCueDurational_PlayerDemo01_Spec OnTick {frame}");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 321af3379125465380073b2a04a1b1e2
|
||||
timeCreated: 1729234472
|
@@ -0,0 +1,36 @@
|
||||
using GAS.Runtime;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Demo.Scripts.GAS.GameplayCue
|
||||
{
|
||||
public class GameplayCue_PlayerDemo01 : GameplayCueInstant
|
||||
{
|
||||
public override GameplayCueInstantSpec CreateSpec(GameplayCueParameters parameters)
|
||||
{
|
||||
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
|
||||
{
|
||||
|
||||
public GameplayCue_PlayerDemo01_Spec(GameplayCueInstant cue, GameplayCueParameters parameters) : base(cue, parameters)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Trigger()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ec56ec3ecd444759979c63b23ecf0c39
|
||||
timeCreated: 1729233357
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 364e48fdbe4b487f8a05c7b78291559c
|
||||
timeCreated: 1729220475
|
@@ -0,0 +1,42 @@
|
||||
using GAS.Runtime;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Demo.Scripts.GAS.OngoingAbilityTasks
|
||||
{
|
||||
public class OngoingAbility_Debug : OngoingAbilityTask
|
||||
{
|
||||
|
||||
public Vector3 start;
|
||||
public Vector3 end;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
/// <summary>
|
||||
/// 编辑器预览用
|
||||
/// 【注意】 覆写时,记得用UNITY_EDITOR宏包裹,这是预览表现用的函数,不该被编译。
|
||||
/// </summary>
|
||||
/// <param name="frame"></param>
|
||||
/// <param name="startFrame"></param>
|
||||
/// <param name="endFrame"></param>
|
||||
public override void OnEditorPreview(int frame, int startFrame, int endFrame)
|
||||
{
|
||||
Debug.Log($"OnEditorPreview {Vector3.Lerp(start,end,(float)frame / (float)endFrame)}");
|
||||
// _spec.Owner.gameObject.transform.position = Vector3.Lerp(start, end, (float)startFrame / endFrame);
|
||||
}
|
||||
#endif
|
||||
|
||||
public override void OnStart(int startFrame)
|
||||
{
|
||||
Debug.Log("OnEnd");
|
||||
}
|
||||
|
||||
public override void OnEnd(int endFrame)
|
||||
{
|
||||
Debug.Log("OnEnd");
|
||||
}
|
||||
|
||||
public override void OnTick(int frameIndex, int startFrame, int endFrame)
|
||||
{
|
||||
Debug.Log("OnTick");
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8f6034c656814b79b9be57cd41b35d9a
|
||||
timeCreated: 1729220520
|
8
JNFrame2/Assets/Scripts/GASSamples/Scripts/Gen.meta
Normal file
8
JNFrame2/Assets/Scripts/GASSamples/Scripts/Gen.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 27ed906aca80d874b9138a6559c7835e
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,44 @@
|
||||
///////////////////////////////////
|
||||
//// This is a generated file. ////
|
||||
//// Do not modify it. ////
|
||||
///////////////////////////////////
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
namespace GAS.Runtime
|
||||
{
|
||||
public static class AbilitySystemComponentExtension
|
||||
{
|
||||
public static Type[] PresetAttributeSetTypes(this AbilitySystemComponent asc)
|
||||
{
|
||||
if (asc.Preset == null) return null;
|
||||
var attrSetTypes = new Type[asc.Preset.AttributeSets.Length];
|
||||
for (var i = 0; i < asc.Preset.AttributeSets.Length; i++)
|
||||
attrSetTypes[i] = GAttrSetLib.AttrSetTypeDict[asc.Preset.AttributeSets[i]];
|
||||
return attrSetTypes;
|
||||
}
|
||||
|
||||
public static GameplayTag[] PresetBaseTags(this AbilitySystemComponent asc)
|
||||
{
|
||||
if (asc.Preset == null) return null;
|
||||
return asc.Preset.BaseTags;
|
||||
}
|
||||
|
||||
public static void InitWithPreset(this AbilitySystemComponent asc, int level, AbilitySystemComponentPreset preset = null)
|
||||
{
|
||||
if (preset != null) asc.SetPreset(preset);
|
||||
if (asc.Preset == null) return;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
if (asc.Preset.BaseAbilities != null && asc.Preset.BaseAbilities.Any(x => x == null))
|
||||
{
|
||||
Debug.LogWarning($"BaseAbilities contains null in preset: {asc.Preset.name}");
|
||||
}
|
||||
#endif
|
||||
|
||||
asc.Init(asc.PresetBaseTags(), asc.PresetAttributeSetTypes(), asc.Preset.BaseAbilities, level);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a829f1acecbd5d348800bcbf18fb138e
|
||||
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/Demo/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: 79aaab94f725e0347b32b6383dc6361e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,18 @@
|
||||
///////////////////////////////////
|
||||
//// This is a generated file. ////
|
||||
//// Do not modify it. ////
|
||||
///////////////////////////////////
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace GAS.Runtime
|
||||
{
|
||||
public static class GAttrLib
|
||||
{
|
||||
|
||||
// For facilitating the creation of a Value Dropdown in the editor.
|
||||
public static readonly IReadOnlyList<string> AttributeNames = new List<string>
|
||||
{
|
||||
};
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d2db3b0427abaab4c9c8ec9df6c351e8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,25 @@
|
||||
///////////////////////////////////
|
||||
//// This is a generated file. ////
|
||||
//// Do not modify it. ////
|
||||
///////////////////////////////////
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace GAS.Runtime
|
||||
{
|
||||
public static class GAttrSetLib
|
||||
{
|
||||
public static readonly IReadOnlyDictionary<string, Type> AttrSetTypeDict = new Dictionary<string, Type>
|
||||
{
|
||||
};
|
||||
|
||||
public static readonly IReadOnlyDictionary<Type, string> TypeToName = new Dictionary<Type, string>
|
||||
{
|
||||
};
|
||||
|
||||
public static readonly IReadOnlyList<string> AttributeFullNames = new List<string>
|
||||
{
|
||||
};
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e232dda0e81c76c4ba33b4b47af0644a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,20 @@
|
||||
///////////////////////////////////
|
||||
//// This is a generated file. ////
|
||||
//// Do not modify it. ////
|
||||
///////////////////////////////////
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace GAS.Runtime
|
||||
{
|
||||
public static class GTagLib
|
||||
{
|
||||
/// <summary>Ability</summary>
|
||||
public static GameplayTag Ability { get; } = new("Ability");
|
||||
|
||||
public static readonly IReadOnlyDictionary<string, GameplayTag> TagMap = new Dictionary<string, GameplayTag>
|
||||
{
|
||||
["Ability"] = Ability,
|
||||
};
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 77b03860d4e223243838914f3e9fee1c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
13
JNFrame2/Assets/Scripts/GASSamples/Scripts/Main.cs
Normal file
13
JNFrame2/Assets/Scripts/GASSamples/Scripts/Main.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Demo.Scripts
|
||||
{
|
||||
public class Main : MonoBehaviour
|
||||
{
|
||||
|
||||
private void Start()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
3
JNFrame2/Assets/Scripts/GASSamples/Scripts/Main.cs.meta
Normal file
3
JNFrame2/Assets/Scripts/GASSamples/Scripts/Main.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0c3aa2f58b904ebe9fc64cc367c63d68
|
||||
timeCreated: 1729236756
|
Reference in New Issue
Block a user