private void createText() { ViewComponent textComponent = new ViewComponent(); textComponent.id = component.id + "_text"; textComponent.groupId = ""; textComponent.text = component.text; textComponent.textArray = component.textArray; textComponent.x = 0; textComponent.y = 0; text = new ViewBuilderText(button.transform, textComponent); text.hideText(1); }
public void onMouseDown(PointerEventData data) { Debug.Log("onMouseDown Button"); if (arraySprite.Length > 1) { button.GetComponent <Image>().sprite = arraySprite[1]; } if (component.textArray.Length > 1) { text.hideText(0); text.showText(1); } Vector3 newSize = new Vector2(arraySprite[0].rect.width * component.config.increasePercent, arraySprite[0].rect.height * component.config.increasePercent); newScale = button.GetComponent <RectTransform>().localScale *component.config.increasePercent; newPosition = new Vector3(buttonPosition.x + (size.x - newSize.x) / 2, buttonPosition.y - (size.y - newSize.y) / 2, buttonPosition.z); if (radioButtonMode) { radioButtonClicked = !radioButtonClicked; } }