added animation, pickaxe, fixed lookaround

This commit is contained in:
TAASONI3
2023-12-27 10:54:16 +01:00
parent 4626722b94
commit 0865eee42f
20 changed files with 1450 additions and 550 deletions

View File

@@ -8,19 +8,12 @@ namespace Assets.Scripts.Player
public class PlayerCamera : MonoBehaviour
{
UIHandler uihandler;
GameObject player;
Vector2 rotation = Vector2.zero;
public float mouseSpeed = 100; //the sensibility
public float controllerSpeed = 0.01f; //the sensibility
float xMaxLimit = 50.0f;
float xMinLimit = -50.0f;
GameObject interact;
// Start is called before the first frame update
void Start()
{
uihandler = GameObject.Find("UIHandler").GetComponent<UIHandler>();
player = gameObject.transform.parent.gameObject;
interact = GameObject.Find("pnlInteract");
interact.transform.localScale = new Vector3(0, 0, 0);
}
@@ -29,7 +22,6 @@ namespace Assets.Scripts.Player
void Update()
{
transform.position = new Vector3(transform.parent.transform.position.x, transform.position.y, transform.parent.transform.position.z);
}
private void FixedUpdate()
@@ -37,22 +29,6 @@ namespace Assets.Scripts.Player
showInformation();
}
public void lookAround(Vector2 view, bool isController)
{
rotation.y += view.x;
rotation.x += -view.y;
//rotation.x = Mathf.Clamp(rotation.x, xMinLimit, xMaxLimit);
if (isController)
{
transform.eulerAngles = rotation * (controllerSpeed * Time.deltaTime);
}
else
{
transform.eulerAngles = rotation * mouseSpeed;
//TODO: Look at camera movement -> Not rly smooth. Weird drag
}
}
public GameObject interactWithObject()
{
RaycastHit hit;