29 lines
582 B
C#
29 lines
582 B
C#
using System;
|
|
using UnityEngine;
|
|
|
|
[Serializable]
|
|
public class togglevision : MonoBehaviour
|
|
{
|
|
public Transform NoFog;
|
|
|
|
public AudioClip switchsound;
|
|
|
|
public virtual void Update()
|
|
{
|
|
if (Input.GetKeyDown("f"))
|
|
{
|
|
GetComponent<AudioSource>().PlayOneShot(switchsound);
|
|
UnityEngine.Object.Instantiate(NoFog, transform.position, transform.rotation);
|
|
}
|
|
if (Input.GetMouseButtonDown(1))
|
|
{
|
|
GetComponent<AudioSource>().PlayOneShot(switchsound);
|
|
UnityEngine.Object.Instantiate(NoFog, transform.position, transform.rotation);
|
|
}
|
|
}
|
|
|
|
public virtual void Main()
|
|
{
|
|
}
|
|
}
|