void OnGUI() { GUILayoutOption height = GUILayout.Height(Screen.height * 0.05f); #if UNITY_EDITOR && !DEBUG if (GUILayout.Button("Add dummy flyer", height)) { AddFlyer(); UpdateFlyers(); } if (GUILayout.Button("Update", height)) { UpdateFlyers(); } #else GUILayout.BeginHorizontal(); { if (GUILayout.Button("Open Full Picker", height)) { SetData(false, true, false); imagePicker.StartImagePicker(data); } if (GUILayout.Button("Open Default Camera", height)) { SetData(true, true, false); imagePicker.StartImagePicker(data); } if (GUILayout.Button("Open Default Picker", height)) { SetData(true, false, false); imagePicker.StartImagePicker(data); } if (GUILayout.Button("Open Multiple Select", height)) { SetData(false, false, true); imagePicker.StartImagePicker(data); } } GUILayout.EndHorizontal(); GUILayout.Label("Received images waiting for processing: " + items); if (!started && GUILayout.Button("Begin receiving")) { started = true; } if (!timeOut.IsDone) { GUILayout.Label("Processing, please wait " + timeOut.ToString(2, "s")); } #endif }
void OnMouseUpAsButton() { if (busy) { return; } busy = true; //Declare the differences between the instances of this class data.fileName = gameObject.name; data.DialogTitle = "Replace Photo Cube " + gameObject.name; data.imageSetter = SetTextureOnMaterial; //Run it, knowing the others of this class will wait for the imageSetter to invoke and clear the busy flag imagePick.StartImagePicker(data); }