Esempio n. 1
0
    public virtual void FixedUpdate()
    {
        if (lookTarget == null)
        {
            lookTarget = posTarget.lookTarget;
        }

        CompensateForWalls(transform.position, posTarget.transform, player.position, out TargetPosition);
        transform.position = Vector3.Lerp(transform.position, TargetPosition, Time.fixedDeltaTime * dampPosSpeed);
        StatePatternController.SlerpForMe(transform, lookTarget.position, dampPosSpeed, Time.fixedDeltaTime);
    }
 // Update is called once per frame
 void LateUpdate()
 {
     yrot   += Input.GetAxis("CameraX") * Time.deltaTime * 20 * XSENSITIVITY * sensitivityModifier;
     xrot    = Mathf.Clamp(Input.GetAxis("CameraY") * Time.deltaTime * 20 * YSENSITIVITY * sensitivityModifier + xrot, -90, 90);
     lookPos = Vector3.Lerp(maxZ.position, minZ.position, (xrot + 90) / 180);
     StatePatternController.SlerpForMe(transform, new Vector3(lookPos.x, Mathf.Clamp(lookPos.y, yMin, yMax), lookPos.z), dampSpeed, Time.deltaTime);
     transform.eulerAngles = new Vector3(transform.eulerAngles.x, yrot * horizontalSpeed, transform.eulerAngles.z);
     //transform.Rotate(new Vector3(0, yrot*Time.deltaTime, 0));
     //var rotation = Quaternion.LookRotation(target - looker.position);
     //looker.transform.rotation = Quaternion.Slerp(looker.transform.rotation, rotation, Time.deltaTime * damping);
 }
Esempio n. 3
0
 public State_Grounded(StatePatternController controller)
 {
     player = controller;
 }
 public State_Run(StatePatternController controller)
 {
     player = controller;
 }
Esempio n. 5
0
 public State_Casual(StatePatternController controller)
 {
     player = controller;
 }
 public State_Combat(StatePatternController controller)
 {
     player = controller;
 }
 public State_Interaction(StatePatternController controller)
 {
     player = controller;
 }