Skip to content

Instantly share code, notes, and snippets.

@kazumalab
Created October 31, 2016 08:13
Show Gist options
  • Save kazumalab/4a8292c94d2d4a68ede2b02466ded9d8 to your computer and use it in GitHub Desktop.
Save kazumalab/4a8292c94d2d4a68ede2b02466ded9d8 to your computer and use it in GitHub Desktop.
// NetworkSingleton.cs
public class NetworkSingleton : MonoBehaviour {
public static NetworkSingleton Instance;
private string URL = "myfirebaseid.firebaseio.com";
private string APIKEY = "firebasedatabaseKey";
public Firebase firebase;
private void Awake () {
if( null != Instance ){
Destroy( gameObject );
}else{
Instance = this;
}
firebase = Firebase.CreateNew (URL, APIKEY);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment