Exemplo n.º 1
0
 private void Awake()
 {
     _input   = GetComponent <MarioInput>();
     _motor   = GetComponent <MarioMotor>();
     _grndDet = GetComponent <GroundDetector>();
     // _bonkDet = GetComponent<BonkDetector>();
 }
    // Use this for initialization
    void Start()
    {
        currentDistance = (maxDistance + minDistance) * 0.5f;

        mario      = target.GetComponent <MarioMachine>();
        controller = target.GetComponent <SuperCharacterController>();
        input      = target.GetComponent <MarioInput>();
    }
    void Start()
    {
        currentCameraPosition = InitialPosition;

        target = GameObject.FindWithTag("Player").transform;

        input      = target.GetComponent <MarioInput>();
        mario      = target.GetComponent <MarioMachine>();
        controller = target.GetComponent <SuperCharacterController>();

        currentRotationHorizontal = mario.InitialRotation;

        var height = Mathf.Lerp(MinHeight, MaxHeight, currentCameraPosition);

        verticalPosition = Math3d.ProjectPointOnLine(Vector3.zero, controller.up, target.position + height * controller.up);

        StartCoroutine(ConstantShake());
    }