Пример #1
0
    //---------------------------------------------------------------



    private void getSelObj(LaserPicker laser)
    {
        if (WandControlsManager.WandControllerRight.getTriggerDown())
        {
            if (laser.isHit())
            {
                arrObj     = GeneralSettings.getParentClone(laser.getHitObject(), "app_");
                actionMode = ActionMode.SELSTART;
                GeneralSettings.updateInteractText("Please select the center point for the array.");
            }
        }
    }
Пример #2
0
    public void amUpdate(LaserPicker laser)
    {
        if (hostSurface != null)
        {
            if (WandControlsManager.WandControllerRight.getTriggerDown())
            {
                if (laser.isHit())
                {
                    Vector3 pt = laser.getHitPoint();
                    lastPt = Instantiate(pointMarker, pt, Quaternion.identity);
                    selectedPtObjects.Add(lastPt);


                    if (selectedPtObjects.Count == 4)
                    {
                        List <Vector3> pts = new List <Vector3>();
                        foreach (GameObject ptObj in selectedPtObjects)
                        {
                            pts.Add(ptObj.transform.position);
                        }

                        GameObject newSrf = Instantiate(app_Surface, laser.getHitPoint(), Quaternion.identity);
                        newSrf.GetComponent <app_Surface>().init(pts);
                        hostSurface.GetComponent <app_Plane>().enhostObject(newSrf);

                        GeneralSettings.updateInteractText("");
                        GeneralSettings.addLineToConsole(string.Format("{0} surface created under {1} host plane.", newSrf.name, hostSurface.name));
                        clearPointCollectionMode(laser);
                        return;
                    }
                    GeneralSettings.updateInteractText(string.Format("Pick {0} more points to complete the surafce.", 4 - selectedPtObjects.Count));
                }
            }

            if (WandControlsManager.WandControllerRight.getGripDown())
            {
                clearPointCollectionMode(laser);
                GeneralSettings.addLineToConsole("Surface creation exited.");
                GeneralSettings.updateInteractText("Please select a plane to act as host for the surface.");
            }

            return;
        }

        if (WandControlsManager.WandControllerRight.getTriggerDown())
        {
            hostSurface = laser.getHitObject();
            laser.setRestrictedObject(hostSurface);
            GeneralSettings.updateInteractText("Select 4 corner points for surface.");
            GeneralSettings.addLineToConsole(string.Format("{0} selected as host plane for surface to be created.", hostSurface.name));
        }
    }
Пример #3
0
 public void amUpdate(LaserPicker laser)
 {
     if (laser.isHit())
     {
         if (WandControlsManager.WandControllerRight.getTriggerPressed())
         {
             if (GeneralSettings.getParentRecursive(laser.getHitObject(), "_RefObjects", "app_") != null)
             {
                 // move the current refObject along the plane contained as a reference among the siblings
             }
         }
     }
 }
Пример #4
0
    void Update()
    {
        if (laser.isHit())
        {
            snapObjScript = laser.getHitObject().GetComponent <SnapObject>();
        }
        else
        {
            snapObjScript = null;
        }



        if (snapObjScript != null && snapObjScript.isSnap())
        {
            laser.setSnapPoint(snapObjScript.getSnapPt(laser.getHitPoint()));
        }
        else
        {
            laser.clearSnappedPoint();
        }



        // highlight object being edited if edit mode is on or the pointed object
        hitAppObj = GeneralSettings.editOn() ? GeneralSettings.getEditObject() : GeneralSettings.getParentClone(laser.getHitObject(), "app_");
        if (hitAppObj != null)
        {
            hitAppObj.GetComponent <Highlightable>().highlightObject();
        }


        // actions in selection mode
        if (am == null)
        {
            selActionMethods();
            return;
        }


        am.amUpdate(laser);
        cm.cmUpdate(laser);
    }