Ejemplo n.º 1
0
        /// <summary>
        /// Exports a <see cref="NonBehaviourDependency"/> for the network client.
        /// Enabling it for scene persistence.
        /// </summary>
        public void ExportmanagedClient()
        {
            GameObject exportClientObject = new GameObject(@"[ExportedNetClient]");

            AttachmentFactory
            .AddTo <ExportedClientDependencyRegisterModule>(exportClientObject);

            //We don't want this client to be destroyed
            DontDestroyOnLoad(exportClientObject);
            isClientExported = true;
        }
        /// <summary>
        /// Exports a <see cref="NonBehaviourDependency"/> for the network client.
        /// Enabling it for scene persistence.
        /// </summary>
        public void ExportmanagedClient()
        {
            //We should cancel the networking
            //since we're going to export this.
            CancelTokenSource.Cancel();

            GameObject exportClientObject = new GameObject(@"[ExportedNetClient]");

            AttachmentFactory
            .AddTo <ExportedClientDependencyRegisterModule>(exportClientObject);

            //We don't want this client to be destroyed
            DontDestroyOnLoad(exportClientObject);
            isClientExported = true;
        }