It works on everything else but when I make it into WebGL build click does not work
Any help would be nice Thanks
using UnityEngine;
using System.Collections;
using System;
public class InputManager : MonoBehaviour
{
public static event Action<Vector2> OnTouchDownEvent;
public static event Action<Vector2> OnTouchUpEvent;
public static event Action<Vector2> OnMouseDownEvent;
public static event Action<Vector2> OnMouseUpEvent;
public static event Action OnBackButtonPressedEvent;
void Update()
{
#if (UNITY_ANDROID || UNITY_IOS || UNITY_WP8) && !UNITY_EDITOR
foreach(Touch t in Input.touches)
{
switch(t.phase)
{
case TouchPhase.Began :
if(OnTouchDownEvent != null)
{
OnTouchDownEvent(t.position);
}
break;
case TouchPhase.Stationary :
break;
case TouchPhase.Canceled :
case TouchPhase.Ended :
if(OnTouchUpEvent != null)
{
OnTouchUpEvent(t.position);
}
break;
}
}
#endif
if(Input.GetKeyDown(KeyCode.Escape))
{
if(OnBackButtonPressedEvent != null)
{
OnBackButtonPressedEvent();
}
}
}
void OnGUI()
{
#if UNITY_EDITOR || UNITY_METRO || UNITY_STANDALONE || UNITY_WEBPLAYER
if(Event.current.type == EventType.MouseDown)
{
if(OnMouseDownEvent != null)
{
OnMouseDownEvent(Input.mousePosition);
}
}
if(Event.current.type == EventType.MouseUp)
{
if(OnMouseUpEvent != null)
{
OnMouseUpEvent(Input.mousePosition);
}
}
#endif
}
}