提交GAS 打算做一个帧同步的GAS

This commit is contained in:
DESKTOP-5RP3AKU\Jisol
2024-10-18 03:16:09 +08:00
parent b0a2e4a900
commit d9b0c78827
726 changed files with 76601 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
using System;
namespace GAS.Runtime
{
public class EventBase<T> where T : EventArgs
{
public event EventHandler<T> EventHandler;
public void Publish(T args)
{
EventHandler?.Invoke(this, args);
}
public void Subscribe(EventHandler<T> handler)
{
EventHandler += handler;
}
public void Unsubscribe(EventHandler<T> handler)
{
EventHandler -= handler;
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: de27ccfc119b429fa7baf6f075900f4e
timeCreated: 1712764204

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 1eddc7a7d30f4d3cb90d70bf17accf6e
timeCreated: 1712815518

View File

@@ -0,0 +1,29 @@
using System;
namespace GAS.Runtime
{
public class AttributeChangedEventArgs : EventArgs
{
public AttributeChangedEventArgs(AbilitySystemComponent owner, AttributeBase attribute, float oldValue,
float newValue)
{
Owner = owner;
Attribute = attribute;
OldValue = oldValue;
NewValue = newValue;
}
public AbilitySystemComponent Owner { get; }
public AttributeBase Attribute { get; }
public float OldValue { get; }
public float NewValue { get; }
}
public class AttributeChangedEvent:EventBase<AttributeChangedEventArgs>
{
public void Publish(AbilitySystemComponent owner, AttributeBase attribute, float oldValue, float newValue)
{
Publish(new AttributeChangedEventArgs(owner, attribute, oldValue, newValue));
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 79c1fb618c4d44279376853983ff9f8f
timeCreated: 1712759099

View File

@@ -0,0 +1,7 @@
namespace GAS.Runtime
{
public class GASEvents
{
public static AttributeChangedEvent AttributeChanged = new AttributeChangedEvent();
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: aca5e03fae0845a7bde264547b76c18f
timeCreated: 1712764683