コード例 #1
0
    public void OnPointerClick(PointerEventData eventData) // 3
    {
        if (this.GetComponent <Text>().color == GREY)
        {
            selected = false;
        }
        else
        {
            selected = true;
        }
        GameObject  bg          = GameObject.Find("background");
        Deselection deselection = bg.GetComponent <Deselection>();

        deselection.deselectAll();

        sound.Play();
        if (selected)
        {
            this.GetComponent <Text>().color = GREY;
        }
        else
        {
            this.GetComponent <Text>().color = Color.red;
        }
        selected = !selected;
    }
コード例 #2
0
 private void Deselect()
 {
     Deselection?.Invoke(this, new EventArgs());
 }