initial upload
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
[Serializable]
|
||||
public class flashlight : MonoBehaviour
|
||||
{
|
||||
public GameObject flashLight;
|
||||
|
||||
public AudioClip switchsound;
|
||||
|
||||
public bool Paused;
|
||||
|
||||
public Light myLight;
|
||||
|
||||
|
||||
public virtual void Update()
|
||||
{
|
||||
if (Input.GetKeyDown("f"))
|
||||
{
|
||||
myLight.enabled = !myLight.enabled;
|
||||
GetComponent<AudioSource>().PlayOneShot(switchsound);
|
||||
}
|
||||
if (Input.GetMouseButtonDown(1))
|
||||
{
|
||||
myLight.enabled = !myLight.enabled;
|
||||
GetComponent<AudioSource>().PlayOneShot(switchsound);
|
||||
}
|
||||
if (Input.GetKeyDown("h"))
|
||||
{
|
||||
Cursor.visible = false;
|
||||
}
|
||||
if (Input.GetKeyDown("g"))
|
||||
{
|
||||
Cursor.visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
|
||||
myLight = flashLight.GetComponent<Light>();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user