revival/game/Assets/Scripts/Input/CameraRelativeInput.cs

24 lines
446 B
C#
Raw Normal View History

2021-01-27 13:06:17 +01:00
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
public struct CameraRelativeInput
{
private Vector2 _base;
private float _cameraAngle;
public void SetValue( Vector2 value )
{
_base = value;
}
public void SetAngle( float angle )
{
_cameraAngle = angle;
}
public Vector2 Value
=> Quaternion.Euler( 0f, 0f, _cameraAngle ) * _base;
}