Esempio n. 1
0
 private void CellOnCellClicked(object sender, EventArgs eventArgs)
 {
     if (sender is GameCellDisplay cellDisplay)
     {
         CellClicked?.Invoke(this, new CellClickArgs(cellDisplay.CellCord));
     }
 }
Esempio n. 2
0
 void OnMouseDown()
 {
     if (CellClicked != null)
     {
         CellClicked.Invoke(this, new EventArgs());
     }
 }
Esempio n. 3
0
 public void OnMouseDown()
 {
     if (CellClicked != null)
     {
         CellClicked.Invoke(this, new EventArgs());
     }
     //ui_operator.HideCard();
 }
Esempio n. 4
0
 public void OnMouseDown()
 {
     MarkAsSelected(!isSelected);
     if (CellClicked != null)
     {
         CellClicked.Invoke(this, null);
     }
 }
Esempio n. 5
0
 void OnMouseDown()
 {
     if (CellClicked != null)
     {
         if (!EventSystem.current.IsPointerOverGameObject())
         {
             CellClicked.Invoke(this, new EventArgs());
         }
     }
 }
Esempio n. 6
0
 protected virtual void OnMouseOver()
 {
     if (Input.GetMouseButtonDown(0) && !EventSystem.current.IsPointerOverGameObject() && CellClicked != null)
     {
         CellClicked.Invoke(this, new EventArgs());
     }
     if (Input.GetMouseButtonDown(1) && !EventSystem.current.IsPointerOverGameObject() && CellRightClicked != null)
     {
         CellRightClicked.Invoke(this, new EventArgs());
     }
 }
Esempio n. 7
0
    //Color DISABLED_TEXT_COLOR = new Color(0.1961f, 0.1961f, 0.1961f);

    public void UpdateWithIndexDelegateAndName(int aIndex, CellClicked aCellClickedHandler, CellClicked aCellDeleteClickedHandler, string aName, bool showImage)
    {
        if (!prepared)
        {
            Prepare();
        }

        index = aIndex;
        button.interactable = aCellClickedHandler != null;
        if (aCellClickedHandler != null)
        {
            CellClickedHandler = aCellClickedHandler;
            if (nameText.color.a != 1f)
            {
                nameText.color = new Color(nameText.color.r, nameText.color.g, nameText.color.b, 1f);
            }
        }
        else
        {
            int  nameNumber;
            bool isNumeric = int.TryParse(aName, out nameNumber);
            if (isNumeric)
            {
                nameText.color = new Color(nameText.color.r, nameText.color.g, nameText.color.b, DISABLED_ALPHA);
            }
        }

        nameText.text       = aName;
        solvedImage.enabled = showImage;

        if (solvedText != null)
        {
            if (showImage)
            {
                solvedText.text = (aIndex + 1).ToString();
            }
            else
            {
                solvedText.text = "";
            }
        }

        CellDeleteClickedHandler = aCellDeleteClickedHandler;
        if (deleteButton != null)
        {
            deleteButton.onClick.AddListener(DeleteButtonPressed);
        }
    }
Esempio n. 8
0
        private void OnCellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (dataGrid.CurrentCell != null)
                {
                    dataGrid.BeginEdit(true);

                    CellClicked?.Invoke(this, new DataGridViewCellEventArgs(dataGrid.CurrentCell.ColumnIndex, dataGrid.CurrentCell.RowIndex));
                }
            }
            catch (InvalidOperationException ex)
            {
                Debug.WriteLine(ex.ToString());
            }
        }
Esempio n. 9
0
 void OnMouseDown()
 {
     CellClicked?.Invoke(this);
 }
Esempio n. 10
0
        private void OnCellClicked(object sender, EventArgs e)
        {
            CellBox cellBox = (CellBox)sender;

            CellClicked?.Invoke(cellBox.Cell);
        }