This commit is contained in:
CortexCore
2023-09-01 14:33:54 +08:00
parent 4fadd3a530
commit 8ef5c7ec0a
451 changed files with 1048940 additions and 2028 deletions

View File

@@ -0,0 +1,33 @@
// Fantasy Adventure Environment
// Copyright Staggart Creations
// staggart.xyz
using UnityEngine;
using System.Collections;
namespace FAE
{
#if UNITY_EDITOR
using UnityEditor;
[ExecuteInEditMode]
#endif
/// <summary>
/// Sets world-space obstacle position and bending strength on the FAE foliage shader
/// </summary>
public class FoliageBender : MonoBehaviour
{
[Range(0f, 100f)]
public float strength = 20f;
[Range(0f, 5f)]
public float radius = 1.5f;
void Update()
{
Shader.SetGlobalVector("_ObstaclePosition", this.transform.position);
Shader.SetGlobalFloat("_BendingStrength", strength);
Shader.SetGlobalFloat("_BendingRadius", radius);
}
}
}