// Use this for initialization
        void Awake()
        {
            textMesh         = GetComponent <TextMesh>();
            networkDiscovery = NetworkDiscoveryWithAnchors.Instance;

            Application.logMessageReceivedThreaded += Application_logMessageReceivedThreaded;
        }
 private void Start()
 {
     scrollingUIControl = ScrollingSessionListUIController.Instance;
     textMesh           = transform.parent.GetComponentInChildren <TextMesh>();
     textMaterial       = textMesh.GetComponent <MeshRenderer>().material;
     textColorId        = Shader.PropertyToID("_Color");
     textMaterial.SetColor(textColorId, Color.grey);
     networkDiscovery = NetworkDiscoveryWithAnchors.Instance;
 }
        // Use this for initialization
        void Start()
        {
#if UNITY_EDITOR
            gameObject.GetComponent <SimpleTagalong>().TagalongDistance = 1;
#endif

            networkDiscovery = NetworkDiscoveryWithAnchors.Instance;
            networkDiscovery.SessionListChanged      += NetworkDiscovery_SessionListChanged;
            networkDiscovery.ConnectionStatusChanged += NetworkDiscovery_ConnectionStatusChanged;
            ScrollSessions(0);
        }
示例#4
0
        protected override void OnDestroy()
        {
            ResetCompositor();
            if (networkDiscovery != null)
            {
                networkDiscovery.SessionListChanged -= NetworkDiscovery_SessionListChanged;
            }
            networkDiscovery = null;

            base.OnDestroy();
        }
        void Start()
        {
            computerName = GetLocalComputerName().Trim().ToLower();

            networkDiscovery  = null;
            IsCurrentlyActive = false;

#if !UNITY_EDITOR
            Camera[] cameras = gameObject.GetComponentsInChildren <Camera>();
            for (int i = 0; i < cameras.Length; i++)
            {
                cameras[i].enabled = false;
            }
#endif
            Initialize();
        }
示例#6
0
        void Start()
        {
            UnityEngine.VR.WSA.HolographicSettings.ActivateLatentFramePresentation(true);

            computerName = GetLocalComputerName().Trim().ToLower();

            networkDiscovery  = null;
            IsCurrentlyActive = false;

#if !UNITY_EDITOR
            Camera[] cameras = gameObject.GetComponentsInChildren <Camera>();
            for (int i = 0; i < cameras.Length; i++)
            {
                cameras[i].enabled = false;
            }
#endif
            Initialize();
        }
 void Awake()
 {
     networkDiscovery = NetworkDiscoveryWithAnchors.Instance;
     anchorManager    = UNetAnchorManager.Instance;
 }
 // Use this for initialization
 void Start()
 {
     networkDiscovery = NetworkDiscoveryWithAnchors.Instance;
 }
示例#9
0
 public void ResetAutoconnect()
 {
     networkDiscovery = null;
 }
示例#10
0
        void Update()
        {
#if UNITY_EDITOR
            UpdateSpectatorView();

            #region Spectator View Transform
            if (IsCurrentlyActive && transform.parent != null)
            {
                if (NewColorFrame())
                {
                    if (PlayerController.Instance != null)
                    {
                        PlayerController.Instance.SetColorDuration(GetColorDuration() * 100);
                    }

                    Quaternion currRot  = Quaternion.identity;
                    Vector3    currPos  = Vector3.zero;
                    float      nextTime = 0;
                    GetEarliestHologramPose(out currRot.x, out currRot.y, out currRot.z, out currRot.w,
                                            out currPos.x, out currPos.y, out currPos.z, out nextTime);

                    transform.parent.localPosition = currPos;
                    transform.parent.localRotation = currRot;
                }
            }
            #endregion

            if (Input.GetKeyDown(KeyCode.T))
            {
                prevToggleVisibility       = !prevToggleVisibility;
                ToggleGameObjectVisibility = !ToggleGameObjectVisibility;

                ToggleGOVisibility();
            }

            if (!frameProviderInitialized)
            {
                frameProviderInitialized = InitializeFrameProvider();
            }

            UpdateCompositor();
#endif

            #region network state
            if (AutoConnect &&
                ServerID != string.Empty &&
                networkDiscovery == null &&
                NetworkDiscoveryWithAnchors.Instance != null)
            {
                NetworkDiscoveryWithAnchors nd = NetworkDiscoveryWithAnchors.Instance;

                if (nd.running)
                {
                    networkDiscovery = nd;
                }

                if (networkDiscovery != null)
                {
                    bool shouldHost = false;
#if UNITY_EDITOR
                    if (ServerID == "editor")
                    {
                        shouldHost = true;
                    }
#endif
                    if (localIPs.Contains(ServerID) ||
                        computerName == ServerID.Trim().ToLower() ||
                        shouldHost)
                    {
                        Debug.Log("Start Hosting");
                        // This device is the host.
                        NetworkDiscoveryWithAnchors.Instance.StartHosting("SpectatorViewSession");
                        Debug.Log("Hosting");
                    }
                    else
                    {
                        // First look for session already in session list.
                        if (!FindSession())
                        {
                            // If session does not already exist, it will be added during a change event.
                            networkDiscovery.SessionListChanged += NetworkDiscovery_SessionListChanged;
                        }
                    }
                }
            }
            #endregion
        }
 // Use this for initialization
 void Start()
 {
     transform.SetParent(DisconnectedPosition.transform, false);
     networkDisco = NetworkDiscoveryWithAnchors.Instance;
     networkDisco.ConnectionStatusChanged += NetworkDisco_ConnectionStatusChanged;
 }