Beispiel #1
0
 private void PlayErrorSound()
 {
     if (InteractiveProgrammingManager.Instance.CurrentState == InteractiveProgrammingManager.ProgrammingManagerState.place_to_pose_learn ||
         InteractiveProgrammingManager.Instance.CurrentState == InteractiveProgrammingManager.ProgrammingManagerState.place_to_pose_learn_followed)
     {
         if (object_attached && !RobotHelper.IsObjectWithinRobotArmRadius(Arm, world_anchor.transform.InverseTransformPoint(transform.position)))
         {
             UISoundManager.Instance.PlayError();
         }
     }
 }
Beispiel #2
0
 private void Update()
 {
     if (RobotHelper.IsObjectWithinRobotArmRadius(Arm, world_anchor.transform.InverseTransformPoint(transform.position)) &&
         RobotHelper.IsObjectOnTable(world_anchor.transform.InverseTransformPoint(transform.position)))
     {
         material.SetColor("_Color", basic);
     }
     else
     {
         material.SetColor("_Color", red);
     }
 }
Beispiel #3
0
    //called whenever user clicks on the table in order to place virtual object
    private void PlaceObject()
    {
        if (InteractiveProgrammingManager.Instance.CurrentState == InteractiveProgrammingManager.ProgrammingManagerState.place_to_pose_learn ||
            InteractiveProgrammingManager.Instance.CurrentState == InteractiveProgrammingManager.ProgrammingManagerState.place_to_pose_learn_followed)
        {
            if (object_attached && RobotHelper.IsObjectWithinRobotArmRadius(Arm, world_anchor.transform.InverseTransformPoint(transform.position)))
            {
                UISoundManager.Instance.PlayPlace();

                object_attached = false;

                //transform.parent = world_anchor.transform;
                transform.SetParent(world_anchor.transform, true);
                transform.GetChild(0).GetComponent <Collider>().enabled = true;

                transform.localPosition = new Vector3(transform.localPosition.x, transform.localPosition.y, transform.GetChild(0).localScale.x / 2);

                EnableRotation();
            }
        }
    }