35 lines
793 B
C#
35 lines
793 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class PrometeoTouchInput : MonoBehaviour
|
|
{
|
|
|
|
public bool changeScaleOnPressed = false;
|
|
[HideInInspector]
|
|
public bool buttonPressed = false;
|
|
RectTransform rectTransform;
|
|
Vector3 initialScale;
|
|
float scaleDownMultiplier = 0.85f;
|
|
|
|
void Start(){
|
|
rectTransform = GetComponent<RectTransform>();
|
|
initialScale = rectTransform.localScale;
|
|
}
|
|
|
|
public void ButtonDown(){
|
|
buttonPressed = true;
|
|
if(changeScaleOnPressed){
|
|
rectTransform.localScale = initialScale * scaleDownMultiplier;
|
|
}
|
|
}
|
|
|
|
public void ButtonUp(){
|
|
buttonPressed = false;
|
|
if(changeScaleOnPressed){
|
|
rectTransform.localScale = initialScale;
|
|
}
|
|
}
|
|
|
|
}
|