Added project
This commit is contained in:
18
Platformer/Assets/Scripts/PressButton.cs
Normal file
18
Platformer/Assets/Scripts/PressButton.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class PressButton : MonoBehaviour {
|
||||
|
||||
private bool isPressed;
|
||||
|
||||
public bool IsPressed => isPressed;
|
||||
|
||||
public void OnPointerDown() {
|
||||
isPressed = true;
|
||||
}
|
||||
|
||||
public void OnPointerUp() {
|
||||
isPressed = false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user