Example #1
0
        // Start is called before the first frame update
        void Start()
        {
            _imageGameObject      = GameObject.CreatePrimitive(PrimitiveType.Sphere);
            _focalPointGameObject = GameObject.CreatePrimitive(PrimitiveType.Sphere);
            _focalPointGameObject.GetComponent <Renderer>().material.color = Color.yellow;

            _imageGameObject.SetActive(false);
            _focalPointGameObject.SetActive(false);


            if (_reflectionIndex == mirrorHandler.GetMirrors().Count)
            {
                print("Completed all mirrors");
                // _reflected = true;
                enabled = false;
                return;
            }

            _targetMirror = mirrorHandler.GetMirrors()[_reflectionIndex];

            _myTrans = transform;

            // Initial emission
            if (_reflectionIndex == 0)
            {
                _emissionDir = _myTrans.forward;
            }

            print("Working on reflection " + _reflectionIndex);
        }
Example #2
0
        // Start is called before the first frame update
        void Start()
        {
            if (_reflectionIndex == mirrorHandler.GetMirrors().Count)
            {
                print("Completed all mirrors");
                // _reflected = true;
                enabled = false;
                return;
            }

            _targetMirror      = mirrorHandler.GetMirrors()[_reflectionIndex];
            _targetMirrorTrans = _targetMirror.transform;

            _myTrans = transform;

            // Initial emission
            if (_reflectionIndex == 0)
            {
                if (mirrorMaze)
                {
                    _emissionDir = (mirrorHandler.GetMirrors()[3].transform.position - _myTrans.position).normalized;
                }
                else
                {
                    _emissionDir = _myTrans.forward;
                }
            }

            print("Working on reflection " + _reflectionIndex);
        }