Minor bug fixes I can fix now that the voting is finished
This commit is contained in:
@@ -896,10 +896,10 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_UiScaleMode: 0
|
||||
m_UiScaleMode: 1
|
||||
m_ReferencePixelsPerUnit: 100
|
||||
m_ScaleFactor: 1
|
||||
m_ReferenceResolution: {x: 800, y: 600}
|
||||
m_ReferenceResolution: {x: 1920, y: 1080}
|
||||
m_ScreenMatchMode: 0
|
||||
m_MatchWidthOrHeight: 0
|
||||
m_PhysicalUnit: 3
|
||||
|
||||
@@ -956,10 +956,10 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_UiScaleMode: 0
|
||||
m_UiScaleMode: 1
|
||||
m_ReferencePixelsPerUnit: 100
|
||||
m_ScaleFactor: 1
|
||||
m_ReferenceResolution: {x: 800, y: 600}
|
||||
m_ReferenceResolution: {x: 1920, y: 1080}
|
||||
m_ScreenMatchMode: 0
|
||||
m_MatchWidthOrHeight: 0
|
||||
m_PhysicalUnit: 3
|
||||
|
||||
@@ -16,6 +16,9 @@ public class EnemyScript : MonoBehaviour
|
||||
|
||||
private AudioSource audioSource;
|
||||
|
||||
private Vector3 previousPosition;
|
||||
private Vector3 currentMovementDirection;
|
||||
|
||||
void Start()
|
||||
{
|
||||
rb = GetComponent<Rigidbody2D>();
|
||||
@@ -39,8 +42,13 @@ public class EnemyScript : MonoBehaviour
|
||||
transform.position, player.transform.position, speed * Time.deltaTime);
|
||||
}
|
||||
|
||||
animator.SetFloat("Horizontal", movement.x);
|
||||
animator.SetFloat("Vertical", movement.y);
|
||||
if(previousPosition != transform.position) {
|
||||
currentMovementDirection = (transform.position - previousPosition);
|
||||
previousPosition = transform.position;
|
||||
}
|
||||
|
||||
animator.SetFloat("Horizontal", currentMovementDirection.y);
|
||||
animator.SetFloat("Vertical", currentMovementDirection.x);
|
||||
animator.SetBool("Speed", true);
|
||||
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
Reference in New Issue
Block a user