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; } }
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(); }