Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

unity button press

using UnityEngine;
using System.Collections;
using UnityEngine.EventSystems;
 
public class MyButton : MonoBehaviour, IPointerDownHandler, IPointerUpHandler {
 
  public bool buttonPressed;

  public void OnPointerDown(PointerEventData eventData){
       buttonPressed = true;
  }

  public void OnPointerUp(PointerEventData eventData){
      buttonPressed = false;
  }
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: html.beginform 
Csharp :: unity health bar 
Csharp :: dotnet call webapi 
Csharp :: rock paper scissors c# 
Csharp :: unity call function from another script 
Csharp :: c# write to output window 
Csharp :: how to get specific length of row in matrix c# 
Csharp :: array join c# 
Csharp :: c# isarray 
Csharp :: max value data annotation c# 
Csharp :: unity find object by name recursion 
Csharp :: unity deactivate component 
Csharp :: basic auth swagger .net core 5 
Csharp :: Customize yup number 
Csharp :: round decimal two places 
Csharp :: how to make button in asp.net to go to other page 
Csharp :: c# convert string array to int array 
Csharp :: c# string enum 
Csharp :: set rotation unity 
Csharp :: minimize maximize restore wpf buttons 
Csharp :: set target framerate unity 
Csharp :: c# kill one excel process 
Csharp :: how to change dictionary value in c# 
Csharp :: test how catch exception c# 
Csharp :: how to write coroutine in unity 
Csharp :: c# regex find last match 
Csharp :: Write text in Word Document at specific location using C# 
Csharp :: All Possible SubString of string 
Csharp :: difference between awake and start unity 
Csharp :: replace multiple characters in string c# 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =