static void InitBCFromIdsTXT() { string url = ""; string appId = ""; string appSecret = ""; using (var reader = new StreamReader("ids.txt")) { Console.WriteLine("Found ids.txt"); string line; while ((line = reader.ReadLine()) != null) { if (line.StartsWith("serverUrl=")) { url = line.Substring(("serverUrl=").Length); url.Trim(); } else if (line.StartsWith("appId=")) { appId = line.Substring(("appId=").Length); appId.Trim(); } else if (line.StartsWith("secret=")) { appSecret = line.Substring(("secret=").Length); appSecret.Trim(); } } } bc.Init(url, appSecret, appId, "1.0"); }
private void Awake() { DontDestroyOnLoad(gameObject); _bc = gameObject.AddComponent <BrainCloudWrapper>(); _bc.WrapperName = gameObject.name; _bc.Init(); }
// When the app starts, check to make sure that we have // the required dependencies to use Firebase, and if not, // add them if possible. private void Start() { dependencyStatus = FirebaseApp.CheckDependencies(); if (dependencyStatus != DependencyStatus.Available) { FirebaseApp.FixDependenciesAsync().ContinueWith(task => { dependencyStatus = FirebaseApp.CheckDependencies(); if (dependencyStatus == DependencyStatus.Available) { InitializeFirebase(); } else { Debug.LogError( "Could not resolve all Firebase dependencies: " + dependencyStatus); } }); } else { InitializeFirebase(); } //Set up brainCloud _bc = gameObject.AddComponent <BrainCloudWrapper>(); _bc.Init(); _bc.AlwaysAllowProfileSwitch = true; }
// Use this for initialization void Awake() { DontDestroyOnLoad(gameObject); _bc = gameObject.AddComponent <BrainCloudWrapper>(); _bc.WrapperName = gameObject.name; // Optional: Set a wrapper name _bc.Init(); // Init data is taken from the brainCloud Unity Plugin }
private void Awake() { DontDestroyOnLoad(gameObject); _bc = gameObject.AddComponent <BrainCloudWrapper>(); _bc.WrapperName = name; _bc.Init(); _eventSystem = EventSystem.current; }
public void InitWrapper() { if (!remote_loading_in_progress) { wrapper = new BrainCloudWrapper(); wrapper.Init(ServerUrl, Secret, AppId, version); remote_loading_in_progress = true; wrapper.AuthenticateAnonymous(OnAuthorizationSuccess, OnAuthorizationFail); } }
private void Awake() { Bc = gameObject.AddComponent <BrainCloudWrapper>(); // Create the brainCloud Wrapper DontDestroyOnLoad(this); // on an Object that won't be destroyed on Scene Changes Bc.WrapperName = WrapperName; // Optional: Add a WrapperName Bc.Init(); // Required: Initialize the Wrapper Bc.Client.EnableLogging(true); }
private void Start() { var playerOneObject = new GameObject(WrapperName); Bc = gameObject.AddComponent <BrainCloudWrapper>(); // Create the brainCloud Wrapper DontDestroyOnLoad(this); // on an Object that won't be destroyed on Scene Changes Bc.WrapperName = WrapperName; // Optional: Add a WrapperName Bc.Init(); // Required: Initialize the Wrapper. // Now that brainCloud is setup. Let's go to the Login Scene var loginObject = Instantiate(Login, playerOneObject.transform); loginObject.GetComponentInChildren <GameScene>().App = this; }
public void Setup() { LoadIds(); _bc = new BrainCloudWrapper(); _bc.Init(ServerUrl, Secret, AppId, Version); _bc.Client.EnableLogging(true); _bc.Client.RegisterLogDelegate(HandleLog); if (ShouldAuthenticate()) { TestResult tr = new TestResult(_bc); _bc.Client.AuthenticationService.AuthenticateUniversal( GetUser(Users.UserA).Id, GetUser(Users.UserA).Password, true, tr.ApiSuccess, tr.ApiError); tr.Run(); } }
// Initialize brainCloud void InitBC() { if (m_bcWrapper == null) { m_bcWrapper = new BrainCloudWrapper("RelayTestApp"); } m_dead = false; string url = ""; string appId = ""; string appSecret = ""; using (var reader = new StreamReader("ids.txt")) { Console.WriteLine("Found ids.txt"); string line; while ((line = reader.ReadLine()) != null) { if (line.StartsWith("serverUrl=")) { url = line.Substring(("serverUrl=").Length); url.Trim(); } else if (line.StartsWith("appId=")) { appId = line.Substring(("appId=").Length); appId.Trim(); } else if (line.StartsWith("secret=")) { appSecret = line.Substring(("secret=").Length); appSecret.Trim(); } } } m_bcWrapper.Init(url, appSecret, appId, "1.0"); m_bcWrapper.Client.EnableLogging(true); }
void Start() { /////////////////////////////////////////////////////////////////// // brainCloud game configuration /////////////////////////////////////////////////////////////////// BrainCloud = gameObject.AddComponent <BrainCloudWrapper>(); BrainCloud.Init(); /////////////////////////////////////////////////////////////////// _username = PlayerPrefs.GetString("username"); // Stores the password in plain text directly in the unity store. // This is obviously not secure but speeds up debugging/testing. _password = PlayerPrefs.GetString("password"); // Clearing current profile BrainCloud.ResetStoredAnonymousId(); BrainCloud.ResetStoredProfileId(); }
private void InitializeBC() { m_bcWrapper.Init(); m_bcWrapper.Client.EnableLogging(true); }