add unity project
add SOLID examples
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace DefaultNamespace.Solid
|
||||
{
|
||||
[RequireComponent(typeof(CharacterController))]
|
||||
public class PlayerMovement : MonoBehaviour
|
||||
{
|
||||
private CharacterController _controller;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_controller = GetComponent<CharacterController>();
|
||||
}
|
||||
|
||||
public void MoveAndRotate(Vector3 movement, float rotation)
|
||||
{
|
||||
_controller.Move(movement);
|
||||
_controller.transform.Rotate(Vector3.up, rotation);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user