void OnGUI() { Synthesis.Interface(o, c, point, ref start, ref speed, "O2+C=CO2", style); if (start) { StartCoroutine(Change_texts()); } if (start) { for (int i = 0; i < o.Count; i++) { Global_Functions.Start_Anim(start, o[i], point[i], speed); } } }
static public void Interface(List <GameObject> X, List <GameObject> Y, List <Vector3> point, ref bool state, ref float speed, string formula, GUISkin style) { GUILayout.BeginArea(new Rect(0, Screen.height - 50, Screen.width, 100)); GUILayout.BeginHorizontal(); GUI.skin = style; if (state && X.Count == Y.Count) { for (int i = 0; i < X.Count; i++) { Global_Functions.Start_Anim(state, X[i], Y[i], point[i], speed); } } if (GUILayout.Button("Start", GUILayout.Height(50))) { state = true; } if (GUILayout.Button("Pause", GUILayout.Height(50))) { state = false; } if (GUILayout.Button("Stop", GUILayout.Height(50))) { Application.LoadLevel(Application.loadedLevel); } speed = GUILayout.HorizontalSlider(speed, 0.01f, 3.0f); GUILayout.Label("Current speed " + String.Format("{0:F2}", speed)); GUILayout.EndHorizontal(); GUILayout.EndArea(); #region top_panel GUILayout.BeginArea(new Rect(0, 0, Screen.width, 100)); GUILayout.BeginHorizontal(); if (GUILayout.Button(formula, GUILayout.Height(100), GUILayout.Width(Screen.width))) { } GUILayout.EndHorizontal(); GUILayout.EndArea(); #endregion }