コード例 #1
0
    public void ResetCamera()
    {
        targetTransform.position = Vector3.zero;
        transform.position       = targetTransform.position - initDistanceToCenter * transform.forward;
        Vector3 direction = (targetTransform.position - transform.position).normalized;

        transform.rotation = Quaternion.LookRotation(direction, Vector3.up);

        perpendToViewplane.SetNormalAndPosition(Vector3.up, Vector3.zero);
        lockedTransform = null;
        state           = CameraState.isIdling;
        isLocked        = false;
        lockedTransform = null;

        distanceTozero = transform.position.magnitude;
        xDeg           = MathLibrary.AngleSigned(Vector3.right, transform.right, Vector3.up);
        yDeg           = Vector3.Angle(Vector3.up, transform.up);
    }