public MaterialCard()
        {
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.DoubleBuffer, true);
            SetStyle(ControlStyles.ResizeRedraw, true);
            SetStyle(ControlStyles.SupportsTransparentBackColor, true);
            Width     = 294; Height = 348; DoubleBuffered = true;
            BackColor = Color.Transparent;

            AddLabel();
            AddButton();
            Controls.Add(InfoLabel);
            Controls.Add(OKButton);

            OKButton.Click += (sender, args) => ActionButtonClicked?.Invoke(this);
            OKButton.ClickAnimationFinished += sender => ActionButtonClickAnimationFinished?.Invoke(this);

            ResizeLabel();

            Primary = true;

            AutoSize = true;

            Shadow      = null;
            ShadowShape = DrawHelper.CreateRoundRect(1, 1, Width - 3, Height - 4, 2);
        }
Exemple #2
0
    void OnGUI()
    {
        int nextbutton = 0;

        for (int i = 0; i < maxActionNum; i++)
        {
            if (actionListTable[i])
            {
                if (GUI.Button(new Rect(topleftX, topleftY + nextbutton * buttonHeight, buttonWidth, buttonHeight), ((Actions)i).ToString()))
                {
                    ActionButtonClicked.Invoke((Actions)i);
                    this.enabled = false;
                }
                nextbutton++;
            }
        }
    }
Exemple #3
0
 private void Awake()
 {
     _actionButton.onClick.AddListener(() => ActionButtonClicked?.Invoke());
     _restartButton.onClick.AddListener(() => RestartButtonClicked?.Invoke());
 }
 void NotifyActioButtonClicked()
 {
     ActionButtonClicked?.Invoke(this, EventArgs.Empty);
 }