public ActionButtonParent(string actionName, int id, params ActionButton[] buttons) : base(actionName, id)
 {
     this.childButtons = buttons;
     for (int i = 0; i < this.childButtons.Length; i++)
     {
         ActionButtonChild child = (ActionButtonChild)buttons[i];
         child.parentActionButton = this;
         child.index = i;
     }
 }
Example #2
0
    public void callActionButton(ActionButton button, List <SidedEntity> targets)
    {
        if (button.executeOnClientSide())
        {
            button.callFunction(targets);
        }
        else
        {
            MessageRunAction msg;
            if (button is ActionButtonChild)
            {
                ActionButtonChild abc = (ActionButtonChild)button;
                msg = new MessageRunAction(abc.parentActionButton.getID(), abc.index, targets);
            }
            else
            {
                msg = new MessageRunAction(button.getID(), targets);
            }

            this.sendMessageToServer(msg);
        }
    }