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); } }
public void ProfileButtonSetting() { if (!EventSystem.current.IsPointerOverGameObject()) { GameObject selectToolButton = Instantiate(Resources.Load("ButtonTemplate") as GameObject); //GameObject unselectToolButton = Instantiate(Ryesources.Load("ButtonTemplate") as GameObject); buttonUIScript.AddButton(selectToolButton, toolIcon, "Select " + toolName, SelectToolButton); //buttonUIScript.AddButton(unselectToolButton, toolIcon, "Unselect " + toolName, UnselectToolButton); } }
public void ProfileButtonSetting() { if (!EventSystem.current.IsPointerOverGameObject()) { 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; } } GameObject moveButton = Instantiate(Resources.Load("ButtonTemplate") as GameObject); GameObject backButton = Instantiate(Resources.Load("ButtonTemplate") as GameObject); buttonUIScript.AddButton(moveButton, buttonMoveIcon, "Move", ButtonMoveObject); buttonUIScript.AddButton(backButton, buttonBackIcon, "Back", ButtonBackObject); } }
public void ProfileButtonSetting() { if (!EventSystem.current.IsPointerOverGameObject()) { for (int i = 0; i < buttonUIScript.buttonIconManager.Length; i++) { if (buttonUIScript.buttonIconManager[i].iconName == "ScrewIcon") { buttonScreIcon = buttonUIScript.buttonIconManager[i].iconSprite; } if (buttonUIScript.buttonIconManager[i].iconName == "UnscrewIcon") { buttonUnscrewIcon = buttonUIScript.buttonIconManager[i].iconSprite; } } GameObject screwButton = Instantiate(Resources.Load("ButtonTemplate") as GameObject); GameObject unscrewButton = Instantiate(Resources.Load("ButtonTemplate") as GameObject); buttonUIScript.AddButton(screwButton, buttonScreIcon, "Screw", ButtonScrewObject); buttonUIScript.AddButton(unscrewButton, buttonUnscrewIcon, "Unscrew", ButtonUnscrewObject); } }
public void ProfileButtonSetting() { if (!EventSystem.current.IsPointerOverGameObject()) { for (int i = 0; i < buttonUIScript.buttonIconManager.Length; i++) { if (buttonUIScript.buttonIconManager[i].iconName == "RotateIcon") { buttonRotateIcon = buttonUIScript.buttonIconManager[i].iconSprite; } if (buttonUIScript.buttonIconManager[i].iconName == "ReverseRotateIcon") { reverseRotateIcon = buttonUIScript.buttonIconManager[i].iconSprite; } } GameObject rotateButton = Instantiate(Resources.Load("ButtonTemplate") as GameObject); GameObject reverseRotateButton = Instantiate(Resources.Load("ButtonTemplate") as GameObject); buttonUIScript.AddButton(rotateButton, buttonRotateIcon, "Rotate", ButtonRotateObject); buttonUIScript.AddButton(reverseRotateButton, reverseRotateIcon, "Reverse Rotate", ButtonReverseRotateObject); } }
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); } }
public void ProfileButtonSetting() { if (!EventSystem.current.IsPointerOverGameObject()) { for (int i = 0; i < buttonUIScript.buttonIconManager.Length; i++) { if (buttonUIScript.buttonIconManager[i].iconName == "PressedIcon") { pressedIcon = buttonUIScript.buttonIconManager[i].iconSprite; } } GameObject pressedButton = Instantiate(Resources.Load("ButtonTemplate") as GameObject); buttonUIScript.AddButton(pressedButton, pressedIcon, "Press Button", PressedButton); } }