public void ProfileButtonSetting() { if (!EventSystem.current.IsPointerOverGameObject()) { //UI position to mouse position when clicked float x = Input.mousePosition.x; float y = Input.mousePosition.y; buttonUIScript.transform.position = new Vector3(x, y, 0); //Clearing UI button when clicked so it's doesn't stack buttonUIScript.ClearButton(); //Setting UI button for this profile buttonUIScript.SetName(this.name); moveButton = Instantiate(Resources.Load("ButtonTemplate") as GameObject); backButton = Instantiate(Resources.Load("ButtonTemplate") as GameObject); for (int i = 0; i < buttonUIScript.buttonIconManager.Length; i++) { if (buttonUIScript.buttonIconManager[i].iconName == "MoveIcon") { buttonMoveIcon = buttonUIScript.buttonIconManager[i].iconSprite; } if (buttonUIScript.buttonIconManager[i].iconName == "BackIcon") { buttonBackIcon = buttonUIScript.buttonIconManager[i].iconSprite; } } buttonUIScript.AddButton(moveButton, buttonMoveIcon, "Move", ButtonMoveObject); buttonUIScript.AddButton(backButton, buttonBackIcon, "Back", ButtonBackObject); } }
public void ProfileButtonSetting() { if (!EventSystem.current.IsPointerOverGameObject()) { //UI position to mouse position when clicked float x = Input.mousePosition.x; float y = Input.mousePosition.y; buttonUIScript.transform.position = new Vector3(x, y, 0); //Clearing UI button when clicked so it's doesn't stack buttonUIScript.ClearButton(); //Setting UI button for this profile buttonUIScript.SetName(this.name + " " + "(Removed)"); GameObject AButton = Instantiate(Resources.Load("ButtonTemplate") as GameObject); GameObject BButton = Instantiate(Resources.Load("ButtonTemplate") as GameObject); for (int i = 0; i < buttonUIScript.buttonIconManager.Length; i++) { if (buttonUIScript.buttonIconManager[i].iconName == "APositionIcon") { APositionIcon = buttonUIScript.buttonIconManager[i].iconSprite; } if (buttonUIScript.buttonIconManager[i].iconName == "BPositionIcon") { BPositionIcon = buttonUIScript.buttonIconManager[i].iconSprite; } } buttonUIScript.AddButton(AButton, APositionIcon, "Install", installableScript.ButtonInstall); buttonUIScript.AddButton(BButton, BPositionIcon, "Remove", installableScript.ButtonRemove); } }
private void ButtonSetting() { //UI position to mouse position when clicked float x = Input.mousePosition.x; float y = Input.mousePosition.y; buttonUIScript.transform.position = new Vector3(x, y, 0); //Clearing UI button when clicked so it's doesn't stack buttonUIScript.ClearButton(); //Setting UI button for this profile buttonUIScript.SetName(this.name); }
public void ProfileButtonSetting() { if (!EventSystem.current.IsPointerOverGameObject()) { //UI position to mouse position when clicked float x = Input.mousePosition.x; float y = Input.mousePosition.y; buttonUIScript.transform.position = new Vector3(x, y, 0); Debug.Log(gameObject.name + " " + "Clicked, Button Added"); //Clearing UI button when clicked so it's doesn't stack buttonUIScript.ClearButton(); //Setting UI button for this profile buttonUIScript.SetName(this.name); moveButton = Instantiate(Resources.Load("ButtonTemplate") as GameObject); backButton = Instantiate(Resources.Load("ButtonTemplate") as GameObject); buttonUIScript.AddButton(moveButton, buttonMoveIcon, "Move", ButtonMoveObject); buttonUIScript.AddButton(backButton, buttonBackIcon, "Back", ButtonBackObject); } }