46 lines
1.1 KiB
C#
46 lines
1.1 KiB
C#
using UnityEngine;
|
|
|
|
public class _appControlerShaderOnTriplanarMesh : MonoBehaviour
|
|
{
|
|
public bool shadows;
|
|
|
|
public bool forward_path = true;
|
|
|
|
private bool panel_enabled;
|
|
|
|
public float model_dir;
|
|
|
|
private void Awake()
|
|
{
|
|
panel_enabled = true;
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
if (Input.GetKeyDown(KeyCode.P))
|
|
{
|
|
panel_enabled = !panel_enabled;
|
|
}
|
|
}
|
|
|
|
private void OnGUI()
|
|
{
|
|
GUILayout.Space(10f);
|
|
GUILayout.BeginVertical("box");
|
|
GUILayout.Label(string.Empty + FPSmeter.fps);
|
|
if (panel_enabled)
|
|
{
|
|
shadows = GUILayout.Toggle(shadows, "disable Unity's shadows");
|
|
Light component = GameObject.Find("Directional light").GetComponent<Light>();
|
|
component.shadows = ((!shadows) ? LightShadows.Soft : LightShadows.None);
|
|
forward_path = GUILayout.Toggle(forward_path, "forward rendering");
|
|
Camera component2 = GameObject.Find("Main Camera").GetComponent<Camera>();
|
|
component2.renderingPath = (forward_path ? RenderingPath.Forward : RenderingPath.DeferredShading);
|
|
GUILayout.Label(" Drag model/env to rotate");
|
|
GUILayout.Label(" Wheel - zoom camera");
|
|
}
|
|
GUILayout.Label(" P - toggle panel");
|
|
GUILayout.EndVertical();
|
|
}
|
|
}
|