using UnityEngine;
using System.Collections;

public class NetworkButton : MonoBehaviour {

	static bool otcInitialized = false;
	// Use this for initialization
	void Start () {

		if(Application.platform == RuntimePlatform.Android && !otcInitialized)
		{
			OneTouchConnectInterface.Initialize();
			Debug.Log("Initializing Network Button");
			gameObject.SetActive(false);
			OneTouchConnectEventHandler.AndroidReady += AndroidReady;
		}

	
	}

	void AndroidReady()
	{
		Debug.Log("Call back sent to Button");
		otcInitialized = true;
		gameObject.SetActive(true);
	}

	void OnDestroy()
	{
		OneTouchConnectEventHandler.AndroidReady -= AndroidReady;
	}
	
	// Update is called once per frame
	void Update () {
	
	}
}
