Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class WEBCONNECTOR : MonoBehaviour
- {
- void Start()
- {
- Application.ExternalEval("function onfoc(){GetUnity().SendMessage('WEBCONNECTOR','BrowserFocus','...');}");
- Application.ExternalEval("function onblr(){GetUnity().SendMessage('WEBCONNECTOR','BrowserBlur','...');}");
- Application.ExternalEval("window.onfocus=onfoc;");
- Application.ExternalEval("window.onblur=onblr;");
- Debug.Log("Set");
- }
- void BrowserBlur()
- {
- Debug.Log("Blur");
- }
- void BrowserFocus()
- {
- Debug.Log("Focus");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement