initial upload
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
[Serializable]
|
||||
public class nightvision : MonoBehaviour
|
||||
{
|
||||
public GameObject flashlight;
|
||||
|
||||
public AudioClip switchsound;
|
||||
|
||||
public Light myLight;
|
||||
|
||||
public nightvision()
|
||||
{
|
||||
myLight = (Light)flashlight.GetComponent("Light");
|
||||
}
|
||||
|
||||
public virtual void Update()
|
||||
{
|
||||
if (GetComponent<NetworkView>().isMine && Input.GetKeyDown("n"))
|
||||
{
|
||||
myLight.enabled = !myLight.enabled;
|
||||
GetComponent<AudioSource>().PlayOneShot(switchsound);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void Main()
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user