public void SetDisplay(OrderButton buttonData, int indx) { image.text = buttonData.text; code = buttonData.code; this.indx = indx; transform.GetComponent <Button>().onClick.AddListener(Press); }
protected override void SpecialAction(OrderButton button, int buttonsPushed, bool inOrderSoFar) { if (inOrderSoFar && buttonsPushed + 1 < physicalPositionsByOrder.Length) { StartCoroutine(BlinkButton(button.GetComponent <IlluminatingObject>(), physicalPositionsByOrder[buttonsPushed + 1])); } }
// Инициализация панели, подписка на события нажатий кнопок public Order() { panel = new Panel(); panel.Location = new System.Drawing.Point(650, 100); panel.BackColor = Color.Transparent; panel.Name = "panel"; panel.Size = new System.Drawing.Size(208, 498); // panel.Anchor = AnchorStyles.Right; sellLimit = new OrderButton(panel, Resources.SellLimitRed, OrderButton.TypeButton.SellLimit); sellLimit.Event_LimitClic += new LimitClic(ChangeColor); sellLimit.Create(); buyLimit = new OrderButton(panel, Resources.BuyLimitGreen, OrderButton.TypeButton.BuyLimit); buyLimit.Event_LimitClic += new LimitClic(ChangeColor); buyLimit.Create(); sellMarket = new OrderButton(panel, Resources.SellMarket, OrderButton.TypeButton.SellMarket); sellMarket.Create(); buyMarket = new OrderButton(panel, Resources.BuyMarket, OrderButton.TypeButton.BuyMarket); buyMarket.Create(); buyLimit.I(); }
/** * React to the press of a button, if it is one of its children. * Checks as to wheter an entire sequence of buttons have been pressed, and whether they have been pressed in the right order and react accordingly. */ public virtual void Notify(OrderButton button, bool perfomSpecialAction) { if (puzzleSolved) { return; //Don't do anthing if the puzzle has already been solved. } if (!buttons.Contains(button)) { return; //Only respond to the push if the button has been subcribed to the parent. } buttonsPushed++; if (button.numberInOrder != buttonsPushed) { inOrderSoFar = false; } if (perfomSpecialAction) { SpecialAction(button, buttonsPushed, inOrderSoFar); } if (buttonsPushed != buttons.Count) { return; } if (inOrderSoFar) { SetSolved(); } else { ResetPuzzle(); } }
// This script will simply instantiate the Prefab when the game starts. public void UpdateOrderData() { Debug.Log("updatingOrders : " + orderOptionObjectArray.Length); for (int i = 0; i < orderOptionObjectArray.Length; i++) { Debug.Log("PNo:" + orderOptionObjectArray[i].PNo + ", picture:" + orderOptionObjectArray[i].Picture); GameObject InstantiatedOrderButton = Instantiate(orderButtonPrefab, new Vector3(0, 0, 0), Quaternion.identity); InstantiatedOrderButton.transform.SetParent(listOfOrderOptionsPanel.transform, false); OrderButton OrderButtonScript = InstantiatedOrderButton.GetComponent(typeof(OrderButton)) as OrderButton; OrderButtonScript.PNo.text = orderOptionObjectArray[i].PNo.ToString(); OrderButtonScript.productNumber = orderOptionObjectArray[i].PNo; /* Button button = InstantiatedOrderButton.GetComponent<Button>() as Button ; * int temp = orderOptionObjectArray[i].PNo; * button.onClick.AddListener(()=> OrderPNoOnClick(temp)); */ if (Test) { } else { OrderButtonScript.ImageDownloader(ImageIPAddress + orderOptionObjectArray[i].Picture); } } // Instantiate at position (0, 0, 0) and zero rotation. //Instantiate(orderButtonPrefab, new Vector3(0, 0, 0), Quaternion.identity); }
protected override void SpecialAction(OrderButton button, int buttonsPushed, bool inOrderSoFar) { if (button.numberInOrder > 1) { buttonsInOrder[button.numberInOrder - 1].Press(false); } }
private void OrderButton_Click(object sender, EventArgs e) { OrderButton.Hide(); TrackButton.Hide(); Button order = OrderButton; Button track = TrackButton; MakeorderUsercontrol orderControl = new MakeorderUsercontrol(order, track); orderControl.Location = new Point(80, 130); Controls.Add(orderControl); }
public override void AddButton(OrderButton button) { base.AddButton(button); while (buttonsInOrder.Count <= button.numberInOrder) { buttonsInOrder.Add(null); } buttonsInOrder[button.numberInOrder] = button; }
public void OrderButtonClick() { logger.Info("Open button click"); OrderButton.Click(); WaitForAMinute(); }
public static int SortByName(OrderButton a, OrderButton b) { return(string.Compare(a.name, b.name)); }
/** * A method with the sole purpose of being overridden for subtyps of the class to inset thier own behavior. */ protected virtual void SpecialAction(OrderButton button, int buttonsPushed, bool inOrderSoFar) { }
/** * Adds a child button to the set of buttons. */ public virtual void AddButton(OrderButton button) { this.buttons.Add(button); }