add unity project

add SOLID examples
This commit is contained in:
2025-04-09 07:49:12 +02:00
parent ff37858d12
commit a4f498a33d
102 changed files with 8244 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
using System;
using UnityEngine;
namespace DefaultNamespace.Solid
{
public class PlayerInput : MonoBehaviour
{
[SerializeField] private float _speed = 10.0f;
[SerializeField] private float _rotationSpeed = 60.0f;
public Vector3 Movement { get; private set; }
public float Rotation { get; private set; }
public event Action IsFired;
public void HandleInput()
{
Movement = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical"));
Movement *= _speed * Time.deltaTime;
Rotation = Input.GetAxis("Mouse X") * _rotationSpeed * Time.deltaTime;
if (Input.GetButtonDown("Fire1"))
{
IsFired?.Invoke();
}
}
}
}