Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

OnMousedown unity ui


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");
    }
}

Comment

c# onmousedown. unity

//be sure to use the unity system. above

void OnMouseDown()
    {
        Destroy(gameObject);
    }    
Comment

OnMousedown unity ui

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();
    }
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: The server requested authentication method unknown to the client 
Csharp :: c list add element 
Csharp :: add mime type for woff in web.config 
Csharp :: c# foreach on a dictionary 
Csharp :: c# is in array 
Csharp :: c# use hashtable check if key exists 
Csharp :: letter at index of string c# 
Csharp :: how to look for substring in string in c# 
Csharp :: when was the third world war 
Csharp :: c# get char from string 
Csharp :: unity change cursor texture 
Csharp :: Throw index out of range C# 
Csharp :: unity new vector3 
Csharp :: function on animation end unity 
Csharp :: HOW TO RETURN CELL VALUE FROM EXCEL IN C# 
Csharp :: unity gameobject.find 
Csharp :: getmousebuttondown unity 
Csharp :: difference between class and struct in c# 
Csharp :: unity audio 
Csharp :: c# round double 
Csharp :: unity find object by name 
Csharp :: c# return task list 
Csharp :: sleep in c# 
Csharp :: lcm of numbers 
Csharp :: difference between boxing and unboxing in java 
Csharp :: c# object list attribute to string 
Csharp :: what are access modifiers in c# 
Csharp :: c# enum 
Csharp :: how to remove all whitespace from a string in c# 
Csharp :: solid principles c# 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =