public void Start()
        {
            CastRemoteDisplayManager displayManager = CastRemoteDisplayManager.GetInstance();
            GameObject buttonFrame = GameObject.Find("CastButtonFrame");

            playOnTvButton = buttonFrame.transform.Find("PlayOnTvButton").gameObject;
            backgroundImage.SetActive(displayManager.IsCasting());
            playOnTvButton.SetActive(!displayManager.IsCasting());

            displayManager.RemoteDisplaySessionStartEvent.AddListener(OnRemoteDisplaySessionStart);
            displayManager.RemoteDisplaySessionEndEvent.AddListener(OnRemoteDisplaySessionEnd);
        }
Beispiel #2
0
    /**
     * Listen to the CastRemoteDisplayManager events.
     */
    void Start()
    {
        if (!displayManager)
        {
            displayManager = CastRemoteDisplayManager.GetInstance();
        }

        if (!displayManager)
        {
            Debug.LogError("DebugCastUIController ERROR: No CastRemoteDisplayManager found!");
            Destroy(gameObject);
            return;
        }

        displayManager.RemoteDisplaySessionStartEvent.AddListener(OnRemoteDisplaySessionStart);
        displayManager.RemoteDisplaySessionEndEvent.AddListener(OnRemoteDisplaySessionEnd);
        displayManager.RemoteDisplayErrorEvent.AddListener(OnRemoteDisplayError);
        if (displayManager.IsCasting())
        {
            RemoteDisplayCamera.enabled        = true;
            displayManager.RemoteDisplayCamera = MainCamera;
        }

        MainCamera.enabled = true;
    }
Beispiel #3
0
 private void TryConnectCast()
 {
     if (castDevices.Count > 0 && !castDisplayManager.IsCasting())
     {
         CastDevice device = castDevices[0];
         castDisplayManager.SelectCastDevice(device.DeviceId);
     }
 }
        public void Start()
        {
            CastRemoteDisplayManager displayManager = CastRemoteDisplayManager.GetInstance();

            gameObject.SetActive(displayManager.IsCasting());
            pausedText.SetActive(false);

            displayManager.RemoteDisplaySessionStartEvent.AddListener(OnRemoteDisplaySessionStart);
            displayManager.RemoteDisplaySessionEndEvent.AddListener(OnRemoteDisplaySessionEnd);
        }
Beispiel #5
0
    public void CloseLobby()
    {
        CastRemoteDisplayManager castDisplayManager = CastRemoteDisplayManager.GetInstance();

        if (castDisplayManager.IsCasting())
        {
            castDisplayManager.StopRemoteDisplaySession();
        }
        gameNetworkManager.StopHost();
        LocalGameFinder localGameFinder = GameObject.FindObjectOfType <LocalGameFinder>();

        localGameFinder.StopBroadCasting();
        SceneManager.LoadScene("MainMenuScene");
    }
Beispiel #6
0
 void Start()
 {
     displayManager = CastRemoteDisplayManager.GetInstance();
     displayManager.RemoteDisplaySessionStartEvent
     .AddListener(OnRemoteDisplaySessionStart);
     displayManager.RemoteDisplaySessionEndEvent
     .AddListener(OnRemoteDisplaySessionEnd);
     displayManager.RemoteDisplayErrorEvent
     .AddListener(OnRemoteDisplayError);
     castUIController = GameObject.Find("CastDefaultUI");
     pausePanel.SetActive(false);
     pauseButton.SetActive(false);
     if (displayManager.IsCasting())
     {
         pauseButton.SetActive(true);
     }
 }
Beispiel #7
0
    public new void Start()
    {
        base.Start();
        CastRemoteDisplayManager castDisplayManager = CastRemoteDisplayManager.GetInstance();

        if (castDisplayManager.IsCasting())
        {
            castDisplayManager.RemoteDisplayErrorEvent.AddListener(OnRemoteDisplayError);
            castDisplayManager.RemoteDisplaySessionEndEvent.AddListener(OnRemoteDisplaySessionEnd);
        }
        this.gameNetworkManager = GameObject.FindObjectOfType <GameNetworkManager>();
        InvokeRepeating("CheckConnection", CONNECTION_CHECK_INTERVAL, CONNECTION_CHECK_INTERVAL);

        // Load menu assets.
        arrowIcon        = Resources.Load <Texture>("Menu/arrow");
        arrowFlippedIcon = Resources.Load <Texture>("Menu/arrow-flipped");
        difficultyIcons  = Resources.LoadAll <Texture>("Menu/Difficulties");
    }
Beispiel #8
0
    public void Start()
    {
        phoneCanvas.enabled = false;

        chromeCast = (CastRemoteDisplayManager)FindObjectOfType(typeof(CastRemoteDisplayManager));
        chromeCast.RemoteDisplaySessionStartEvent.AddListener(startCasting);
        chromeCast.RemoteDisplaySessionEndEvent.AddListener(stopCasting);
        chromeCast.RemoteDisplayErrorEvent.AddListener(errorCasting);

        phoneCanvas.enabled = false;

        chromeCast.RemoteDisplayCamera = chromecastCamera;

        /* The phone is allready connected to a chromecast*/
        if (chromeCast.IsCasting())
        {
            startCasting(null);
        }
    }
Beispiel #9
0
    public string debugInfo()
    {
        string msg = "";

        dv = displayManager.GetSelectedCastDevice();
        Debug.Log("displayManager.enabled: " + displayManager.enabled);
        if (dv != null)
        {
            msg = (" DeviceId: " + dv.DeviceId + " DeviceName: " + dv.DeviceName + " Status:" + dv.Status + " displayManager.IsCasting: " + displayManager.IsCasting());
        }
        else
        {
            msg = (" chromecast null");
        }
        return(msg);
    }
 void Start()
 {
     displayManager = CastRemoteDisplayManager.GetInstance();
       displayManager.RemoteDisplaySessionStartEvent
     .AddListener(OnRemoteDisplaySessionStart);
       displayManager.RemoteDisplaySessionEndEvent
     .AddListener(OnRemoteDisplaySessionEnd);
       displayManager.RemoteDisplayErrorEvent
     .AddListener(OnRemoteDisplayError);
       castUIController = GameObject.Find("CastDefaultUI");
       pausePanel.SetActive(false);
       pauseButton.SetActive(false);
       if (displayManager.IsCasting()) {
     pauseButton.SetActive(true);
       }
 }