Organization of Game Files
Created folder for C# files, player, and enemy so it's a little cleaner...
This commit is contained in:
24
Assets/C# Scripts/Sword.cs
Normal file
24
Assets/C# Scripts/Sword.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class Sword : MonoBehaviour
|
||||
{
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
// Point sword towards mouse cursor with garbage trig
|
||||
transform.rotation = Quaternion.Euler(
|
||||
new Vector3 (0, 0, Mathf.Atan2(
|
||||
Screen.height/2 - Input.mousePosition.y,
|
||||
Screen.width/2 - Input.mousePosition.x
|
||||
) * Mathf.Rad2Deg + 135)
|
||||
);
|
||||
}
|
||||
void Swing() {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user