【add】staryEvoTools
This commit is contained in:
3
Assets/00.StaryEvoTools/Runtime.meta
Normal file
3
Assets/00.StaryEvoTools/Runtime.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 53828c11e13a43aebc54801a2a342f84
|
||||||
|
timeCreated: 1756370317
|
||||||
8
Assets/00.StaryEvoTools/Runtime/Tool.meta
Normal file
8
Assets/00.StaryEvoTools/Runtime/Tool.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0d11726814f336347b8828f1029dfad5
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/00.StaryEvoTools/Runtime/Tool/Attributes.meta
Normal file
8
Assets/00.StaryEvoTools/Runtime/Tool/Attributes.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 75d4c33e7e46b5c478f8e068ed9be6c6
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* Copyright (c) 2015 - 2022 liangxiegame UNDER MIT License
|
||||||
|
*
|
||||||
|
* http://qframework.cn
|
||||||
|
* https://github.com/liangxiegame/QFramework
|
||||||
|
* https://gitee.com/liangxiegame/QFramework
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class APIDescriptionCNAttribute : Attribute
|
||||||
|
{
|
||||||
|
public string Description { get; private set; }
|
||||||
|
|
||||||
|
public APIDescriptionCNAttribute(string description)
|
||||||
|
{
|
||||||
|
Description = description;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2c5538bb5e55498ba063f98c0c7a8800
|
||||||
|
timeCreated: 1647422088
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* Copyright (c) 2015 - 2022 liangxiegame UNDER MIT License
|
||||||
|
*
|
||||||
|
* http://qframework.cn
|
||||||
|
* https://github.com/liangxiegame/QFramework
|
||||||
|
* https://gitee.com/liangxiegame/QFramework
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class APIDescriptionENAttribute : Attribute
|
||||||
|
{
|
||||||
|
public string Description { get; private set; }
|
||||||
|
|
||||||
|
public APIDescriptionENAttribute(string description)
|
||||||
|
{
|
||||||
|
Description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 570b6aa696204dbc949fea41caf8fcae
|
||||||
|
timeCreated: 1647422110
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* Copyright (c) 2015 - 2022 liangxiegame UNDER MIT License
|
||||||
|
*
|
||||||
|
* http://qframework.cn
|
||||||
|
* https://github.com/liangxiegame/QFramework
|
||||||
|
* https://gitee.com/liangxiegame/QFramework
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class APIExampleCodeAttribute : Attribute
|
||||||
|
{
|
||||||
|
public string Code { get; private set; }
|
||||||
|
|
||||||
|
public APIExampleCodeAttribute(string code)
|
||||||
|
{
|
||||||
|
Code = code;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b48b349a950f405095cf304b9bde0338
|
||||||
|
timeCreated: 1647424574
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
[AttributeUsage(AttributeTargets.Class)]
|
||||||
|
public class ClassAPIAttribute : Attribute
|
||||||
|
{
|
||||||
|
public string DisplayMenuName { get; private set; }
|
||||||
|
public string GroupName { get; private set; }
|
||||||
|
|
||||||
|
public int RenderOrder { get;private set; }
|
||||||
|
|
||||||
|
public string DisplayClassName { get; private set; }
|
||||||
|
|
||||||
|
public ClassAPIAttribute(string groupName, string displayMenuName,int renderOrder,string displayClassName = null)
|
||||||
|
{
|
||||||
|
GroupName = groupName;
|
||||||
|
DisplayMenuName = displayMenuName;
|
||||||
|
RenderOrder = renderOrder;
|
||||||
|
DisplayClassName = displayClassName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 72248ec1038f4ce58ad2861e9b02aa52
|
||||||
|
timeCreated: 1647404455
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* Copyright (c) 2015 - 2022 liangxiegame UNDER MIT License
|
||||||
|
*
|
||||||
|
* http://qframework.cn
|
||||||
|
* https://github.com/liangxiegame/QFramework
|
||||||
|
* https://gitee.com/liangxiegame/QFramework
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
[AttributeUsage(AttributeTargets.Method)]
|
||||||
|
public class MethodAPIAttribute : Attribute
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 5db430b6c4ac4de5a9836454125e0669
|
||||||
|
timeCreated: 1647428627
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* Copyright (c) 2015 - 2022 liangxiegame UNDER MIT License
|
||||||
|
*
|
||||||
|
* http://qframework.cn
|
||||||
|
* https://github.com/liangxiegame/QFramework
|
||||||
|
* https://gitee.com/liangxiegame/QFramework
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
[AttributeUsage(AttributeTargets.Property)]
|
||||||
|
public class PropertyAPIAttribute : Attribute
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ab3c662f56b4401eaad6594ef6182e75
|
||||||
|
timeCreated: 1647515468
|
||||||
8
Assets/00.StaryEvoTools/Runtime/Tool/EventKit.meta
Normal file
8
Assets/00.StaryEvoTools/Runtime/Tool/EventKit.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0e595bb208aff00418dc5a646f5e5bae
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9bc0ac15207240f695c4ba3f35865240
|
||||||
|
timeCreated: 1710224493
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* Copyright (c) 2015 - 2024 liangxiegame UNDER MIT License
|
||||||
|
*
|
||||||
|
* https://qStary.Evo.cn
|
||||||
|
* https://github.com/liangxiegame/QFramework
|
||||||
|
* https://gitee.com/liangxiegame/QFramework
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.Events;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class OnDeselectUnityEvent: MonoBehaviour, IDeselectHandler
|
||||||
|
{
|
||||||
|
public UnityEvent<BaseEventData> OnDeselectEvent;
|
||||||
|
|
||||||
|
public void OnDeselect(BaseEventData eventData)
|
||||||
|
{
|
||||||
|
OnDeselectEvent?.Invoke(eventData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 5edff8e50ab84809afe6b9894eef68ab
|
||||||
|
timeCreated: 1710224509
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* Copyright (c) 2016 - 2024 liangxiegame UNDER MIT License
|
||||||
|
*
|
||||||
|
* https://qStary.Evo.cn
|
||||||
|
* https://github.com/liangxiegame/QFramework
|
||||||
|
* https://gitee.com/liangxiegame/QFramework
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.Events;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class OnSelectUnityEvent : MonoBehaviour, ISelectHandler
|
||||||
|
{
|
||||||
|
public UnityEvent<BaseEventData> OnSelectEvent;
|
||||||
|
|
||||||
|
public void OnSelect(BaseEventData eventData)
|
||||||
|
{
|
||||||
|
OnSelectEvent?.Invoke(eventData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b73c32a61ddd4b469f20ad0f287b2a9e
|
||||||
|
timeCreated: 1710224585
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9a4d4fb049e264d7585467dc91a94f28
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,141 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public interface IEasyEvent
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EasyEvent : IEasyEvent
|
||||||
|
{
|
||||||
|
private Action mOnEvent = () => { };
|
||||||
|
|
||||||
|
public IUnRegister Register(Action onEvent)
|
||||||
|
{
|
||||||
|
mOnEvent += onEvent;
|
||||||
|
return new CustomUnRegister(() => { UnRegister(onEvent); });
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UnRegister(Action onEvent)
|
||||||
|
{
|
||||||
|
mOnEvent -= onEvent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Trigger()
|
||||||
|
{
|
||||||
|
mOnEvent?.Invoke();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EasyEvent<T> : IEasyEvent
|
||||||
|
{
|
||||||
|
private Action<T> mOnEvent = e => { };
|
||||||
|
|
||||||
|
public IUnRegister Register(Action<T> onEvent)
|
||||||
|
{
|
||||||
|
mOnEvent += onEvent;
|
||||||
|
return new CustomUnRegister(() => { UnRegister(onEvent); });
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UnRegister(Action<T> onEvent)
|
||||||
|
{
|
||||||
|
mOnEvent -= onEvent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Trigger(T t)
|
||||||
|
{
|
||||||
|
mOnEvent?.Invoke(t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EasyEvent<T, K> : IEasyEvent
|
||||||
|
{
|
||||||
|
private Action<T, K> mOnEvent = (t, k) => { };
|
||||||
|
|
||||||
|
public IUnRegister Register(Action<T, K> onEvent)
|
||||||
|
{
|
||||||
|
mOnEvent += onEvent;
|
||||||
|
return new CustomUnRegister(() => { UnRegister(onEvent); });
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UnRegister(Action<T, K> onEvent)
|
||||||
|
{
|
||||||
|
mOnEvent -= onEvent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Trigger(T t, K k)
|
||||||
|
{
|
||||||
|
mOnEvent?.Invoke(t, k);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EasyEvent<T, K, S> : IEasyEvent
|
||||||
|
{
|
||||||
|
private Action<T, K, S> mOnEvent = (t, k, s) => { };
|
||||||
|
|
||||||
|
public IUnRegister Register(Action<T, K, S> onEvent)
|
||||||
|
{
|
||||||
|
mOnEvent += onEvent;
|
||||||
|
return new CustomUnRegister(() => { UnRegister(onEvent); });
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UnRegister(Action<T, K, S> onEvent)
|
||||||
|
{
|
||||||
|
mOnEvent -= onEvent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Trigger(T t, K k, S s)
|
||||||
|
{
|
||||||
|
mOnEvent?.Invoke(t, k, s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EasyEventSystems
|
||||||
|
{
|
||||||
|
private static EasyEventSystems _mGlobalEventSystems = new EasyEventSystems();
|
||||||
|
|
||||||
|
public static T Get<T>() where T : IEasyEvent
|
||||||
|
{
|
||||||
|
return _mGlobalEventSystems.GetEvent<T>();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void Register<T>() where T : IEasyEvent, new()
|
||||||
|
{
|
||||||
|
_mGlobalEventSystems.AddEvent<T>();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Dictionary<Type, IEasyEvent> mTypeEvents = new Dictionary<Type, IEasyEvent>();
|
||||||
|
|
||||||
|
public void AddEvent<T>() where T : IEasyEvent, new()
|
||||||
|
{
|
||||||
|
mTypeEvents.Add(typeof(T), new T());
|
||||||
|
}
|
||||||
|
|
||||||
|
public T GetEvent<T>() where T : IEasyEvent
|
||||||
|
{
|
||||||
|
IEasyEvent e;
|
||||||
|
|
||||||
|
if (mTypeEvents.TryGetValue(typeof(T), out e))
|
||||||
|
{
|
||||||
|
return (T) e;
|
||||||
|
}
|
||||||
|
|
||||||
|
return default;
|
||||||
|
}
|
||||||
|
|
||||||
|
public T GetOrAddEvent<T>() where T : IEasyEvent, new()
|
||||||
|
{
|
||||||
|
var eType = typeof(T);
|
||||||
|
if (mTypeEvents.TryGetValue(eType, out var e))
|
||||||
|
{
|
||||||
|
return (T) e;
|
||||||
|
}
|
||||||
|
|
||||||
|
var t = new T();
|
||||||
|
mTypeEvents.Add(eType, t);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e33d19dd11204fbe87eb16c6bc9b2621
|
||||||
|
timeCreated: 1658655004
|
||||||
@@ -0,0 +1,221 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
public class EnumEventSystem
|
||||||
|
{
|
||||||
|
public static readonly EnumEventSystem Global = new EnumEventSystem();
|
||||||
|
|
||||||
|
private readonly Dictionary<string, IEasyEvent> mEvents = new Dictionary<string, IEasyEvent>(50);
|
||||||
|
|
||||||
|
public EnumEventSystem(){}
|
||||||
|
|
||||||
|
#region 功能函数
|
||||||
|
|
||||||
|
public IUnRegister Register<T>(T key, Action onEvent)where T : IConvertible
|
||||||
|
{
|
||||||
|
|
||||||
|
var kv =$"{key.ToString()}";
|
||||||
|
if (mEvents.TryGetValue(kv, out var e))
|
||||||
|
{
|
||||||
|
|
||||||
|
var easyEvent = e.As<EasyEvent>();
|
||||||
|
return easyEvent.Register(onEvent);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var easyEvent = new EasyEvent();
|
||||||
|
mEvents.Add(kv,easyEvent);
|
||||||
|
return easyEvent.Register(onEvent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public IUnRegister Register<T,T1>(T key, Action<T1> onEvent)where T : IConvertible
|
||||||
|
{
|
||||||
|
var kv =$"{key.ToString()}_{typeof(T1).Name}";
|
||||||
|
if (mEvents.TryGetValue(kv, out var e))
|
||||||
|
{
|
||||||
|
var easyEvent = e.As<EasyEvent<T1>>();
|
||||||
|
return easyEvent.Register(onEvent);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var easyEvent = new EasyEvent<T1>();
|
||||||
|
mEvents.Add(kv,easyEvent);
|
||||||
|
return easyEvent.Register(onEvent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public IUnRegister Register<T,T1,T2>(T key, Action<T1,T2> onEvent)where T : IConvertible
|
||||||
|
{
|
||||||
|
var kv =$"{key.ToString()}_{typeof(T1).Name}_{typeof(T2).Name}";
|
||||||
|
if (mEvents.TryGetValue(kv, out var e))
|
||||||
|
{
|
||||||
|
var easyEvent = e.As<EasyEvent<T1,T2>>();
|
||||||
|
return easyEvent.Register(onEvent);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var easyEvent = new EasyEvent<T1,T2>();
|
||||||
|
mEvents.Add(kv,easyEvent);
|
||||||
|
return easyEvent.Register(onEvent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public IUnRegister Register<T,T1,T2,T3>(T key, Action<T1,T2,T3> onEvent) where T : IConvertible
|
||||||
|
{
|
||||||
|
var kv =$"{key.ToString()}_{typeof(T1).Name}_{typeof(T2).Name}_{typeof(T3).Name}";
|
||||||
|
|
||||||
|
if (mEvents.TryGetValue(kv, out var e))
|
||||||
|
{
|
||||||
|
var easyEvent = e.As<EasyEvent<T1,T2,T3>>();
|
||||||
|
return easyEvent.Register(onEvent);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var easyEvent = new EasyEvent<T1,T2,T3>();
|
||||||
|
mEvents.Add(kv, easyEvent);
|
||||||
|
return easyEvent.Register(onEvent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public IUnRegister Register<T>(T key, Action<object[]> onEvent) where T : IConvertible
|
||||||
|
{
|
||||||
|
var kv =$"{key.ToString()}_objects";
|
||||||
|
|
||||||
|
if (mEvents.TryGetValue(kv, out var e))
|
||||||
|
{
|
||||||
|
var easyEvent = e.As<EasyEvent<object[]>>();
|
||||||
|
return easyEvent.Register(onEvent);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var easyEvent = new EasyEvent<object[]>();
|
||||||
|
mEvents.Add(kv, easyEvent);
|
||||||
|
return easyEvent.Register(onEvent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void UnRegister<T>(T key, Action onEvent) where T : IConvertible
|
||||||
|
{
|
||||||
|
var kv = key.ToString();
|
||||||
|
|
||||||
|
if (mEvents.TryGetValue(kv, out var e))
|
||||||
|
{
|
||||||
|
e.As<EasyEvent>()?.UnRegister(onEvent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void UnRegister<T,T1>(T key, Action<T1> onEvent) where T : IConvertible
|
||||||
|
{
|
||||||
|
var kv =$"{key.ToString()}_{typeof(T1).Name}";
|
||||||
|
|
||||||
|
if (mEvents.TryGetValue(kv, out var e))
|
||||||
|
{
|
||||||
|
e.As<EasyEvent<T1>>()?.UnRegister(onEvent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void UnRegister<T,T1,T2>(T key, Action<T1,T2> onEvent) where T : IConvertible
|
||||||
|
{
|
||||||
|
var kv =$"{key.ToString()}_{typeof(T1).Name}_{typeof(T2).Name}";
|
||||||
|
|
||||||
|
if (mEvents.TryGetValue(kv, out var e))
|
||||||
|
{
|
||||||
|
e.As<EasyEvent<T1,T2>>()?.UnRegister(onEvent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void UnRegister<T,T1,T2,T3>(T key, Action<T1,T2,T3> onEvent) where T : IConvertible
|
||||||
|
{
|
||||||
|
var kv =$"{key.ToString()}_{typeof(T1).Name}_{typeof(T2).Name}_{typeof(T3).Name}";
|
||||||
|
|
||||||
|
if (mEvents.TryGetValue(kv, out var e))
|
||||||
|
{
|
||||||
|
e.As<EasyEvent<T1,T2,T3>>()?.UnRegister(onEvent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void UnRegister<T>(T key, Action<object[]> onEvent) where T : IConvertible
|
||||||
|
{
|
||||||
|
var kv =$"{key.ToString()}_objects";
|
||||||
|
|
||||||
|
if (mEvents.TryGetValue(kv, out var e))
|
||||||
|
{
|
||||||
|
e.As<EasyEvent<object[]>>()?.UnRegister(onEvent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void UnRegisterAll()
|
||||||
|
{
|
||||||
|
mEvents.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Send<T>(T key) where T : IConvertible
|
||||||
|
{
|
||||||
|
var kv = key.ToString();
|
||||||
|
|
||||||
|
if (mEvents.TryGetValue(kv, out var e))
|
||||||
|
{
|
||||||
|
e.As<EasyEvent>().Trigger();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.LogError($"UnityEvo没有找到对应的事件:{kv}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void Send<T,T1>(T key, T1 t1) where T : IConvertible
|
||||||
|
{
|
||||||
|
var kv =$"{key.ToString()}_{typeof(T1).Name}";
|
||||||
|
|
||||||
|
if (mEvents.TryGetValue(kv, out var e))
|
||||||
|
{
|
||||||
|
e.As<EasyEvent<T1>>().Trigger(t1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.LogError($"UnityEvo没有找到对应的事件:{kv}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void Send<T,T1,T2>(T key, T1 t1,T2 t2) where T : IConvertible
|
||||||
|
{
|
||||||
|
var kv =$"{key.ToString()}_{typeof(T1).Name}_{typeof(T2).Name}";
|
||||||
|
|
||||||
|
if (mEvents.TryGetValue(kv, out var e))
|
||||||
|
{
|
||||||
|
e.As<EasyEvent<T1,T2>>().Trigger(t1,t2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.LogError($"UnityEvo没有找到对应的事件:{kv}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void Send<T,T1,T2,T3>(T key, T1 t1,T2 t2 ,T3 t3) where T : IConvertible
|
||||||
|
{
|
||||||
|
var kv =$"{key.ToString()}_{typeof(T1).Name}_{typeof(T2).Name}_{typeof(T3).Name}";
|
||||||
|
|
||||||
|
if (mEvents.TryGetValue(kv, out var e))
|
||||||
|
{
|
||||||
|
e.As<EasyEvent<T1,T2,T3>>().Trigger(t1,t2,t3);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.LogError($"UnityEvo没有找到对应的事件:{kv}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void Send<T>(T key, params object[] args) where T : IConvertible
|
||||||
|
{
|
||||||
|
var kv =$"{key.ToString()}_objects";
|
||||||
|
|
||||||
|
if (mEvents.TryGetValue(kv, out var e))
|
||||||
|
{
|
||||||
|
e.As<EasyEvent<string,object[]>>().Trigger(kv,args);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.LogError($"UnityEvo没有找到对应的事件:{kv}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
mEvents.Clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0f9c387bd15b741b2a7451be23c992ae
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
|
||||||
|
public class TypeEventSystem
|
||||||
|
{
|
||||||
|
private readonly EasyEventSystems _mEventSystems = new EasyEventSystems();
|
||||||
|
|
||||||
|
|
||||||
|
public static readonly TypeEventSystem Global = new TypeEventSystem();
|
||||||
|
|
||||||
|
public void Send<T>() where T : new()
|
||||||
|
{
|
||||||
|
_mEventSystems.GetEvent<EasyEvent<T>>()?.Trigger(new T());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Send<T>(T e)
|
||||||
|
{
|
||||||
|
_mEventSystems.GetEvent<EasyEvent<T>>()?.Trigger(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
public IUnRegister Register<T>(Action<T> onEvent)
|
||||||
|
{
|
||||||
|
var e = _mEventSystems.GetOrAddEvent<EasyEvent<T>>();
|
||||||
|
return e.Register(onEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UnRegister<T>(Action<T> onEvent)
|
||||||
|
{
|
||||||
|
var e = _mEventSystems.GetEvent<EasyEvent<T>>();
|
||||||
|
if (e != null)
|
||||||
|
{
|
||||||
|
e.UnRegister(onEvent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IOnEvent<T>
|
||||||
|
{
|
||||||
|
void OnEvent(T e);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class OnGlobalEventExtension
|
||||||
|
{
|
||||||
|
public static IUnRegister RegisterEvent<T>(this IOnEvent<T> self) where T : struct
|
||||||
|
{
|
||||||
|
return TypeEventSystem.Global.Register<T>(self.OnEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void UnRegisterEvent<T>(this IOnEvent<T> self) where T : struct
|
||||||
|
{
|
||||||
|
TypeEventSystem.Global.UnRegister<T>(self.OnEvent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 228453eae0804759b0fd585f7169789c
|
||||||
|
timeCreated: 1625121334
|
||||||
@@ -0,0 +1,173 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
[Obsolete("推荐使用 EnumEventSystem",false)]
|
||||||
|
public class StringEventSystem
|
||||||
|
{
|
||||||
|
public static readonly StringEventSystem Global = new StringEventSystem();
|
||||||
|
|
||||||
|
private Dictionary<string, IEasyEvent> mEvents = new Dictionary<string, IEasyEvent>();
|
||||||
|
|
||||||
|
public IUnRegister Register(string key, Action onEvent)
|
||||||
|
{
|
||||||
|
if (mEvents.TryGetValue(key, out var e))
|
||||||
|
{
|
||||||
|
var easyEvent = e.As<EasyEvent>();
|
||||||
|
return easyEvent.Register(onEvent);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var easyEvent = new EasyEvent();
|
||||||
|
mEvents.Add(key,easyEvent);
|
||||||
|
return easyEvent.Register(onEvent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public IUnRegister Register<T>(string key, Action<T> onEvent)
|
||||||
|
{
|
||||||
|
if (mEvents.TryGetValue(key, out var e))
|
||||||
|
{
|
||||||
|
var easyEvent = e.As<EasyEvent<T>>();
|
||||||
|
return easyEvent.Register(onEvent);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var easyEvent = new EasyEvent<T>();
|
||||||
|
mEvents.Add(key,easyEvent);
|
||||||
|
return easyEvent.Register(onEvent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public IUnRegister Register<T1,T2>(string key, Action<T1,T2> onEvent)
|
||||||
|
{
|
||||||
|
if (mEvents.TryGetValue(key, out var e))
|
||||||
|
{
|
||||||
|
var easyEvent = e.As<EasyEvent<T1,T2>>();
|
||||||
|
return easyEvent.Register(onEvent);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var easyEvent = new EasyEvent<T1,T2>();
|
||||||
|
mEvents.Add(key,easyEvent);
|
||||||
|
return easyEvent.Register(onEvent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public IUnRegister Register<T1,T2,T3>(string key, Action<T1,T2,T3> onEvent)
|
||||||
|
{
|
||||||
|
if (mEvents.TryGetValue(key, out var e))
|
||||||
|
{
|
||||||
|
var easyEvent = e.As<EasyEvent<T1,T2,T3>>();
|
||||||
|
return easyEvent.Register(onEvent);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var easyEvent = new EasyEvent<T1,T2,T3>();
|
||||||
|
mEvents.Add(key,easyEvent);
|
||||||
|
return easyEvent.Register(onEvent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public IUnRegister Register(string key, Action<object[]> onEvent)
|
||||||
|
{
|
||||||
|
if (mEvents.TryGetValue(key, out var e))
|
||||||
|
{
|
||||||
|
var easyEvent = e.As<EasyEvent<object[]> >();
|
||||||
|
return easyEvent.Register(onEvent);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var easyEvent = new EasyEvent<object[]> ();
|
||||||
|
mEvents.Add(key,easyEvent);
|
||||||
|
return easyEvent.Register(onEvent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void UnRegister(string key, Action onEvent)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (mEvents.TryGetValue(key, out var e))
|
||||||
|
{
|
||||||
|
var easyEvent = e.As<EasyEvent>();
|
||||||
|
easyEvent?.UnRegister(onEvent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void UnRegister<T>(string key, Action<T> onEvent)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (mEvents.TryGetValue(key, out var e))
|
||||||
|
{
|
||||||
|
var easyEvent = e.As<EasyEvent<T>>();
|
||||||
|
easyEvent?.UnRegister(onEvent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void UnRegister<T1,T2>(string key, Action<T1,T2> onEvent)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (mEvents.TryGetValue(key, out var e))
|
||||||
|
{
|
||||||
|
var easyEvent = e.As<EasyEvent<T1,T2>>();
|
||||||
|
easyEvent?.UnRegister(onEvent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void UnRegister<T1,T2,T3>(string key, Action<T1,T2,T3> onEvent)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (mEvents.TryGetValue(key, out var e))
|
||||||
|
{
|
||||||
|
var easyEvent = e.As<EasyEvent<T1,T2,T3>>();
|
||||||
|
easyEvent?.UnRegister(onEvent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void UnRegister(string key, Action<object[]> onEvent)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (mEvents.TryGetValue(key, out var e))
|
||||||
|
{
|
||||||
|
var easyEvent = e.As<EasyEvent<object[]>>();
|
||||||
|
easyEvent?.UnRegister(onEvent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void Send(string key)
|
||||||
|
{
|
||||||
|
if (mEvents.TryGetValue(key, out var e))
|
||||||
|
{
|
||||||
|
var easyEvent = e.As<EasyEvent>();
|
||||||
|
easyEvent?.Trigger();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void Send<T>(string key, T data)
|
||||||
|
{
|
||||||
|
if (mEvents.TryGetValue(key, out var e))
|
||||||
|
{
|
||||||
|
var easyEvent = e.As<EasyEvent<T>>();
|
||||||
|
easyEvent?.Trigger(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void Send<T1,T2>(string key, T1 data1, T2 data2)
|
||||||
|
{
|
||||||
|
if (mEvents.TryGetValue(key, out var e))
|
||||||
|
{
|
||||||
|
var easyEvent = e.As<EasyEvent<T1,T2>>();
|
||||||
|
easyEvent?.Trigger(data1,data2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void Send<T1,T2,T3>(string key, T1 data1, T2 data2, T3 data3)
|
||||||
|
{
|
||||||
|
if (mEvents.TryGetValue(key, out var e))
|
||||||
|
{
|
||||||
|
var easyEvent = e.As<EasyEvent<T1,T2,T3>>();
|
||||||
|
easyEvent?.Trigger(data1,data2,data3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void Send(string key, object[] data)
|
||||||
|
{
|
||||||
|
if (mEvents.TryGetValue(key, out var e))
|
||||||
|
{
|
||||||
|
var easyEvent = e.As<EasyEvent<object[]>>();
|
||||||
|
easyEvent?.Trigger(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
mEvents.Clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8502c9eab24d488c950d3eacbfc584b1
|
||||||
|
timeCreated: 1649307359
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 64db9a81348a42b8947c551059b8606e
|
||||||
|
timeCreated: 1658665668
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0989f6c357dd66c4e99d135d7f605367
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
using Stary.Evo;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class OnBecameInvisibleEventTrigger : MonoBehaviour
|
||||||
|
{
|
||||||
|
public readonly EasyEvent OnBecameInvisibleEvent = new EasyEvent();
|
||||||
|
|
||||||
|
private void OnBecameInvisible()
|
||||||
|
{
|
||||||
|
OnBecameInvisibleEvent.Trigger();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class OnBecameInvisibleEventTriggerExtension
|
||||||
|
{
|
||||||
|
public static IUnRegister OnBecameInvisibleEvent<T>(this T self, Action onBecameInvisible)
|
||||||
|
where T : Component
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnBecameInvisibleEventTrigger>().OnBecameInvisibleEvent
|
||||||
|
.Register(onBecameInvisible);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IUnRegister OnBecameInvisibleEvent(this GameObject self, Action onBecameInvisible)
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnBecameInvisibleEventTrigger>().OnBecameInvisibleEvent
|
||||||
|
.Register(onBecameInvisible);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 82df3683f4d240e48bbb63f36a0eaf10
|
||||||
|
timeCreated: 1693460492
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class OnBecameVisibleEventTrigger : MonoBehaviour
|
||||||
|
{
|
||||||
|
public readonly EasyEvent OnBecameVisibleEvent = new EasyEvent();
|
||||||
|
|
||||||
|
private void OnBecameVisible()
|
||||||
|
{
|
||||||
|
OnBecameVisibleEvent.Trigger();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class OnBecameVisibleEventTriggerExtension
|
||||||
|
{
|
||||||
|
public static IUnRegister OnBecameVisibleEvent<T>(this T self, Action onBecameVisible)
|
||||||
|
where T : Component
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnBecameVisibleEventTrigger>().OnBecameVisibleEvent
|
||||||
|
.Register(onBecameVisible);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IUnRegister OnBecameVisibleEvent(this GameObject self, Action onBecameVisible)
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnBecameVisibleEventTrigger>().OnBecameVisibleEvent
|
||||||
|
.Register(onBecameVisible);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d66e5459cb1f420c81fbe74291ee9f24
|
||||||
|
timeCreated: 1693460551
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8977daa3a9c64e25a157230677908ea9
|
||||||
|
timeCreated: 1684917953
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class OnCollisionEnter2DEventTrigger : MonoBehaviour
|
||||||
|
{
|
||||||
|
public readonly EasyEvent<Collision2D> OnCollisionEnter2DEvent = new EasyEvent<Collision2D>();
|
||||||
|
private void OnCollisionEnter2D(Collision2D col)
|
||||||
|
{
|
||||||
|
OnCollisionEnter2DEvent.Trigger(col);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class OnCollisionEnter2DEventTriggerExtension
|
||||||
|
{
|
||||||
|
public static IUnRegister OnCollisionEnter2DEvent<T>(this T self, Action<Collision2D> onCollisionEnter2D)
|
||||||
|
where T : Component
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnCollisionEnter2DEventTrigger>().OnCollisionEnter2DEvent
|
||||||
|
.Register(onCollisionEnter2D);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IUnRegister OnCollisionEnter2DEvent(this GameObject self, Action<Collision2D> onCollisionEnter2D)
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnCollisionEnter2DEventTrigger>().OnCollisionEnter2DEvent
|
||||||
|
.Register(onCollisionEnter2D);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: edcab69f84914ba59bef80b1bedf8c47
|
||||||
|
timeCreated: 1671428212
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class OnCollisionEnterEventTrigger : MonoBehaviour
|
||||||
|
{
|
||||||
|
public readonly EasyEvent<Collision> OnCollisionEnterEvent = new EasyEvent<Collision>();
|
||||||
|
private void OnCollisionEnter(Collision col)
|
||||||
|
{
|
||||||
|
OnCollisionEnterEvent.Trigger(col);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class OnCollisionEnterEventTriggerExtension
|
||||||
|
{
|
||||||
|
public static IUnRegister OnCollisionEnterEvent<T>(this T self, Action<Collision> onCollisionEnter)
|
||||||
|
where T : Component
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnCollisionEnterEventTrigger>().OnCollisionEnterEvent
|
||||||
|
.Register(onCollisionEnter);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IUnRegister OnCollisionEnterEvent(this GameObject self, Action<Collision> onCollisionEnter)
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnCollisionEnterEventTrigger>().OnCollisionEnterEvent
|
||||||
|
.Register(onCollisionEnter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 82d00be1a2cb39144b87de1036c4e048
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class OnCollisionExit2DEventTrigger : MonoBehaviour
|
||||||
|
{
|
||||||
|
public readonly EasyEvent<Collision2D> OnCollisionExit2DEvent = new EasyEvent<Collision2D>();
|
||||||
|
private void OnCollisionExit2D(Collision2D col)
|
||||||
|
{
|
||||||
|
OnCollisionExit2DEvent.Trigger(col);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class OnCollisionExit2DEventTriggerExtension
|
||||||
|
{
|
||||||
|
public static IUnRegister OnCollisionExit2DEvent<T>(this T self, Action<Collision2D> onCollisionExit2D)
|
||||||
|
where T : Component
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnCollisionExit2DEventTrigger>().OnCollisionExit2DEvent
|
||||||
|
.Register(onCollisionExit2D);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IUnRegister OnCollisionExit2DEvent(this GameObject self, Action<Collision2D> onCollisionExit2D)
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnCollisionExit2DEventTrigger>().OnCollisionExit2DEvent
|
||||||
|
.Register(onCollisionExit2D);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8928ffac271742d0a2b772430abd4dd3
|
||||||
|
timeCreated: 1671428509
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class OnCollisionExitEventTrigger : MonoBehaviour
|
||||||
|
{
|
||||||
|
public readonly EasyEvent<Collision> OnCollisionExitEvent = new EasyEvent<Collision>();
|
||||||
|
private void OnCollisionExit(Collision col)
|
||||||
|
{
|
||||||
|
OnCollisionExitEvent.Trigger(col);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class OnCollisionExitEventTriggerExtension
|
||||||
|
{
|
||||||
|
public static IUnRegister OnCollisionExitEvent<T>(this T self, Action<Collision> onCollisionExit)
|
||||||
|
where T : Component
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnCollisionExitEventTrigger>().OnCollisionExitEvent
|
||||||
|
.Register(onCollisionExit);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IUnRegister OnCollisionExitEvent(this GameObject self, Action<Collision> onCollisionExit)
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnCollisionExitEventTrigger>().OnCollisionExitEvent
|
||||||
|
.Register(onCollisionExit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 190fce482f5f92842a9fb5710d7973fb
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class OnCollisionStay2DEventTrigger : MonoBehaviour
|
||||||
|
{
|
||||||
|
public readonly EasyEvent<Collision2D> OnCollisionStay2DEvent = new EasyEvent<Collision2D>();
|
||||||
|
private void OnCollisionStay2D(Collision2D col)
|
||||||
|
{
|
||||||
|
OnCollisionStay2DEvent.Trigger(col);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class OnCollisionStay2DEventTriggerExtension
|
||||||
|
{
|
||||||
|
public static IUnRegister OnCollisionStay2DEvent<T>(this T self, Action<Collision2D> onCollisionStay2D)
|
||||||
|
where T : Component
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnCollisionStay2DEventTrigger>().OnCollisionStay2DEvent
|
||||||
|
.Register(onCollisionStay2D);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IUnRegister OnCollisionStay2DEvent(this GameObject self, Action<Collision2D> onCollisionStay2D)
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnCollisionStay2DEventTrigger>().OnCollisionStay2DEvent
|
||||||
|
.Register(onCollisionStay2D);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 43a766fa65dd42f5ae6cd849163e6a82
|
||||||
|
timeCreated: 1671428443
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class OnCollisionStayEventTrigger : MonoBehaviour
|
||||||
|
{
|
||||||
|
public readonly EasyEvent<Collision> OnCollisionStayEvent = new EasyEvent<Collision>();
|
||||||
|
private void OnCollisionStay(Collision col)
|
||||||
|
{
|
||||||
|
OnCollisionStayEvent.Trigger(col);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class OnCollisionStayEventTriggerExtension
|
||||||
|
{
|
||||||
|
public static IUnRegister OnCollisionStayEvent<T>(this T self, Action<Collision> onCollisionStay)
|
||||||
|
where T : Component
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnCollisionStayEventTrigger>().OnCollisionStayEvent
|
||||||
|
.Register(onCollisionStay);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IUnRegister OnCollisionStayEvent(this GameObject self, Action<Collision> onCollisionStay)
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnCollisionStayEventTrigger>().OnCollisionStayEvent
|
||||||
|
.Register(onCollisionStay);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 272e5a88646c2eb41b8ee03a717c5adf
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class OnTriggerEnter2DEventTrigger : MonoBehaviour
|
||||||
|
{
|
||||||
|
public readonly EasyEvent<Collider2D> OnTriggerEnter2DEvent = new EasyEvent<Collider2D>();
|
||||||
|
private void OnTriggerEnter2D(Collider2D collider)
|
||||||
|
{
|
||||||
|
OnTriggerEnter2DEvent.Trigger(collider);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class OnTriggerEnter2DEventTriggerExtension
|
||||||
|
{
|
||||||
|
public static IUnRegister OnTriggerEnter2DEvent<T>(this T self, Action<Collider2D> onTriggerEnter2D)
|
||||||
|
where T : Component
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnTriggerEnter2DEventTrigger>().OnTriggerEnter2DEvent
|
||||||
|
.Register(onTriggerEnter2D);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IUnRegister OnTriggerEnter2DEvent(this GameObject self, Action<Collider2D> onTriggerEnter2D)
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnTriggerEnter2DEventTrigger>().OnTriggerEnter2DEvent
|
||||||
|
.Register(onTriggerEnter2D);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 476bf1e8119b443fac10813bb49f3598
|
||||||
|
timeCreated: 1671428580
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class OnTriggerEnterEventTrigger : MonoBehaviour
|
||||||
|
{
|
||||||
|
public readonly EasyEvent<Collider> OnTriggerEnterEvent = new EasyEvent<Collider>();
|
||||||
|
private void OnTriggerEnter(Collider collider)
|
||||||
|
{
|
||||||
|
OnTriggerEnterEvent.Trigger(collider);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class OnTriggerEnterEventTriggerExtension
|
||||||
|
{
|
||||||
|
public static IUnRegister OnTriggerEnterEvent<T>(this T self, Action<Collider> onTriggerEnter)
|
||||||
|
where T : Component
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnTriggerEnterEventTrigger>().OnTriggerEnterEvent
|
||||||
|
.Register(onTriggerEnter);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IUnRegister OnTriggerEnterEvent(this GameObject self, Action<Collider> onTriggerEnter)
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnTriggerEnterEventTrigger>().OnTriggerEnterEvent
|
||||||
|
.Register(onTriggerEnter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: bd1f6102e00b4c94c92918df44a8568e
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class OnTriggerExit2DEventTrigger : MonoBehaviour
|
||||||
|
{
|
||||||
|
public readonly EasyEvent<Collider2D> OnTriggerExit2DEvent = new EasyEvent<Collider2D>();
|
||||||
|
private void OnTriggerExit2D(Collider2D collider)
|
||||||
|
{
|
||||||
|
OnTriggerExit2DEvent.Trigger(collider);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class OnTriggerExit2DEventTriggerExtension
|
||||||
|
{
|
||||||
|
public static IUnRegister OnTriggerExit2DEvent<T>(this T self, Action<Collider2D> onTriggerExit2D)
|
||||||
|
where T : Component
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnTriggerExit2DEventTrigger>().OnTriggerExit2DEvent
|
||||||
|
.Register(onTriggerExit2D);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IUnRegister OnTriggerExit2DEvent(this GameObject self, Action<Collider2D> onTriggerExit2D)
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnTriggerExit2DEventTrigger>().OnTriggerExit2DEvent
|
||||||
|
.Register(onTriggerExit2D);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a85117eed9334b2d9bf7cf743b10d7ce
|
||||||
|
timeCreated: 1671428822
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class OnTriggerExitEventTrigger : MonoBehaviour
|
||||||
|
{
|
||||||
|
public readonly EasyEvent<Collider> OnTriggerExitEvent = new EasyEvent<Collider>();
|
||||||
|
private void OnTriggerExit(Collider collider)
|
||||||
|
{
|
||||||
|
OnTriggerExitEvent.Trigger(collider);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class OnTriggerExitEventTriggerExtension
|
||||||
|
{
|
||||||
|
public static IUnRegister OnTriggerExitEvent<T>(this T self, Action<Collider> onTriggerExit)
|
||||||
|
where T : Component
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnTriggerExitEventTrigger>().OnTriggerExitEvent
|
||||||
|
.Register(onTriggerExit);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IUnRegister OnTriggerExitEvent(this GameObject self, Action<Collider> onTriggerExit)
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnTriggerExitEventTrigger>().OnTriggerExitEvent
|
||||||
|
.Register(onTriggerExit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 225a25d5b53dfe14fb4193eeb6c96f1e
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class OnTriggerStay2DEventTrigger : MonoBehaviour
|
||||||
|
{
|
||||||
|
public readonly EasyEvent<Collider2D> OnTriggerStay2DEvent = new EasyEvent<Collider2D>();
|
||||||
|
private void OnTriggerStay2D(Collider2D collider)
|
||||||
|
{
|
||||||
|
OnTriggerStay2DEvent.Trigger(collider);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class OnTriggerStay2DEventTriggerExtension
|
||||||
|
{
|
||||||
|
public static IUnRegister OnTriggerStay2DEvent<T>(this T self, Action<Collider2D> onTriggerStay2D)
|
||||||
|
where T : Component
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnTriggerStay2DEventTrigger>().OnTriggerStay2DEvent
|
||||||
|
.Register(onTriggerStay2D);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IUnRegister OnTriggerStay2DEvent(this GameObject self, Action<Collider2D> onTriggerStay2D)
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnTriggerStay2DEventTrigger>().OnTriggerStay2DEvent
|
||||||
|
.Register(onTriggerStay2D);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 33cc7e2db07b4904b50f6b37f2d4abf1
|
||||||
|
timeCreated: 1671428742
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class OnTriggerStayEventTrigger : MonoBehaviour
|
||||||
|
{
|
||||||
|
public readonly EasyEvent<Collider> OnTriggerStayEvent = new EasyEvent<Collider>();
|
||||||
|
private void OnTriggerStay(Collider collider)
|
||||||
|
{
|
||||||
|
OnTriggerStayEvent.Trigger(collider);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class OnTriggerStayEventTriggerExtension
|
||||||
|
{
|
||||||
|
public static IUnRegister OnTriggerStayEvent<T>(this T self, Action<Collider> onTriggerStay)
|
||||||
|
where T : Component
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnTriggerStayEventTrigger>().OnTriggerStayEvent
|
||||||
|
.Register(onTriggerStay);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IUnRegister OnTriggerStayEvent(this GameObject self, Action<Collider> onTriggerStay)
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnTriggerStayEventTrigger>().OnTriggerStayEvent
|
||||||
|
.Register(onTriggerStay);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 41af1f7985cb62043bea03004f786319
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 01eca79e7ef44fd69a8b616f1de7f765
|
||||||
|
timeCreated: 1684917968
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class OnBeginDragEventTrigger: MonoBehaviour, IBeginDragHandler
|
||||||
|
{
|
||||||
|
public readonly EasyEvent<PointerEventData> OnBeginDragEvent = new EasyEvent<PointerEventData>();
|
||||||
|
|
||||||
|
public void OnBeginDrag(PointerEventData eventData)
|
||||||
|
{
|
||||||
|
OnBeginDragEvent.Trigger(eventData);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class OnBeginDragEventTriggerExtension
|
||||||
|
{
|
||||||
|
public static IUnRegister OnBeginDragEvent<T>(this T self, Action<PointerEventData> onBeganDrag)
|
||||||
|
where T : Component
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnBeginDragEventTrigger>().OnBeginDragEvent.Register(onBeganDrag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IUnRegister OnBeginDragEvent(this GameObject self, Action<PointerEventData> onBeganDrag)
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnBeginDragEventTrigger>().OnBeginDragEvent.Register(onBeganDrag);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: acfd1b7010c94c9aa73d78a56664eee4
|
||||||
|
timeCreated: 1684918507
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class OnCancelEventTrigger: MonoBehaviour, ICancelHandler
|
||||||
|
{
|
||||||
|
public readonly EasyEvent<BaseEventData> OnCancelEvent = new EasyEvent<BaseEventData>();
|
||||||
|
|
||||||
|
public void OnCancel(BaseEventData eventData)
|
||||||
|
{
|
||||||
|
OnCancelEvent.Trigger(eventData);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class OnCancelEventTriggerExtension
|
||||||
|
{
|
||||||
|
public static IUnRegister OnCancelEvent<T>(this T self, Action<BaseEventData> onCancel)
|
||||||
|
where T : Component
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnCancelEventTrigger>().OnCancelEvent.Register(onCancel);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IUnRegister OnCancelEvent(this GameObject self, Action<BaseEventData> onCancel)
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnCancelEventTrigger>().OnCancelEvent.Register(onCancel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f539c36d39c14257b6ba9751d1594ef4
|
||||||
|
timeCreated: 1684921869
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class OnDeselectEventTrigger: MonoBehaviour, IDeselectHandler
|
||||||
|
{
|
||||||
|
public readonly EasyEvent<BaseEventData> OnDeselectEvent = new EasyEvent<BaseEventData>();
|
||||||
|
|
||||||
|
|
||||||
|
public void OnDeselect(BaseEventData eventData)
|
||||||
|
{
|
||||||
|
OnDeselectEvent.Trigger(eventData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class OnDeselectEventTriggerExtension
|
||||||
|
{
|
||||||
|
public static IUnRegister OnDeselectEvent<T>(this T self, Action<BaseEventData> onDeselect)
|
||||||
|
where T : Component
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnDeselectEventTrigger>().OnDeselectEvent.Register(onDeselect);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IUnRegister OnDeselectEvent(this GameObject self, Action<BaseEventData> onDeselect)
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnDeselectEventTrigger>().OnDeselectEvent.Register(onDeselect);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3e53e5c7e26d40dbad3843de24f8ffde
|
||||||
|
timeCreated: 1684921854
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class OnDragEventTrigger: MonoBehaviour, IDragHandler
|
||||||
|
{
|
||||||
|
public readonly EasyEvent<PointerEventData> OnDragEvent = new EasyEvent<PointerEventData>();
|
||||||
|
|
||||||
|
public void OnDrag(PointerEventData eventData)
|
||||||
|
{
|
||||||
|
OnDragEvent.Trigger(eventData);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class OnDragEventTriggerExtension
|
||||||
|
{
|
||||||
|
public static IUnRegister OnDragEvent<T>(this T self, Action<PointerEventData> onDrag)
|
||||||
|
where T : Component
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnDragEventTrigger>().OnDragEvent.Register(onDrag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IUnRegister OnDragEvent(this GameObject self, Action<PointerEventData> onDrag)
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnDragEventTrigger>().OnDragEvent.Register(onDrag);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: cd60a9454b464db398516f09efee052d
|
||||||
|
timeCreated: 1684918694
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class OnDropEventTrigger: MonoBehaviour, IDropHandler
|
||||||
|
{
|
||||||
|
public readonly EasyEvent<PointerEventData> OnDropEvent = new EasyEvent<PointerEventData>();
|
||||||
|
|
||||||
|
public void OnDrop(PointerEventData eventData)
|
||||||
|
{
|
||||||
|
OnDropEvent.Trigger(eventData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class OnDropEventTriggerExtension
|
||||||
|
{
|
||||||
|
public static IUnRegister OnDropEvent<T>(this T self, Action<PointerEventData> onDrop)
|
||||||
|
where T : Component
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnDropEventTrigger>().OnDropEvent.Register(onDrop);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IUnRegister OnDropEvent(this GameObject self, Action<PointerEventData> onDrop)
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnDropEventTrigger>().OnDropEvent.Register(onDrop);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 002c533d28c84da895167c036c559b98
|
||||||
|
timeCreated: 1684921828
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class OnEndDragEventTrigger: MonoBehaviour, IEndDragHandler
|
||||||
|
{
|
||||||
|
public readonly EasyEvent<PointerEventData> OnEndDragEvent = new EasyEvent<PointerEventData>();
|
||||||
|
|
||||||
|
public void OnEndDrag(PointerEventData eventData)
|
||||||
|
{
|
||||||
|
OnEndDragEvent.Trigger(eventData);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class OnEndDragEventTriggerExtension
|
||||||
|
{
|
||||||
|
public static IUnRegister OnEndDragEvent<T>(this T self, Action<PointerEventData> onEndDrag)
|
||||||
|
where T : Component
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnEndDragEventTrigger>().OnEndDragEvent.Register(onEndDrag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IUnRegister OnEndDragEvent(this GameObject self, Action<PointerEventData> onEndDrag)
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnEndDragEventTrigger>().OnEndDragEvent.Register(onEndDrag);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 054da3c9f71e4a48b48df7b881c318aa
|
||||||
|
timeCreated: 1684918794
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class OnInitializePotentialDragEventTrigger: MonoBehaviour, IInitializePotentialDragHandler
|
||||||
|
{
|
||||||
|
public readonly EasyEvent<PointerEventData> OnInitializePotentialDragEvent = new EasyEvent<PointerEventData>();
|
||||||
|
|
||||||
|
|
||||||
|
public void OnInitializePotentialDrag(PointerEventData eventData)
|
||||||
|
{
|
||||||
|
OnInitializePotentialDragEvent.Trigger(eventData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class OnInitializePotentialDragEventTriggerExtension
|
||||||
|
{
|
||||||
|
public static IUnRegister OnInitializePotentialDragEvent<T>(this T self, Action<PointerEventData> onInitializePotentialDrag)
|
||||||
|
where T : Component
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnInitializePotentialDragEventTrigger>().OnInitializePotentialDragEvent.Register(onInitializePotentialDrag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IUnRegister OnInitializePotentialDragEvent(this GameObject self, Action<PointerEventData> onInitializePotentialDrag)
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnInitializePotentialDragEventTrigger>().OnInitializePotentialDragEvent.Register(onInitializePotentialDrag);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1468538519904eb09d28417b06011d67
|
||||||
|
timeCreated: 1684921875
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class OnMoveEventTrigger: MonoBehaviour, IMoveHandler
|
||||||
|
{
|
||||||
|
public readonly EasyEvent<AxisEventData> OnMoveEvent = new EasyEvent<AxisEventData>();
|
||||||
|
|
||||||
|
public void OnMove(AxisEventData eventData)
|
||||||
|
{
|
||||||
|
OnMoveEvent.Trigger(eventData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class OnMoveEventTriggerExtension
|
||||||
|
{
|
||||||
|
public static IUnRegister OnMoveEvent<T>(this T self, Action<AxisEventData> onMove)
|
||||||
|
where T : Component
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnMoveEventTrigger>().OnMoveEvent.Register(onMove);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IUnRegister OnMoveEvent(this GameObject self, Action<AxisEventData> onMove)
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnMoveEventTrigger>().OnMoveEvent.Register(onMove);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 624f894e14aa490db08cf81024600e93
|
||||||
|
timeCreated: 1684921859
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class OnPointerClickEventTrigger : MonoBehaviour, IPointerClickHandler
|
||||||
|
{
|
||||||
|
public readonly EasyEvent<PointerEventData> OnPointerClickEvent = new EasyEvent<PointerEventData>();
|
||||||
|
|
||||||
|
public void OnPointerClick(PointerEventData eventData)
|
||||||
|
{
|
||||||
|
OnPointerClickEvent.Trigger(eventData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class OnPointerClickEventTriggerExtension
|
||||||
|
{
|
||||||
|
public static IUnRegister OnPointerClickEvent<T>(this T self, Action<PointerEventData> onPointerClick)
|
||||||
|
where T : Component
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnPointerClickEventTrigger>().OnPointerClickEvent.Register(onPointerClick);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IUnRegister OnPointerClickEvent(this GameObject self, Action<PointerEventData> onPointerClick)
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnPointerClickEventTrigger>().OnPointerClickEvent.Register(onPointerClick);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3ae5dbb0c46a4a828719e58bcf539e09
|
||||||
|
timeCreated: 1658665723
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class OnPointerDownEventTrigger : MonoBehaviour,IPointerDownHandler
|
||||||
|
{
|
||||||
|
public readonly EasyEvent<PointerEventData> OnPointerDownEvent = new EasyEvent<PointerEventData>();
|
||||||
|
|
||||||
|
public void OnPointerDown(PointerEventData eventData)
|
||||||
|
{
|
||||||
|
OnPointerDownEvent.Trigger(eventData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class OnPointerDownEventTriggerExtension
|
||||||
|
{
|
||||||
|
public static IUnRegister OnPointerDownEvent<T>(this T self, Action<PointerEventData> onPointerDownEvent)
|
||||||
|
where T : Component
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnPointerDownEventTrigger>().OnPointerDownEvent
|
||||||
|
.Register(onPointerDownEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IUnRegister OnPointerDownEvent(this GameObject self, Action<PointerEventData> onPointerDownEvent)
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnPointerDownEventTrigger>().OnPointerDownEvent
|
||||||
|
.Register(onPointerDownEvent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7ad55473a3084b0e91aa28972b4739e0
|
||||||
|
timeCreated: 1684917989
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class OnPointerEnterEventTrigger : MonoBehaviour, IPointerEnterHandler
|
||||||
|
{
|
||||||
|
public readonly EasyEvent<PointerEventData> OnPointerEnterEvent = new EasyEvent<PointerEventData>();
|
||||||
|
|
||||||
|
public void OnPointerEnter(PointerEventData eventData)
|
||||||
|
{
|
||||||
|
OnPointerEnterEvent.Trigger(eventData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class OnPointerEnterEventTriggerExtension
|
||||||
|
{
|
||||||
|
public static IUnRegister OnPointerEnterEvent<T>(this T self, Action<PointerEventData> onPointerEnter)
|
||||||
|
where T : Component
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnPointerEnterEventTrigger>().OnPointerEnterEvent.Register(onPointerEnter);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IUnRegister OnPointerEnterEvent(this GameObject self, Action<PointerEventData> onPointerEnter)
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnPointerEnterEventTrigger>().OnPointerEnterEvent.Register(onPointerEnter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: abdff8ce2d614a1898361669f649034c
|
||||||
|
timeCreated: 1684921387
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class OnPointerExitEventTrigger : MonoBehaviour, IPointerExitHandler
|
||||||
|
{
|
||||||
|
public readonly EasyEvent<PointerEventData> OnPointerExitEvent = new EasyEvent<PointerEventData>();
|
||||||
|
|
||||||
|
public void OnPointerExit(PointerEventData eventData)
|
||||||
|
{
|
||||||
|
OnPointerExitEvent.Trigger(eventData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class OnPointerExitEventTriggerExtension
|
||||||
|
{
|
||||||
|
public static IUnRegister OnPointerExitEvent<T>(this T self, Action<PointerEventData> onPointerExit)
|
||||||
|
where T : Component
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnPointerExitEventTrigger>().OnPointerExitEvent.Register(onPointerExit);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IUnRegister OnPointerExitEvent(this GameObject self, Action<PointerEventData> onPointerExit)
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnPointerExitEventTrigger>().OnPointerExitEvent.Register(onPointerExit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a0b4ce9dfff1418787b11f87638a30f8
|
||||||
|
timeCreated: 1684921704
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class OnPointerUpEventTrigger : MonoBehaviour,IPointerUpHandler
|
||||||
|
{
|
||||||
|
public readonly EasyEvent<PointerEventData> OnPointerUpEvent = new EasyEvent<PointerEventData>();
|
||||||
|
|
||||||
|
public void OnPointerUp(PointerEventData eventData)
|
||||||
|
{
|
||||||
|
OnPointerUpEvent.Trigger(eventData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class OnPointerUpEventTriggerExtension
|
||||||
|
{
|
||||||
|
public static IUnRegister OnPointerUpEvent<T>(this T self, Action<PointerEventData> onPointerUpEvent)
|
||||||
|
where T : Component
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnPointerUpEventTrigger>().OnPointerUpEvent
|
||||||
|
.Register(onPointerUpEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IUnRegister OnPointerUpEvent(this GameObject self, Action<PointerEventData> onPointerUpEvent)
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnPointerUpEventTrigger>().OnPointerUpEvent
|
||||||
|
.Register(onPointerUpEvent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4975092dfacf4edd95cf8142d6d549ca
|
||||||
|
timeCreated: 1684918304
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class OnScrollEventTrigger: MonoBehaviour, IScrollHandler
|
||||||
|
{
|
||||||
|
public readonly EasyEvent<PointerEventData> OnScrollEvent = new EasyEvent<PointerEventData>();
|
||||||
|
|
||||||
|
public void OnScroll(PointerEventData eventData)
|
||||||
|
{
|
||||||
|
OnScrollEvent.Trigger(eventData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class OnScrollEventTriggerExtension
|
||||||
|
{
|
||||||
|
public static IUnRegister OnScrollEvent<T>(this T self, Action<PointerEventData> onScroll)
|
||||||
|
where T : Component
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnScrollEventTrigger>().OnScrollEvent.Register(onScroll);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IUnRegister OnScrollEvent(this GameObject self, Action<PointerEventData> onScroll)
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnScrollEventTrigger>().OnScrollEvent.Register(onScroll);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a5eff617f4604eb7b6439224ffa9bffe
|
||||||
|
timeCreated: 1684921838
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class OnSelectEventTrigger: MonoBehaviour, ISelectHandler
|
||||||
|
{
|
||||||
|
public readonly EasyEvent<BaseEventData> OnSelectEvent = new EasyEvent<BaseEventData>();
|
||||||
|
|
||||||
|
public void OnSelect(BaseEventData eventData)
|
||||||
|
{
|
||||||
|
OnSelectEvent.Trigger(eventData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class OnSelectEventTriggerTriggerExtension
|
||||||
|
{
|
||||||
|
public static IUnRegister OnSelectEvent<T>(this T self, Action<BaseEventData> onSelect)
|
||||||
|
where T : Component
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnSelectEventTrigger>().OnSelectEvent.Register(onSelect);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IUnRegister OnSelectEvent(this GameObject self, Action<BaseEventData> onSelect)
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnSelectEventTrigger>().OnSelectEvent.Register(onSelect);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c1c1463405ce421b8764390fa5bb764d
|
||||||
|
timeCreated: 1684921849
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class OnSubmitEventTrigger: MonoBehaviour, ISubmitHandler
|
||||||
|
{
|
||||||
|
public readonly EasyEvent<BaseEventData> OnSubmitEvent = new EasyEvent<BaseEventData>();
|
||||||
|
|
||||||
|
public void OnSubmit(BaseEventData eventData)
|
||||||
|
{
|
||||||
|
OnSubmitEvent.Trigger(eventData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class OnSubmitEventTriggerExtension
|
||||||
|
{
|
||||||
|
public static IUnRegister OnSubmitEvent<T>(this T self, Action<BaseEventData> onSubmit)
|
||||||
|
where T : Component
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnSubmitEventTrigger>().OnSubmitEvent.Register(onSubmit);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IUnRegister OnSubmitEvent(this GameObject self, Action<BaseEventData> onSubmit)
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnSubmitEventTrigger>().OnSubmitEvent.Register(onSubmit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b72c739ccdec4249bf698dee82a4f475
|
||||||
|
timeCreated: 1684921864
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class OnUpdateSelectedEventTrigger: MonoBehaviour, IUpdateSelectedHandler
|
||||||
|
{
|
||||||
|
public readonly EasyEvent<BaseEventData> OnUpdateSelectedEvent = new EasyEvent<BaseEventData>();
|
||||||
|
|
||||||
|
|
||||||
|
public void OnUpdateSelected(BaseEventData eventData)
|
||||||
|
{
|
||||||
|
OnUpdateSelectedEvent.Trigger(eventData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class OnUpdateSelectedEventTriggerExtension
|
||||||
|
{
|
||||||
|
public static IUnRegister OnUpdateSelectedEvent<T>(this T self, Action<BaseEventData> onUpdateSelected)
|
||||||
|
where T : Component
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnUpdateSelectedEventTrigger>().OnUpdateSelectedEvent.Register(onUpdateSelected);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IUnRegister OnUpdateSelectedEvent(this GameObject self, Action<BaseEventData> onUpdateSelected)
|
||||||
|
{
|
||||||
|
return self.GetOrAddComponent<OnUpdateSelectedEventTrigger>().OnUpdateSelectedEvent.Register(onUpdateSelected);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 11b3a438de52430e8f4b435d4a095fb4
|
||||||
|
timeCreated: 1684921844
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 194887e39d37cd742a57ffe4cfe1b21b
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/00.StaryEvoTools/Runtime/Tool/FSM.meta
Normal file
8
Assets/00.StaryEvoTools/Runtime/Tool/FSM.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 21faa0c1703071142a9c56c1b5a96cfc
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
22
Assets/00.StaryEvoTools/Runtime/Tool/FSM/DefaultState.cs
Normal file
22
Assets/00.StaryEvoTools/Runtime/Tool/FSM/DefaultState.cs
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
using Cysharp.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
public class DefaultState : AbstractFSMIState
|
||||||
|
{
|
||||||
|
public DefaultState(IFsmSystem system) : base(system)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnEnter()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnExit()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: fa9b0b9ba7a849f597744565a49bd61a
|
||||||
|
timeCreated: 1744547550
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user