This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using UnityEngine.Events; | |
// interface you implement in your MB to receive events | |
public interface ICustomHandler : IEventSystemHandler | |
{ | |
void OnCustomCode(CustomEventData eventData); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Enable this if you want it to work in NUNIT, see the test example at the bottom | |
//#define UNIT_TESTING | |
/** | |
* | |
* https://i.imgur.com/GoH9rkv.png | |
* | |
* One of the frustrating things about Unity is that there are a spate of magic methods that can be | |
* called from the runtime. They do not have an interface defined, which by itself is pretty frustrating, | |
* but it can allow some valid c# that is bad Unity mojo. Consider a private 'OnEnable' function unity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.Reflection; | |
namespace UnityEngine.EventSystems | |
{ | |
[AddComponentMenu("Event/Standalone Input Module")] | |
public class StandaloneInputModule : PointerInputModule | |
{ | |
private float m_NextAction; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
using UnityEngine.EventSystems; | |
namespace UnityEngine.UI | |
{ | |
[AddComponentMenu("Event/Graphic Raycaster")] | |
[RequireComponent(typeof(Canvas))] | |
public class GraphicRaycaster : BaseRaycaster, ISerializationCallbackReceiver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Text; | |
namespace UnityEngine.EventSystems | |
{ | |
[AddComponentMenu("Event/Touch Input Module")] | |
public class TouchInputModule : PointerInputModule | |
{ | |
protected TouchInputModule() | |
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if ENABLE_HYBRID_RENDERER_V2 && URP_9_0_0_OR_NEWER | |
using Unity.Burst; | |
using Unity.Entities; | |
using Unity.Mathematics; | |
using static Unity.Mathematics.math; | |
using UnityEngine; | |
using UnityEngine.Rendering; | |
namespace Unity.Rendering | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using UnityEngine.EventSystems; | |
using UnityEngine.UI.CoroutineTween; | |
namespace UnityEngine.UI | |
{ | |
/// <summary> | |
/// Base class for all UI components that should be derived from when creating new Graphic types. | |
/// </summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Text; | |
using UnityEngine.Events; | |
using UnityEngine.EventSystems; | |
using UnityEngine.Serialization; | |
namespace UnityEngine.UI | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.EventSystems; | |
[AddComponentMenu("Event/Controller Input Module")] | |
public class ControllerInputModule : BaseInputModule | |
{ | |
private float m_NextAction; | |
protected ControllerInputModule() | |
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* When developing the UI system we came across a bunch of things we were not happy | |
* with with regards to how certain events and calls could be sent in a loosely coupled | |
* way. We had this requirement because with a UI you tend to implement widgets that receive | |
* certain events, but you don't really want to have lots of glue code to manage them | |
* and keep track of them. The eventing interfaces we developed helped with this. One of | |
* the interesting things, is that they are not justfor the UI system! You can use this as | |
* a type-safe, fast, and simple alternative to SendMessage (never use SendMessage!). | |
* So how does it all work? |
NewerOlder