1
This commit is contained in:
@@ -30,6 +30,7 @@ namespace BITKit
|
||||
public const string Input = "Input";
|
||||
public const string Output = "Output";
|
||||
public const string Graphic = "Graphic";
|
||||
public const string HotFix = "HotFix";
|
||||
}
|
||||
public partial struct Animation
|
||||
{
|
||||
|
@@ -61,14 +61,29 @@ namespace BITKit
|
||||
}
|
||||
public void InvokeDirect(string key,object value)
|
||||
{
|
||||
var list = events.Get(key);
|
||||
list.ToArray().ForEach(x =>
|
||||
foreach (var x in events.Get(key))
|
||||
{
|
||||
if (x is Action<object> action)
|
||||
{
|
||||
//Console.WriteLine(action.Method);
|
||||
action.Invoke(value);
|
||||
}
|
||||
});
|
||||
else
|
||||
{
|
||||
throw new ArgumentException($"事件{key}的监听器{x}不是Action<object>类型");
|
||||
}
|
||||
}
|
||||
// list.ToArray().ForEach(x =>
|
||||
// {
|
||||
// if (x is Action<object> action)
|
||||
// {
|
||||
// action.Invoke(value);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Console.WriteLine(x);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
public void Invoke(string typeName, object value)
|
||||
{
|
||||
|
Reference in New Issue
Block a user