@@ -8,6 +8,7 @@ namespace Camera
|
||||
{
|
||||
private UnityEngine.Camera _camera;
|
||||
private PostProcessVolume _processVolume;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_camera = GetComponent<UnityEngine.Camera>();
|
||||
@@ -23,12 +24,14 @@ namespace Camera
|
||||
private void PostProcess()
|
||||
{
|
||||
_camera.fieldOfView = Mathf.Lerp(_camera.fieldOfView, 90f, Time.deltaTime * 10f);
|
||||
_processVolume.profile.GetSetting<ChromaticAberration>().intensity.value = Mathf.Lerp(_processVolume.profile.GetSetting<ChromaticAberration>().intensity.value, 1f, Time.deltaTime * 10f);
|
||||
_processVolume.profile.GetSetting<ChromaticAberration>().intensity.value = Mathf.Lerp(
|
||||
_processVolume.profile.GetSetting<ChromaticAberration>().intensity.value, 1f, Time.deltaTime * 10f);
|
||||
}
|
||||
|
||||
private void ProcessingStop()
|
||||
{
|
||||
_processVolume.profile.GetSetting<ChromaticAberration>().intensity.value = Mathf.Lerp(_processVolume.profile.GetSetting<ChromaticAberration>().intensity.value, 0f, Time.deltaTime * 10f);
|
||||
_processVolume.profile.GetSetting<ChromaticAberration>().intensity.value = Mathf.Lerp(
|
||||
_processVolume.profile.GetSetting<ChromaticAberration>().intensity.value, 0f, Time.deltaTime * 10f);
|
||||
_camera.fieldOfView = Mathf.Lerp(_camera.fieldOfView, 60f, Time.deltaTime * 10f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace Camera
|
||||
private Vector3 _originalPos;
|
||||
private bool _isRunning;
|
||||
private bool _isWalking;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
_originalPos = cameraTransform.localPosition;
|
||||
@@ -59,10 +60,10 @@ namespace Camera
|
||||
var yShake = Mathf.Cos(Time.time * frequency / 2 * 2) * amplitude * 0.5f;
|
||||
|
||||
cameraTransform.localPosition = _originalPos + new Vector3(xShake, yShake, 0);
|
||||
}else
|
||||
}
|
||||
else
|
||||
cameraTransform.localPosition = _originalPos;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -72,6 +72,7 @@ namespace Event
|
||||
{
|
||||
PlayerRunStart?.Invoke();
|
||||
}
|
||||
|
||||
public void OnPlayerRunning()
|
||||
{
|
||||
PlayerRunning?.Invoke();
|
||||
|
||||
@@ -4,7 +4,7 @@ using Items.Interface;
|
||||
|
||||
namespace Items
|
||||
{
|
||||
public class TestItem : ItemBase , IItem
|
||||
public class TestItem : ItemBase, IItem
|
||||
{
|
||||
protected override void ActivateItem()
|
||||
{
|
||||
|
||||
@@ -37,6 +37,7 @@ namespace Keyboard
|
||||
{
|
||||
_instance = this;
|
||||
}
|
||||
|
||||
DontDestroyOnLoad(gameObject);
|
||||
filePath = Application.persistentDataPath + "/" + "KeySetting.json";
|
||||
LoadKeySettings();
|
||||
|
||||
@@ -23,7 +23,8 @@ namespace Player
|
||||
|
||||
private void Run()
|
||||
{
|
||||
_velocity = KeySettingManager.Instance.Direction.x * transform.right + KeySettingManager.Instance.Direction.y * transform.forward;
|
||||
_velocity = KeySettingManager.Instance.Direction.x * transform.right +
|
||||
KeySettingManager.Instance.Direction.y * transform.forward;
|
||||
rb.AddForce(_velocity.normalized * (Time.deltaTime * 50), ForceMode.Impulse);
|
||||
if (_velocity == Vector3.zero)
|
||||
{
|
||||
@@ -32,7 +33,9 @@ namespace Player
|
||||
temp.y = rb.velocity.y;
|
||||
rb.velocity = temp;
|
||||
}
|
||||
if (Input.GetKey(KeySettingManager.Instance.GetKey("Run")) && KeySettingManager.Instance.Direction != Vector2.zero)
|
||||
|
||||
if (Input.GetKey(KeySettingManager.Instance.GetKey("Run")) &&
|
||||
KeySettingManager.Instance.Direction != Vector2.zero)
|
||||
{
|
||||
if (!_isRunning)
|
||||
{
|
||||
@@ -41,10 +44,13 @@ namespace Player
|
||||
EventManager.Instance.OnPlayerWalkStop();
|
||||
EventManager.Instance.OnPlayerRunStart();
|
||||
}
|
||||
|
||||
EventManager.Instance.OnPlayerRunning();
|
||||
rb.velocity = Vector3.ClampMagnitude(rb.velocity, maxVelocity+2);
|
||||
rb.velocity = Vector3.ClampMagnitude(rb.velocity, maxVelocity + 2);
|
||||
}
|
||||
if (!Input.GetKey(KeySettingManager.Instance.GetKey("Run")) && KeySettingManager.Instance.Direction != Vector2.zero)
|
||||
|
||||
if (!Input.GetKey(KeySettingManager.Instance.GetKey("Run")) &&
|
||||
KeySettingManager.Instance.Direction != Vector2.zero)
|
||||
{
|
||||
if (!_isWalking)
|
||||
{
|
||||
@@ -53,6 +59,7 @@ namespace Player
|
||||
EventManager.Instance.OnPlayerRunStop();
|
||||
EventManager.Instance.OnPlayerWalkStart();
|
||||
}
|
||||
|
||||
EventManager.Instance.OnPlayerWalking();
|
||||
rb.velocity = Vector3.ClampMagnitude(rb.velocity, maxVelocity);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,8 @@ namespace UI
|
||||
{
|
||||
[SerializeField] private string dialogsPath;
|
||||
[SerializeField] private string dialogJson;
|
||||
private Dictionary<int,string> _dialogsMap = new();
|
||||
private Dictionary<int, string> _dialogsMap = new();
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
dialogsPath = Application.persistentDataPath + "/" + "Dialogs.json";
|
||||
@@ -19,7 +20,7 @@ namespace UI
|
||||
if (File.Exists(dialogsPath))
|
||||
{
|
||||
dialogJson = File.ReadAllText(dialogsPath);
|
||||
_dialogsMap = JsonConvert.DeserializeObject<Dictionary<int,string>>(dialogJson);
|
||||
_dialogsMap = JsonConvert.DeserializeObject<Dictionary<int, string>>(dialogJson);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user