Advertisement
Guest User

TexeL

a guest
Jan 25th, 2011
1,571
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.61 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class WEBCONNECTOR : MonoBehaviour
  5. {
  6.     void Start()
  7.     {
  8.         Application.ExternalEval("function onfoc(){GetUnity().SendMessage('WEBCONNECTOR','BrowserFocus','...');}");
  9.         Application.ExternalEval("function onblr(){GetUnity().SendMessage('WEBCONNECTOR','BrowserBlur','...');}");
  10.         Application.ExternalEval("window.onfocus=onfoc;");
  11.         Application.ExternalEval("window.onblur=onblr;");
  12.         Debug.Log("Set");
  13.     }
  14.  
  15.     void BrowserBlur()
  16.     {
  17.         Debug.Log("Blur");
  18.     }
  19.  
  20.     void BrowserFocus()
  21.     {
  22.         Debug.Log("Focus");
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement