Hey guys im new to game development on android, and i have this dilema. The problem is that i dont know how to convert my "void OnMouseDown" to android syntax. Here is the code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ball : MonoBehaviour
{
public Rigidbody2D rb;
public float relaseTime = .15f;
private bool isPressed = false;
void Update()
{
if (isPressed)
{
rb.position = Camera.main.ScreenToWorldPoint(Input.mousePosition);
}
}
void OnMouseDown()
{
isPressed = true;
rb.isKinematic = true;
}
void OnMouseUp()
{
isPressed = false;
rb.isKinematic = false;
StartCoroutine(Realase());
}
IEnumerator Realase()
{
yield return new WaitForSeconds(relaseTime);
GetComponent<SpringJoint2D>().enabled = false;
}
}