示例#1
0
 private void divBtn_Click(object sender, EventArgs e)
 {
     if (state == states.clear)
     {
         firstNum = Convert.ToDouble(outBox.Text);
         runningOpBox.AppendText("/");
         state = states.op;
         op    = ops.divide;
     }
     else if (state == states.op)
     {
         secondNum         = Convert.ToDouble(outBox.Text);
         runningOpBox.Text = $"{firstNum} / {secondNum}";
         op = ops.divide;
         Operations();
         state = states.ans;
     }
     else if (state == states.ans)
     {
         firstNum          = Result;
         runningOpBox.Text = $"{firstNum} / ";
         state             = states.op;
         op = ops.divide;
     }
 }
示例#2
0
    public void padRightButtonHandler()
    {
        pressed = ops.RIGHT;
        GameObject rightController = GameObject.Find("Controller (right)");
        Collider   col             = rightController.GetComponent <VRTK_SimplePointerRight> ().col;

        /*	if (rightController.GetComponent<VRTK_SimplePointerRight> ().menuOn && this.gameObject.transform.parent.gameObject == GameObject.Find ("Controller (left)")) {
         *              GameObject.Find ("GameController").GetComponent<ScrollRectSnap_CS> ().ScrollRight ();
         *              Debug.Log ("scroll menu right");
         *      }*/
        if ((rightController.GetComponentInChildren <test> ().pressed) == ops.LEFT && col != null)
        {
            Vector3 axis       = new Vector3(0, 1, 0);
            int     angleDelta = 5;
            col.transform.RotateAround(col.bounds.center, axis, -angleDelta);
        }
        if (this.gameObject.transform.parent.gameObject == rightController)
        {
            menu.menuButtons [0].GetComponentInChildren <RadialButtonIcon> ().gameObject.GetComponent <Image> ().sprite         = Resources.Load <UnityEngine.Sprite> ("PushIcon");
            menu.menuButtons [1].GetComponentInChildren <RadialButtonIcon> ().gameObject.GetComponent <Image> ().sprite         = Resources.Load <UnityEngine.Sprite> ("X_icon");
            menu.menuButtons [3].GetComponentInChildren <RadialButtonIcon> ().gameObject.GetComponent <Image> ().sprite         = Resources.Load <UnityEngine.Sprite> ("X_icon");
            menu.menuButtons [2].GetComponentInChildren <RadialButtonIcon> ().gameObject.GetComponent <Image> ().sprite         = Resources.Load <UnityEngine.Sprite> ("PullIcon");
            LeftMenu.menuButtons [0].GetComponentInChildren <RadialButtonIcon> (true).gameObject.GetComponent <Image> ().sprite = Resources.Load <UnityEngine.Sprite> ("PushIcon");
            LeftMenu.menuButtons [1].GetComponentInChildren <RadialButtonIcon> (true).gameObject.GetComponent <Image> ().sprite = Resources.Load <UnityEngine.Sprite> ("X_icon");
            LeftMenu.menuButtons [3].GetComponentInChildren <RadialButtonIcon> (true).gameObject.GetComponent <Image> ().sprite = Resources.Load <UnityEngine.Sprite> ("X_icon");
            LeftMenu.menuButtons [2].GetComponentInChildren <RadialButtonIcon> (true).gameObject.GetComponent <Image> ().sprite = Resources.Load <UnityEngine.Sprite> ("PullIcon");
        }
        if (rightController.GetComponentInChildren <test> ().pressed == ops.DOWN)
        {
            GameObject cameraRig = GameObject.Find("[CameraRig]");
            cameraRig.transform.RotateAround(cameraRig.transform.position, Vector3.up, 10);
        }
    }
示例#3
0
 private void btn_add_Click(object sender, EventArgs e)
 {
     if (tf_lcd.Text != "")
     {
         fn          = double.Parse(tf_lcd.Text);
         tf_lcd.Text = "";
         operation   = ops.ADD;
     }
 }
示例#4
0
 private void btn_multiply_Click(object sender, EventArgs e)
 {
     if (tf_lcd.Text != "")
     {
         fn          = double.Parse(tf_lcd.Text);
         tf_lcd.Text = "";
         operation   = ops.MULTIP;
     }
 }
示例#5
0
 public void padUpButtonHandler()
 {
     if (GameObject.Find("GameController").GetComponent <GameStateControl>().State == GameStateControl.GameState.ROOM_CHOOSER)
     {
         pressed = ops.NONE;
         return;
     }
     if (!GameController.showingItemMenu && !GameController.showingCubeMenu)
     {
         setMenusToScale();
         pressed = ops.UP;
     }
 }
示例#6
0
    public void padDownButtonHandler()
    {
        pressed = ops.DOWN;

        GameObject rightController = GameObject.Find("Controller (right)");

        if (this.gameObject.transform.parent.gameObject == rightController)
        {
            menu.menuButtons[0].GetComponentInChildren <RadialButtonIcon>().gameObject.GetComponent <Image>().sprite    = Resources.Load <UnityEngine.Sprite> ("X_icon");
            menu.menuButtons[1].GetComponentInChildren <RadialButtonIcon>().gameObject.GetComponent <Image>().sprite    = Resources.Load <UnityEngine.Sprite> ("left");
            menu.menuButtons [2].GetComponentInChildren <RadialButtonIcon> ().gameObject.GetComponent <Image> ().sprite = Resources.Load <UnityEngine.Sprite> ("X_icon");
            menu.menuButtons [3].GetComponentInChildren <RadialButtonIcon> ().gameObject.GetComponent <Image> ().sprite = Resources.Load <UnityEngine.Sprite> ("right");

            LeftMenu.menuButtons [0].GetComponentInChildren <RadialButtonIcon> (true).gameObject.GetComponent <Image> ().sprite = Resources.Load <UnityEngine.Sprite> ("X_icon");
            LeftMenu.menuButtons [1].GetComponentInChildren <RadialButtonIcon> (true).gameObject.GetComponent <Image> ().sprite = Resources.Load <UnityEngine.Sprite> ("left");
            LeftMenu.menuButtons [2].GetComponentInChildren <RadialButtonIcon> (true).gameObject.GetComponent <Image> ().sprite = Resources.Load <UnityEngine.Sprite> ("X_icon");
            LeftMenu.menuButtons [3].GetComponentInChildren <RadialButtonIcon> (true).gameObject.GetComponent <Image> ().sprite = Resources.Load <UnityEngine.Sprite> ("right");
        }
        Collider col = rightController.GetComponent <VRTK_SimplePointerRight> ().col;

        if ((rightController.GetComponentInChildren <test> ().pressed) == ops.UP && col != null)
        {
            col.transform.localScale *= 0.99f;
        }

        if ((rightController.GetComponentInChildren <test> ().pressed) == ops.LEFT && col != null)
        {
            GameObject pt   = col.gameObject.transform.parent.gameObject.GetComponent <VRTK_SimplePointerRight> ().pointerTip;
            Vector3    axis = (pt.transform.position - col.gameObject.transform.parent.gameObject.transform.position);
            axis = Vector3.Cross(new Vector3(0, 1, 0), axis);
            axis.Normalize();
            int angleDelta = 5;

            col.transform.RotateAround(col.bounds.center, axis, -angleDelta);
        }
        if ((rightController.GetComponentInChildren <test> ().pressed) == ops.RIGHT && col != null)
        {
            GameObject pt   = col.gameObject.transform.parent.gameObject.GetComponent <VRTK_SimplePointerRight> ().pointerTip;
            Vector3    axis = (pt.transform.position - col.gameObject.transform.parent.gameObject.transform.position);
            axis.Normalize();
            col.gameObject.transform.position -= 0.1f * axis;
        }
    }
 var(ops, duration) = new T().Sort(GetSource(sourceSize));
 internal bool Options(ops option, bool set = false, bool value = false)
 {
     if (set == false) { return options[(int)option].isChecked; }
     else { options[(int)option].isChecked = value; }
     return options[(int)option].isChecked;
 }