unity starter asset package importiert
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
//Morten
|
||||
using UnityEngine;
|
||||
|
||||
public class Door_Rotate : MonoBehaviour
|
||||
@@ -38,7 +39,7 @@ public class Door_Rotate : MonoBehaviour
|
||||
isOpen = !isOpen;
|
||||
targetRotation = isOpen ? currentRotation + openAngle : currentRotation - openAngle;
|
||||
}
|
||||
|
||||
//Smoothe rotation der tür
|
||||
private void SmoothRotateDoor()
|
||||
{
|
||||
currentRotation = Mathf.Lerp(currentRotation, targetRotation, Time.deltaTime * rotationSpeed);
|
||||
@@ -50,7 +51,7 @@ public class Door_Rotate : MonoBehaviour
|
||||
transform.localEulerAngles.z
|
||||
);
|
||||
}
|
||||
|
||||
//checkt ob der spieler auf die Tür schaut und ob er nah genug ist, um sie zu öffnen https://docs.unity3d.com/6000.4/Documentation/ScriptReference/Physics.Raycast.html
|
||||
private bool IsPlayerLooking()
|
||||
{
|
||||
if (playerCamera == null) return false;
|
||||
|
||||
Reference in New Issue
Block a user