예제 #1
0
        public void Initialize(LocatorFlow flow)
        {
            if (Application.isEditor)
            {
                if (PlayerPrefs.HasKey(RuntimeConfigNames.DevAuthTokenKey))
                {
                    flow.DevAuthToken = PlayerPrefs.GetString(RuntimeConfigNames.DevAuthTokenKey);
                    return;
                }

                var textAsset = Resources.Load <TextAsset>("DevAuthToken");

                if (textAsset == null)
                {
                    throw new MissingReferenceException("Unable to find DevAuthToken.txt in the Resources folder. " +
                                                        "You can generate one via SpatialOS > Generate Dev Authentication Token.");
                }

                flow.DevAuthToken = textAsset.text;
            }
            else
            {
                initializer.Initialize(flow);
            }
        }
예제 #2
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="ReceptionistFlow"/> class.
 /// </summary>
 /// <param name="workerId">The worker ID to use for the worker connection.</param>
 /// <param name="initializer">Optional. An initializer to seed the data required to connect via the Receptionist flow.</param>
 public ReceptionistFlow(string workerId, IConnectionFlowInitializer<ReceptionistFlow> initializer = null)
 {
     WorkerId = workerId;
     initializer?.Initialize(this);
 }
예제 #3
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="LocatorFlow"/> class.
 /// </summary>
 /// <param name="initializer">Optional. An initializer to seed the data required to connect via the Alpha Locator flow.</param>
 public LocatorFlow(IConnectionFlowInitializer<LocatorFlow> initializer = null)
 {
     initializer?.Initialize(this);
 }