Синтаксис:
Используется csharp
private Animator anim;
private Camera MainCam;
private Camera InstCam;
private GameObject Instrument;
private Text info;
private float change;
private Color prozr;
bool index = false;
public void ToDivision() {
}
public void ToMainCamera() {
MainCam = GameObject.Find("Main Menu Camera").GetComponent<Camera>();
MainCam.enabled = true;
InstCam = GameObject.Find("Camera inst menu").GetComponent<Camera>();
InstCam.enabled = false;
}
public void indexCheck() {
index = !index;
}
public void ToResectionKnife() {
MainCam = GameObject.Find("Main Menu Camera").GetComponent<Camera>();
MainCam.enabled = false;
InstCam = GameObject.Find("Camera inst menu").GetComponent<Camera>();
InstCam.enabled = true;
Instrument = GameObject.Find("Resection_knife");
Instrument.transform.localPosition = new Vector3(0,0,0);
}
public void InfoResectionKnife() {
info = GameObject.Find("Resection_knife text").GetComponent<Text>();
change = Time.deltaTime * 20f;
prozr = info.GetComponent<Color>();
if (index == true) {
prozr.a += change;
}
private Camera MainCam;
private Camera InstCam;
private GameObject Instrument;
private Text info;
private float change;
private Color prozr;
bool index = false;
public void ToDivision() {
}
public void ToMainCamera() {
MainCam = GameObject.Find("Main Menu Camera").GetComponent<Camera>();
MainCam.enabled = true;
InstCam = GameObject.Find("Camera inst menu").GetComponent<Camera>();
InstCam.enabled = false;
}
public void indexCheck() {
index = !index;
}
public void ToResectionKnife() {
MainCam = GameObject.Find("Main Menu Camera").GetComponent<Camera>();
MainCam.enabled = false;
InstCam = GameObject.Find("Camera inst menu").GetComponent<Camera>();
InstCam.enabled = true;
Instrument = GameObject.Find("Resection_knife");
Instrument.transform.localPosition = new Vector3(0,0,0);
}
public void InfoResectionKnife() {
info = GameObject.Find("Resection_knife text").GetComponent<Text>();
change = Time.deltaTime * 20f;
prozr = info.GetComponent<Color>();
if (index == true) {
prozr.a += change;
}
Все происходит в public void InfoResectionKnife()