예제 #1
0
        void Setup()
        {
            cameralines = FindObjectOfType(typeof(DimBoxes.DrawLines)) as DimBoxes.DrawLines;

            if (cameralines)
            {
                mcamera                  = cameralines.GetComponent <Camera>();
                previousPosition         = transform.position;
                previousRotation         = transform.rotation;
                startingBoundSize        = bound.size;
                startingScale            = transform.localScale;
                previousScale            = startingScale;
                startingBoundCenterLocal = transform.InverseTransformPoint(bound.center);
                init();
                setup = true;
            }
        }
예제 #2
0
        void Start()
        {
            cameralines = FindObjectOfType(typeof(DimBoxes.DrawLines)) as DimBoxes.DrawLines;

            if (!cameralines)
            {
                Debug.LogError("DimBoxes: no camera with DimBoxes.DrawLines in the scene", gameObject);
                return;
            }

            mcamera                  = cameralines.GetComponent <Camera>();
            previousPosition         = transform.position;
            previousRotation         = transform.rotation;
            startingBoundSize        = bound.size;
            startingScale            = transform.localScale;
            previousScale            = startingScale;
            startingBoundCenterLocal = transform.InverseTransformPoint(bound.center);
            init();
        }