public void OnLoadClicked() { // Clear buttons ClearGestureButtons(); using (BinaryReader reader = new BinaryReader(File.Open("data/Generator.gg", FileMode.Open))) { mGenerator = new GestureNeuralNetworkGenerator(reader); } // Load in gestures List <string> gestureNames = mGenerator.GetGestureNames(); // Create buttons for the gestures foreach (string name in gestureNames) { AddGestureButton(name); } if (gestureNames.Count > 0) { SetTrainingGesture(gestureNames[gestureNames.Count - 1]); } // Set current Generator threshold mThresholdSlider.value = mGenerator.MinThreshold; SetStatusText("LOAD Success"); }
// Use this for initialization void Start() { mGestureButtons = new List <GameObject>(); mNextGestureButtonPosition = BUTTON_START_POSITION; mGenerator = new GestureNeuralNetworkGenerator(); Gesturer.SetReceiver(this); mThresholdSlider = GameObject.Find("ThresholdSlider").GetComponent <Slider>(); mThresholdValue = GameObject.Find("ThresholdValue").GetComponent <Text>(); mIsTraining = true; }