mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 10:46:17 +00:00
提交
This commit is contained in:
@@ -30,7 +30,7 @@ namespace GAS.Runtime
|
||||
{
|
||||
Debug.Log("error");
|
||||
}
|
||||
m_CueIndex = workingContext.OwnerAbility.Owner.OnCueAdd(workingContext.OwnerAbility, cueAssetLocation);
|
||||
m_CueIndex = workingContext.OwnerAbility.Owner.OnCueAdd(workingContext.OwnerAbility, cueAssetLocation,this.durationalFrame);
|
||||
}
|
||||
|
||||
protected override void OnEnd(TimelineWorkingContext workingContext)
|
||||
|
@@ -0,0 +1,51 @@
|
||||
using System.Collections.Generic;
|
||||
using GAS.General;
|
||||
|
||||
namespace GAS.Runtime
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Cue 处理
|
||||
/// </summary>
|
||||
public abstract partial class AbilitySystemComponent : IAbilitySystemComponent, IPool
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// AbilitySpec 唯一Id
|
||||
/// </summary>
|
||||
private Dictionary<AbilitySpec, int> AbilitySpecId = new();
|
||||
|
||||
/// <summary>
|
||||
/// Ability的Timeline轨道触发了持续型Cue的添加
|
||||
/// </summary>
|
||||
/// <param name="abilitySpec"></param>
|
||||
/// <param name="cueAssetLocation">Cue资源地址</param>
|
||||
/// <param name="durationTime">持续时间</param>
|
||||
/// <returns></returns>
|
||||
public int OnCueAdd(AbilitySpec abilitySpec, string cueAssetLocation, int durationTime)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ability的Timeline轨道触发了持续型Cue的移除
|
||||
/// </summary>
|
||||
/// <param name="abilitySpec"></param>
|
||||
/// <param name="cueClipIndex"></param>
|
||||
public void OnCueRemove(AbilitySpec abilitySpec, int cueClipIndex)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ability的Timeline轨道触发了瞬时Cue的触发
|
||||
/// </summary>
|
||||
/// <param name="abilitySpec"></param>
|
||||
/// <param name="cueAssetLocations"></param>
|
||||
public void OnCueExecute(AbilitySpec abilitySpec, string[] cueAssetLocations)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fd84ebd1383e4e009578ebd2daae3200
|
||||
timeCreated: 1729704061
|
@@ -8,7 +8,7 @@ using UnityEngine;
|
||||
|
||||
namespace GAS.Runtime
|
||||
{
|
||||
public abstract class AbilitySystemComponent : IAbilitySystemComponent, IPool
|
||||
public abstract partial class AbilitySystemComponent : IAbilitySystemComponent, IPool
|
||||
{
|
||||
public int SelfNumber;
|
||||
|
||||
@@ -41,6 +41,20 @@ namespace GAS.Runtime
|
||||
/// Owner的包围盒半径
|
||||
/// </summary>
|
||||
public LFloat BoundRadius { get; protected set; } = LFloat.One;
|
||||
|
||||
/// <summary>
|
||||
/// 当前唯一Id
|
||||
/// </summary>
|
||||
private int UniqueId = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 获取当前类下一个唯一Id
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int GetUniqueId()
|
||||
{
|
||||
return UniqueId++;
|
||||
}
|
||||
|
||||
public void OnAwake()
|
||||
{
|
||||
@@ -327,28 +341,6 @@ namespace GAS.Runtime
|
||||
/// <param name="geSpec"></param>
|
||||
public abstract void OnGERelease(GameplayEffectSpec geSpec);
|
||||
|
||||
/// <summary>
|
||||
/// Ability的Timeline轨道触发了持续型Cue的添加
|
||||
/// </summary>
|
||||
/// <param name="abilitySpec"></param>
|
||||
/// <param name="cueAssetLocation"></param>
|
||||
/// <returns></returns>
|
||||
public abstract int OnCueAdd(AbilitySpec abilitySpec, string cueAssetLocation);
|
||||
|
||||
/// <summary>
|
||||
/// Ability的Timeline轨道触发了持续型Cue的移除
|
||||
/// </summary>
|
||||
/// <param name="abilitySpec"></param>
|
||||
/// <param name="cueClipIndex"></param>
|
||||
public abstract void OnCueRemove(AbilitySpec abilitySpec, int cueClipIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Ability的Timeline轨道触发了瞬时Cue的触发
|
||||
/// </summary>
|
||||
/// <param name="abilitySpec"></param>
|
||||
/// <param name="cueAssetLocations"></param>
|
||||
public abstract void OnCueExecute(AbilitySpec abilitySpec, string[] cueAssetLocations);
|
||||
|
||||
/// <summary>
|
||||
/// Ability结束激活
|
||||
/// </summary>
|
||||
|
@@ -1,94 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using GAS.Runtime;
|
||||
|
||||
namespace GAS
|
||||
{
|
||||
public class GameplayAbilitySystem
|
||||
{
|
||||
private static GameplayAbilitySystem _gas;
|
||||
|
||||
private GameplayAbilitySystem()
|
||||
{
|
||||
const int capacity = 1024;
|
||||
AbilitySystemComponents = new List<AbilitySystemComponent>(capacity);
|
||||
_cachedAbilitySystemComponents = new List<AbilitySystemComponent>(capacity);
|
||||
// GASTimer.InitStartTimestamp();
|
||||
|
||||
// GasHost = new GameObject("GAS Host").AddComponent<GasHost>();
|
||||
// GasHost.hideFlags = HideFlags.HideAndDontSave;
|
||||
// Object.DontDestroyOnLoad(GasHost.gameObject);
|
||||
// GasHost.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
public List<AbilitySystemComponent> AbilitySystemComponents { get; }
|
||||
|
||||
private readonly List<AbilitySystemComponent> _cachedAbilitySystemComponents;
|
||||
|
||||
// private GasHost GasHost { get; }
|
||||
|
||||
public static GameplayAbilitySystem GAS
|
||||
{
|
||||
get
|
||||
{
|
||||
_gas ??= new GameplayAbilitySystem();
|
||||
return _gas;
|
||||
}
|
||||
}
|
||||
|
||||
// public bool IsPaused => !GasHost.enabled;
|
||||
|
||||
public void Register(AbilitySystemComponent abilitySystemComponent)
|
||||
{
|
||||
// if (!GasHost.enabled)
|
||||
// {
|
||||
// Debug.LogWarning("[EX] GAS is paused, can't register new ASC!");
|
||||
// return;
|
||||
// }
|
||||
|
||||
if (AbilitySystemComponents.Contains(abilitySystemComponent)) return;
|
||||
AbilitySystemComponents.Add(abilitySystemComponent);
|
||||
}
|
||||
|
||||
public bool Unregister(AbilitySystemComponent abilitySystemComponent)
|
||||
{
|
||||
// if (!GasHost.enabled)
|
||||
// {
|
||||
// Debug.LogWarning("[EX] GAS is paused, can't unregister ASC!");
|
||||
// return false;
|
||||
// }
|
||||
|
||||
return AbilitySystemComponents.Remove(abilitySystemComponent);
|
||||
}
|
||||
|
||||
// public void Pause()
|
||||
// {
|
||||
// GasHost.enabled = false;
|
||||
// }
|
||||
|
||||
// public void Unpause()
|
||||
// {
|
||||
// GasHost.enabled = true;
|
||||
// }
|
||||
|
||||
public void ClearComponents()
|
||||
{
|
||||
AbilitySystemComponents.Clear();
|
||||
}
|
||||
|
||||
// public void Tick()
|
||||
// {
|
||||
// Profiler.BeginSample($"{nameof(GameplayAbilitySystem)}::Tick()");
|
||||
|
||||
// _cachedAbilitySystemComponents.AddRange(AbilitySystemComponents);
|
||||
|
||||
// foreach (var abilitySystemComponent in _cachedAbilitySystemComponents)
|
||||
// {
|
||||
// abilitySystemComponent.Tick();
|
||||
// }
|
||||
|
||||
// _cachedAbilitySystemComponents.Clear();
|
||||
|
||||
// Profiler.EndSample();
|
||||
// }
|
||||
}
|
||||
}
|
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 98a325bbe54441739d7e05e89817e9a5
|
||||
timeCreated: 1701861619
|
Reference in New Issue
Block a user