예제 #1
0
        // used in editor through photosphere editor
        public void SetDestination(GameObject target)
        {
            destinationSphereName = target.name;

            if (_photosphereController == null)
            {
                _photosphereController = transform.root.GetComponent <PhotosphereController>();
            }

            _destinationTransform = _photosphereController.FindPhotosphereTransform(destinationSphereName);

            Debug.Log(_destinationTransform);
        }
예제 #2
0
    // Find any broken teleporter connections to photospheres that no longer exist
    private void CleanUpPhotospheres()
    {
        PhotosphereController photosphereController = FindPhotosphereController();

        for (int i = 0; i < photosphereController.photospheres.Count; i++)
        {
            // get teleporters, only need to check ones that are enabled
            TelportVrScript[] teleporters = photosphereController.photospheres[i].gameObject.transform.GetChild(1).GetComponentsInChildren <TelportVrScript>(false);

            // check each teleporter to find missing connection
            for (int t = 0; t < teleporters.Length; t++)
            {
                if (photosphereController.FindPhotosphereTransform(teleporters[t].destinationSphereName) == null)
                {
                    DisconnectTeleporter(teleporters[t]);
                }
            }
        }
    }