You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
2.4 KiB
C#

//using System.Collections;
//using System.Collections.Generic;
//using UnityEngine;
//using SiegeSong;
4 years ago
//namespace SiegeSong
//{
// public class HeadTurn : MonoBehaviour
// {
// public Transform HeadBone;
// public Transform RibcageBone;
// public Transform LookTarget;
// public CameraManager CameraManager;
// public Motor Motor;
4 years ago
// private float rotationXMin = 350.0f;
// private float rotationXMax = 350.0f;
// private float rotationYMin = -60.0f;
// private float rotationYMax = 80.0f;
4 years ago
// private float rotationXOffset = 0.0f;
// private float rotationYOffset = 180.0f;
4 years ago
// private float rotationXModifier = 1.0f;
// private float rotationYModifier = 1.0f;
// private float rotationZModifier = 1.0f;
4 years ago
// private float previousX;
// private float previousY;
// private float previousZ;
4 years ago
// void Start()
// {
4 years ago
// }
4 years ago
// void LateUpdate()
// {
// if (Motor.Moving == false)
// {
// var direction = new Vector3(1, -1, 1);
// if (LookTarget == null)
// direction = new Vector3(
// (CameraManager.ActiveCamera.transform.rotation.eulerAngles.x + rotationXOffset) * rotationXModifier,
// (CameraManager.ActiveCamera.transform.rotation.eulerAngles.y + rotationYOffset) * rotationYModifier,
// -CameraManager.ActiveCamera.transform.rotation.eulerAngles.z * rotationZModifier);
// else
// direction = LookTarget.position - HeadBone.position;
4 years ago
// var resetingHeadTurn = true;
// if (direction.y - rotationYOffset > rotationYMax)
// {
// previousY = direction.y;
// resetingHeadTurn = false;
// }
// if (direction.y + rotationYOffset < rotationYMin)
// {
// previousY = direction.y;
// resetingHeadTurn = false;
// }
4 years ago
// if (resetingHeadTurn)
// {
// direction.y = previousY;
// resetingHeadTurn = false;
// }
// else
// {
// HeadBone.eulerAngles = direction;
// }
// }
// }
// }
//}