// Start is called before the first frame update void Start() { current_offset = 0.0f; flow_direction = FLOW_DIRECTIONS.OUT; flow_coefficient = 1.0f; running = true; this.Stop(); // we start the game stopped. }
/* * Function to show the indicator, when heat starts to flow. */ public void Go(bool flow_outward) { // If we weren't running already, then start. if (!running) { running = true; MeshRenderer[] mr_list = gameObject.GetComponentsInChildren <MeshRenderer>(); foreach (MeshRenderer mr in mr_list) { mr.enabled = true; } } // If we aren't pointing in the same direction as flow, fix it. FLOW_DIRECTIONS correct_direction = flow_outward ? FLOW_DIRECTIONS.OUT : FLOW_DIRECTIONS.IN; if (flow_direction != correct_direction) { flow_direction = correct_direction; float y_rot = flow_outward ? 90f : -90f; T_left.rotation = Quaternion.Euler(90f, y_rot, 0f); T_right.rotation = Quaternion.Euler(90f, y_rot, 0f); } }