“Wykonaj zdarzenia Unity” Kod odpowiedzi

Wykonaj zdarzenia Unity

using UnityEngine;
using UnityEngine.EventSystems;

public class EventTriggerExample : EventTrigger
{
	public override void OnBeginDrag( PointerEventData data )
	{
		Debug.Log( "OnBeginDrag called." );
	}

	public override void OnCancel( BaseEventData data )
	{
		Debug.Log( "OnCancel called." );
	}

	public override void OnDeselect( BaseEventData data )
	{
		Debug.Log( "OnDeselect called." );
	}

	public override void OnDrag( PointerEventData data )
	{
		Debug.Log( "OnDrag called." );
	}

	public override void OnDrop( PointerEventData data )
	{
		Debug.Log( "OnDrop called." );
	}

	public override void OnEndDrag( PointerEventData data )
	{
		Debug.Log( "OnEndDrag called." );
	}

	public override void OnInitializePotentialDrag( PointerEventData data )
	{
		Debug.Log( "OnInitializePotentialDrag called." );
	}

	public override void OnMove( AxisEventData data )
	{
		Debug.Log( "OnMove called." );
	}

	public override void OnPointerClick( PointerEventData data )
	{
		Debug.Log( "OnPointerClick called." );
	}

	public override void OnPointerDown( PointerEventData data )
	{
		Debug.Log( "OnPointerDown called." );
	}

	public override void OnPointerEnter( PointerEventData data )
	{
		Debug.Log( "OnPointerEnter called." );
	}

	public override void OnPointerExit( PointerEventData data )
	{
		Debug.Log( "OnPointerExit called." );
	}

	public override void OnPointerUp( PointerEventData data )
	{
		Debug.Log( "OnPointerUp called." );
	}

	public override void OnScroll( PointerEventData data )
	{
		Debug.Log( "OnScroll called." );
	}

	public override void OnSelect( BaseEventData data )
	{
		Debug.Log( "OnSelect called." );
	}

	public override void OnSubmit( BaseEventData data )
	{
		Debug.Log( "OnSubmit called." );
	}

	public override void OnUpdateSelected( BaseEventData data )
	{
		Debug.Log( "OnUpdateSelected called." );
	}
}
Xabos

O jedności wyzwalacza

"          |  Static   |  Dynamic  | Kinematic |  Static  |  Dynamic  | Kinematic |"
"          |           |           |           |  Trigger |  Trigger  |  Trigger  |"
----------------------------------------------------------------------------------
" Static  "|           | Collision |           |          |  Trigger  |  Trigger  |
"         "|           |           |           |          |           |           |
----------------------------------------------------------------------------------
" Dynamic "| Collision | Collision | Collision |  Trigger |  Trigger  |  Trigger  |
"         "|           |           |           |          |           |           |
----------------------------------------------------------------------------------
"Kinematic"|           | Collision |           |  Trigger |  Trigger  |  Trigger  |
"         "|           |           |           |          |           |           |
----------------------------------------------------------------------------------
" Static  "|           |  Trigger  |  Trigger  |          |  Trigger  |  Trigger  |
" Trigger "|           |           |           |          |           |           |
----------------------------------------------------------------------------------
" Dynamic "|  Trigger  |  Trigger  |  Trigger  |  Trigger |  Trigger  |  Trigger  |
" Trigger "|           |           |           |          |           |           |
----------------------------------------------------------------------------------
"Kinematic"|  Trigger  |  Trigger  |  Trigger  |  Trigger |  Trigger  |  Trigger  |
" Trigger "|           |           |           |          |           |           |
----------------------------------------------------------------------------------

// This shows how 2 objects (both having a rigidbody component) interact.
// Empty => They don't interact
// Collision => You can use OnColisionXXX
// Trigger => You can use OnTriggerXXX

//Hope it helps <3
dtragops

Odpowiedzi podobne do “Wykonaj zdarzenia Unity”

Pytania podobne do “Wykonaj zdarzenia Unity”

Więcej pokrewnych odpowiedzi na “Wykonaj zdarzenia Unity” w C#

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu