private void SetAction(ActionContainer action) { variableText.text = action.actionName; variableAction = action.action; switch (action.actType) { case ActionContainer.ActionType._bool: Destroy(field.gameObject); toggle.isOn = action.boolStartStatus; break; case ActionContainer.ActionType._int: Destroy(toggle.gameObject); field.contentType = InputField.ContentType.IntegerNumber; isIntVariable = true; field.placeholder.GetComponent <Text>().text = action.intDefaultValue.ToString(); break; case ActionContainer.ActionType._float: Destroy(toggle.gameObject); field.contentType = InputField.ContentType.DecimalNumber; isIntVariable = false; field.placeholder.GetComponent <Text>().text = action.floatDefaultValue.ToString(); break; } }
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); }
public override void Init(ActionContainer action) { _buttonAction = action.action; actionName = action.actionName; transform.GetChild(0).GetComponent <Text>().text = action.actionName; }
public override void Init(ActionContainer action) { SetVariableInputs(); actionName = action.actionName; SetAction(action); }