HeroCamera.FirstPerson C# (CSharp) 메소드

FirstPerson() 공개 메소드

public FirstPerson ( ) : void
리턴 void
    void FirstPerson()
    {
        // Horizontal
        xAngl = hero.eulerAngles.y;
        // Vertical
        yAngl = ClampAngle (yAngl, minAngleY /1.5f, maxAngleY /1.1f);

        // Desired distance
        desDist = fpsCamDist;
        // Camera rotation
        Quaternion camRot = Quaternion.Euler (yAngl, xAngl, 0);
        // Camera position
        Vector3 camPos = headBone.position - (cam.forward * desDist) - (cam.up * -heroHeight /4);

        // Apply Y-mouse axis
        yAngl -= Input.GetAxis ("Mouse Y") * ySpeed * 0.02f;

        // Apply position and rotation
        cam.rotation = camRot;
        cam.position = camPos;
    }