Ejemplo n.º 1
0
    public IEnumerator GoHome()
    {
        Debug.Log("GOING HOME");

        if (SiteManager.activeSiteElementSet != null)
        {
            yield return(SiteManager.activeSiteElementSet.Deactivate());
        }


        AsyncOperation loadScene = SceneManager.LoadSceneAsync(0);

        // PlatformMonitor.ResetMonitorText();

        while (!loadScene.isDone)
        {
            yield return(null);
        }

        Debug.Log("MAIN SCENE LOADED");

        SiteManager siteManager = GetComponentInChildren <SiteManager>();

        CatalystEarth.Show();
        Logo.Show();
        ControlPanel.SetHomePanel();
        InfoCanvas.infoText = "";
        // siteManager.StartCoroutine(siteManager.PlacePOIsWhenReady());

        Debug.Log("DONE GOING HOME");
    }
Ejemplo n.º 2
0
    public void SetPosition(float latitude, float longitude)
    {
        Vector3    pos = CatalystEarth.Get3DPositionFromLatLon(latitude, longitude);
        Quaternion rot = Quaternion.FromToRotation(Vector3.forward, Vector3.up) * Quaternion.LookRotation(CatalystEarth.earthTransform.position);

        transform.SetPositionAndRotation(pos, rot);
        transform.SetParent(CatalystEarth.earthTransform);

        // transform.rotation = Quaternion.FromToRotation(Vector3.forward, Vector3.up) * Quaternion.LookRotation(CatalystEarth.earthTransform.position);
        transform.LookAt(CatalystEarth.earthTransform.position);
    }
Ejemplo n.º 3
0
    // Activate function that returns an Acitvate coroutine.
    public Coroutine Activate()
    {
        // Hide the Catalyst logo.
        Logo.Hide();

        // Hide the Earth
        CatalystEarth.Hide();

        // Load the Data Scene
        SceneManager.LoadScene("DataScene");

        // Show the panel for CAVE Cams
        ControlPanel.SetCaveCamPanel();

        // Start the activation coroutine (load first if needed)
        Coroutine activeCoroutine = StartCoroutine(LoadThenActivate());

        // Show the element-specific UI
        if (elementUI != null)
        {
            elementUI.Create();
        }

        // Mark the active element as this element.
        SiteManager.activeSiteElement = this;

        // Set active as true
        active = true;

        if (this.siteData.custom.startTransform != null)
        {
            Player.instance.transform.position = this.siteData.custom.startTransform.position;
            Player.instance.transform.rotation = Quaternion.Euler(this.siteData.custom.startTransform.eulerAngles);
        }


        // Return the coroutine.
        return(activeCoroutine);
    }
Ejemplo n.º 4
0
    public void SetSelected(bool selected)
    {
        if (selected)
        {
            if (selectedPOI != null && selectedPOI != this)
            {
                selectedPOI.SetSelected(false);
            }

            selectedPOI = this;
            GetComponentInChildren <MeshRenderer>().material = activeMat;
            CatalystEarth.RotateToPOI(this);
        }
        else
        {
            if (selectedPOI = this)
            {
                selectedPOI = null;
            }

            GetComponentInChildren <MeshRenderer>().material = inactiveMat;
        }
    }