
Fixed shadows with shader, optimized few things for mobiles, added CulledCamera script to prevent meshes to dissapear in front of camera WorldCurver now lives in GameSession, from which it will be controlled
25 lines
574 B
C#
25 lines
574 B
C#
using UnityEngine;
|
|
|
|
[ExecuteInEditMode]
|
|
public class WorldCurver : MonoBehaviour
|
|
{
|
|
[Range(-0.1f, 0.1f)]
|
|
public float curveStrengthY = 0.01f;
|
|
[Range(-0.1f, 0.1f)]
|
|
public float curveStrengthX = 0.01f;
|
|
|
|
private int curveStrengthXID;
|
|
private int curveStrengthYID;
|
|
private void OnEnable()
|
|
{
|
|
curveStrengthYID = Shader.PropertyToID("_CurveStrength_y");
|
|
curveStrengthXID = Shader.PropertyToID("_CurveStrength_x");
|
|
}
|
|
|
|
public void Tick()
|
|
{
|
|
Shader.SetGlobalFloat(curveStrengthYID, curveStrengthY);
|
|
Shader.SetGlobalFloat(curveStrengthXID, curveStrengthX);
|
|
}
|
|
}
|