Ejemplo n.º 1
0
        private void AddActionElement(ActionContainer acon)
        {
            ActionButtonBehavior actionButton = actionButtons.actionBtnPrefab;
            Transform            parent       = actionButtons.actionsContainer.transform;

            if (acon.actType != ActionContainer.ActionType._void)
            {
                actionButton = actionButtons.variablesBtnPrefab;
                parent       = actionButtons.variablesContainer.transform;
            }
            ActionButtonBehavior spawnedBtn = Instantiate(actionButton);

            spawnedBtn.transform.SetParent(parent, false);
            spawnedBtn.Init(acon);
            guiManager.AddAction(spawnedBtn);
        }
Ejemplo n.º 2
0
 public void AddAction(ActionButtonBehavior button)
 {
     button.GetComponent <RectTransform>().SetAsLastSibling();
     actionButtons.Add(button);
 }