void Start() { _camera = GetComponent <Camera>(); FollowsPlayer = true; _currentZoom = MinimumZoom; _target = gameObject.GetComponentInParent <playerScript>().transform; _targetCollider = _target.GetComponent <Collider2D>(); if (_target.GetComponent <CharacterBehaviorController>() == null) { return; } _targetController = _target.GetComponent <CharacterBehaviorController>(); _levelBounds = GameObject.FindGameObjectWithTag("LevelBounds").GetComponent <LevelLimits>(); lastTargetPosition = _target.position; lastmousePosition = gameObject.GetComponent <Camera>().ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, 0)); offsetZ = _target.position.z; _lookDirectionModifier = new Vector3(0, 0, 0); Zoom(); CancelTime = 0f; _SpeedUp = GetComponent <SpeedUp>(); _CharacterBehavior = _target.GetComponent <CharacterBehavior>(); }
void Start() { // we get the camera component _camera = GetComponent<Camera>(); _currentZoom = InitialZoom; _levelBounds = GameObject.FindGameObjectWithTag("LevelBounds").GetComponent<LevelLimits>(); SetZoomImmediate(InitialZoom); }