When pause button is touched it need to brings down the menu options which already has the options for Resume, Try again.
Am able to pause the game by using timescale.
- How to bring the menu options? Menu options are in a separate game object with animation in it.
- Am currently using Ray cast for touching function is it a good option? I guess if I use ray cast it will be expensive in terms of memory is there any other better way to approach it?
Code:
{
public RaycastHit hit;
public Texture pauseTex;
public Camera cam;
void Update()
{
if (Input.GetKeyDown (KeyCode.Mouse0))
{
control (Input.mousePosition);
}
}
void control (Vector3 a)
{
Ray ray = cam.ScreenPointToRay(a);
if (Physics.Raycast (ray, out hit, 20))
{
}
}
}