void Update() { //Check if the right Mouse button is clicked if (Input.GetMouseButtonDown(1)) { //Set up the new Pointer Event m_PointerEventData = new PointerEventData(m_EventSystem); //Set the Pointer Event Position to that of the mouse position m_PointerEventData.position = Input.mousePosition; //Create a list of Raycast Results List <RaycastResult> results = new List <RaycastResult>(); //Raycast using the Graphics Raycaster and mouse click position m_Raycaster.Raycast(m_PointerEventData, results); //For every result returned, output the name of the GameObject on the Canvas hit by the Ray foreach (RaycastResult result in results) { if (result.gameObject.name == objectNameToHit) { m_MaskManager.AddMask(); return; } Debug.Log("Hit " + result.gameObject.name); } } }
private void buttonSettingsOK_Click(object sender, EventArgs e) { MaskManager.Mask newMask = new MaskManager.Mask(); newMask.BruteMask = textBoxMask.Text; newMask.Description = textBoxDescription.Text; newMask.Charset1 = textBoxCharset1.Text; newMask.Charset2 = textBoxCharset2.Text; newMask.Charset3 = textBoxCharset3.Text; newMask.Charset4 = textBoxCharset4.Text; newMask.UseCharset1 = checkBoxCharset1.Checked; newMask.UseCharset2 = checkBoxCharset2.Checked; newMask.UseCharset3 = checkBoxCharset3.Checked; newMask.UseCharset4 = checkBoxCharset4.Checked; newMask.EnableIncrement = checkBoxEnableIncrement.Checked; newMask.IncrementMin = (byte)numericUpDownIncrementMin.Value; newMask.IncrementMax = (byte)numericUpDownIncrementMax.Value; if (changingMaskId == -1) { maskManager.AddMask(newMask); (Owner as SettingsForm).VisualizeNewMask(); } else { maskManager.UpdateMask(changingMaskId, newMask); (Owner as SettingsForm).VisualizeMask(changingMaskId); } Close(); }