“Ui UI Unty OnMousedown” Kod odpowiedzi

Ui UI Unty OnMousedown

public class Combat_spell : MonoBehaviour, IPointerClickHandler,
 IPointerExitHandler, IPointerEnterHandler
{
    public void OnPointerClick(PointerEventData eventData)
    {
        UseSpell();
    }

    public void OnPointerEnter(PointerEventData eventData)
    {
        Scene_Main.display_Description("Frappe", "Inflige 5 à 7 dégats", 3, -2, this.transform.position, 3);
    }

    public void OnPointerExit(PointerEventData eventData)
    {
        Scene_Main.display_Description_Erase();
    }
}
Stupid Salmon

GetMouseButTondown Unity

       if (Input.GetMouseButtonDown(1))
//This is too stop spaming the gun 
         
Energetic Eel

Ui UI Unty OnMousedown


using UnityEngine.EventSystems;

public class ClickDetector : MonoBehaviour, IPointerDownHandler, IPointerClickHandler,
    IPointerUpHandler, IPointerExitHandler, IPointerEnterHandler,
    IBeginDragHandler, IDragHandler, IEndDragHandler
{
    public void OnBeginDrag(PointerEventData eventData)
    {
        Debug.Log("Drag Begin");
    }

    public void OnDrag(PointerEventData eventData)
    {
        Debug.Log("Dragging");
    }

    public void OnEndDrag(PointerEventData eventData)
    {
        Debug.Log("Drag Ended");
    }

    public void OnPointerClick(PointerEventData eventData)
    {
        Debug.Log("Clicked: " + eventData.pointerCurrentRaycast.gameObject.name);
    }

    public void OnPointerDown(PointerEventData eventData)
    {
        Debug.Log("Mouse Down: " + eventData.pointerCurrentRaycast.gameObject.name);
    }

    public void OnPointerEnter(PointerEventData eventData)
    {
        Debug.Log("Mouse Enter");
    }

    public void OnPointerExit(PointerEventData eventData)
    {
        Debug.Log("Mouse Exit");
    }

    public void OnPointerUp(PointerEventData eventData)
    {
        Debug.Log("Mouse Up");
    }
}

Tough Tapir

Odpowiedzi podobne do “Ui UI Unty OnMousedown”

Pytania podobne do “Ui UI Unty OnMousedown”

Więcej pokrewnych odpowiedzi na “Ui UI Unty OnMousedown” w C#

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

Przeglądaj inne języki kodu