Ejemplo n.º 1
0
 public void AddPhotosphere(Photosphere sphere)
 {
     if (photospheres.Contains(sphere) == false)
     {
         photospheres.Add(sphere);
     }
 }
Ejemplo n.º 2
0
    // remove any missing photospheres after a user has made deletions
    public void RemoveMissingPhotospheres()
    {
        photospheres.RemoveAll(Photosphere => Photosphere == null);

        if (startSphere == null && photospheres.Count > 0)
        {
            startSphere = photospheres[0];
        }
    }
Ejemplo n.º 3
0
 public void findActivePhotosphere()
 {
     foreach (Photosphere ps in photospheres)
     {
         if (ps.isActivated)
         {
             activePS = ps;
         }
     }
 }
Ejemplo n.º 4
0
        //Handle the Over event
        public void HandleOver()
        {
            StopAllCoroutines();

            if (_destinationTransform != null)
            {
                _destinationPhotosphere = _destinationTransform.GetComponent <Photosphere>();
            }

            if (_destinationPhotosphere.HasBeenVisited)
            {
                StartCoroutine(ChangeColour(previouslyVisitedColour));
            }
            else
            {
                StartCoroutine(ChangeColour(highlightedColour));
            }
        }
Ejemplo n.º 5
0
        private Texture2D Photosphere_CubemapNeeded(Photosphere source)
        {
            var cubemapRef = source.CubemapName + codec.ContentType;

            if (cache == null ||
                codec == null ||
                string.IsNullOrEmpty(source.CubemapName) ||
                !cache.IsCached(cubemapRef))
            {
                return(null);
            }
            else
            {
                using (var stream = cache.OpenAsync(cubemapRef).Result)
                {
                    return(Decode(stream));
                }
            }
        }
Ejemplo n.º 6
0
        private void Awake()
        {
            _photosphere = transform.parent.parent.GetComponent <Photosphere>();

            if (_VRInteractiveItem == null)
            {
                _VRInteractiveItem = GetComponent <VRInteractiveItem>();
            }

            if (Application.isPlaying)
            {
                _material = GetComponent <MeshRenderer>().material;
            }

            if (_photosphereController == null)
            {
                _photosphereController = transform.root.GetComponent <PhotosphereController>();
            }
        }
Ejemplo n.º 7
0
    public void CreateNewPhotosphere(Transform parentTransform, int zOffset)
    {
        PhotosphereController photosphereController = FindPhotosphereController();

        var        prefab         = AssetDatabase.LoadAssetAtPath("Assets/Photosphere/Prefabs/Photosphere.prefab", typeof(UnityEngine.Object)) as GameObject;
        GameObject newPhotosphere = Instantiate(prefab);

        Photosphere photosphere = newPhotosphere.GetComponent <Photosphere>();

        photosphere.SetPhotosphereImage(photoTexture);
        photosphere.SetPhotosphereVideo(videoClip);

        // set parent
        if (parentTransform == null)
        {
            newPhotosphere.transform.parent = photosphereController.transform;
        }
        else
        {
            newPhotosphere.transform.parent = parentTransform;
        }

        // set position
        photosphere.transform.position = new Vector3(0, 0, zOffset);

        // set name
        if (videoClip == null)
        {
            newPhotosphere.name = GetPhotosphereName(photosphereController, false);
        }
        else
        {
            newPhotosphere.name = GetPhotosphereName(photosphereController, true);
        }

        // temp fix
        if (_autoConnectedPhotospheres != null)
        {
            _autoConnectedPhotospheres.Add(photosphere);
        }
    }
Ejemplo n.º 8
0
        //Handle the Click event
        public void HandleClick()
        {
            _destinationPhotosphere.PhotoGimbalEnabled = true;
            _destinationPhotosphere.HasBeenVisited     = true;
            /// move camera to new position ;
            if (_destinationTransform != null)
            {
                if (_photosphere.IsVideoSphere)
                {
                    _photosphere.PlayVideo = false;
                }

                dolly.transform.position = _destinationTransform.position;

                Photosphere nextPhotosphere = _destinationTransform.GetComponent <Photosphere>();

                if (nextPhotosphere.IsVideoSphere)
                {
                    nextPhotosphere.PlayVideo = true;
                }
            }

            _photosphere.PhotoGimbalEnabled = false;
        }