0

how to convert a script to JS in C#

hello, everyone, i'm looking for a way or a person who help me convert a JS script into C# https://code.sololearn.com/cIFx4m3xFYbs/?ref=app Code : // ceci et un code en JS donc normal que je les mis dans java. // script utilisable sur n'importe quelle version de Unity. var soundTurnOn : AudioClip; var soundTurnOff : AudioClip; var lightl:Light; private var lightOn : boolean = false; function Update () { if (!lightOn && Input.GetKeyDown("f")) { lightOn = !lighOn; lightl.enabled = true; GetComponent.<AudioSource>().clip = soundTurnOn; GetComponent.<AudioSource>().PlayOneShot(soundTurnOn, 0.2f); } else if (lighOn && Input.GetKeyDown ("f")) { lighOn = !lightOn; lightl.enabled = false; GetComponent.<AudioSource>().clip = soundTurnOff; GetComponent.<AudioSource>().PlayOneShot(soundTurnOff, 0.2f); } }

6th Dec 2018, 6:54 AM
Sanchez Maxime
Sanchez Maxime - avatar
1 Réponse
+ 2
Umm I don't think there is a First Party option but look on GitHub and search Javascript to C#
6th Dec 2018, 1:50 PM
Yusuf
Yusuf - avatar