37 lines
679 B
C#
37 lines
679 B
C#
using UnityEngine;
|
|
using UnityStandardAssets.Cameras;
|
|
|
|
namespace VolumetricFogAndMist
|
|
{
|
|
public class DemoSurroundingFog : MonoBehaviour
|
|
{
|
|
private FreeLookCam cam;
|
|
|
|
private void Start()
|
|
{
|
|
cam = GetComponent<FreeLookCam>();
|
|
}
|
|
|
|
private void OnGUI()
|
|
{
|
|
Rect position = new Rect(10f, 10f, Screen.width - 20, 30f);
|
|
if (cam.enabled)
|
|
{
|
|
GUI.Label(position, "Move around with WASD keys. Press C to disable free look camera");
|
|
}
|
|
else
|
|
{
|
|
GUI.Label(position, "Move around with WASD keys. Press C to enable free look camera");
|
|
}
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
if (Input.GetKeyDown(KeyCode.C))
|
|
{
|
|
cam.enabled = !cam.enabled;
|
|
}
|
|
}
|
|
}
|
|
}
|