Tweak the tree hiding shader
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Toria.Game
|
||||
{
|
||||
[CreateAssetMenu(menuName = "Toria/VFX/DitherFadeSettings")]
|
||||
public class DitherFadeSettings : ScriptableObject
|
||||
{
|
||||
public float verticalOffset;
|
||||
public Vector2 cameraDistanceRange;
|
||||
public Vector2 hideRadiusRange;
|
||||
|
||||
public float GetHideRadius(Transform player, Transform camera)
|
||||
{
|
||||
float normalizedDist = Mathf.InverseLerp(cameraDistanceRange.x, cameraDistanceRange.y, Vector3.Distance(player.position, camera.position));
|
||||
return Mathf.Lerp(hideRadiusRange.x, hideRadiusRange.y, normalizedDist);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user