Exemple #1
0
 public void ButtonInstall()
 {
     if (!installState)
     {
         if (canSwap)
         {
             canSwap = false;
             StartCoroutine(InstallFade(fadeDuration));
             Debug.Log("Install");
         }
     }
     buttonUIScript.ClearButton();
 }
 public void ButtonMoveObject()
 {
     if (!removedState)
     {
         if (canMove)
         {
             canMove = false;
             StartCoroutine(MoveOverSeconds(gameObject, moveDirection, duration));
             removedState = !removedState;
             Debug.Log(gameObject.name + " " + "Move From : " + transform.position + ", " + "To : " + moveDirection + ", " + "Removed State : " + removedState);
         }
     }
     buttonUIScript.ClearButton();
 }
Exemple #3
0
 public void ButtonMoveObject()
 {
     if (!removedState)
     {
         if (canMove)
         {
             canMove = false;
             StartCoroutine(MoveOverSeconds(gameObject, moveDirection, duration));
             buttonUIScript.AddUserAction("Move " + gameObject.name);
             removedState = !removedState;
         }
     }
     buttonUIScript.ClearButton();
 }
Exemple #4
0
 public void ButtonScrewObject()
 {
     if (!screwedState)
     {
         if (canScrew)
         {
             canScrew = false;
             StartCoroutine(ScrewOverSeconds(gameObject, screwMoveDirection, duration));
             buttonUIScript.AddUserAction("Screw " + gameObject.name);
             screwedState = !screwedState;
         }
     }
     buttonUIScript.ClearButton();
 }
Exemple #5
0
 void ButtonRotateObject()
 {
     if (!rotatedState)
     {
         if (canRotate)
         {
             canRotate = false;
             StartCoroutine(RotateOverSeconds(gameObject, rotateAngle, duration));
             buttonUIScript.AddUserAction("Rotate " + gameObject.name);
             rotatedState = !rotatedState;
         }
     }
     buttonUIScript.ClearButton();
 }
Exemple #6
0
    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);
        }
    }
Exemple #7
0
 public void PressedButton()
 {
     if (canMove)
     {
         canMove = false;
         StartCoroutine(PressedOverSeconds(gameObject, pressedPosition, 0.1f));
         buttonUIScript.AddUserAction("Button Pressed " + gameObject.name);
     }
     buttonUIScript.ClearButton();
 }
Exemple #8
0
    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);
    }
Exemple #9
0
 public void ButtonRotateStepObject(int index)
 {
     if (indexRotation != index)
     {
         if (canRotate)
         {
             canRotate = false;
             for (int i = 0; i < rotateAngleData.Length; i++)
             {
                 if (i == index)
                 {
                     StartCoroutine(RotateStepOverSeconds(gameObject, rotateAngleData[i].rotateAngle, duration));
                     buttonUIScript.AddUserAction("Rotate " + rotateAngleData[i].rotateName + " " + gameObject.name);
                     indexRotation = index;
                 }
             }
         }
     }
     buttonUIScript.ClearButton();
 }
Exemple #10
0
 public void SelectToolButton()
 {
     ActivateTool();
     buttonUIScript.ClearButton();
 }