Esempio n. 1
0
 public void OnEnable()
 {
     startProp = serializedObject.FindProperty("StartOnAwake");
     stopProp  = serializedObject.FindProperty("StopOnDestroy");
     portProp  = serializedObject.FindProperty("Port");
     keyProp   = serializedObject.FindProperty("ConnectKey");
     maxProp   = serializedObject.FindProperty("MaxPeers");
     launcher  = (ServerLauncher)serializedObject.targetObject;
 }
Esempio n. 2
0
        private void Run_ShouldThrowInvalidOperationException()
        {
            var serverStringBuilder = new Mock <IServerStringBuilder>();

            serverStringBuilder.SetupGet(x => x.FinalArgumentString)
            .Returns("-port=2302 -name=sampleProfile");
            var launcher = new ServerLauncher(serverStringBuilder.Object);

            Assert.Throws <InvalidOperationException>(() => launcher.Run(new Profile()));
        }
Esempio n. 3
0
        public void ServerLauncherUseDeveloperPage()
        {
            var app = new Mock <IApplicationBuilder>();

            ServerLauncher.ConfigureExceptions(app.Object, new StartServerOptions
            {
                ShowExceptions = true
            });
            app.Verify(x => x.ApplicationServices, Times.Once);
        }
 private void Awake()
 {
     if (!Instance)
     {
         Instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
 public void SetServerLauncher(ServerLauncher serverLauncher)
 {
     _ServerLauncher = serverLauncher;
 }
    private void Awake()
    {
        instance = this; // set the instance to this script

        PhotonNetwork.ConnectUsingSettings();
    }