please , how to change this into c#
script basicly just turn off object while turning on another same time and vice versa
#pragma strict
var A : GameObject;
var B : GameObject;
var On : boolean;
function Update () {
if (Input.GetKeyDown(KeyCode.Return)) {
if (On == true) {
On = false;
} else {
On = true;
}
}
if (On == true) {
A.SetActive(true);
B.SetActive(false);
} else {
A.SetActive(false);
B.SetActive(true);
}
}