Example #1
0
 void ToggleZ()
 {
     ConstrainZ         = !ConstrainZ;
     ToolTracker.net[2] = 2;
     ToolTracker.net[3] = 3;
     if (ConstrainZ)
     {
         ToolTracker.value[0] = "2";
     }
     else
     {
         ToolTracker.value[0] = "1";
     }
     ToolTracker.setEmpty(1);
     TrackerScript.AddAction();
     foreach (var s in Zlisteners)
     {
         if (ConstrainZ)
         {
             s.Enable();
         }
         else
         {
             s.Disable();
         }
     }
 }
Example #2
0
    public void Start()
    {
        DontDestroyOnLoad(gameObject);
        quit = false;
        ToolTracker.Create();
        TI         = new TrackerItem();
        TI2        = new RawDataItem();
        actionList = "";


        toolMap = new Dictionary <string, ToolData>();
        toolMap.Add("A", new ToolData("Camera Tool", 0, 0));
        toolMap.Add("B", new ToolData("Boolean Tool", 0, 0));
        toolMap.Add("C", new ToolData("Clone Tool", 0, 0));
        toolMap.Add("D", new ToolData("Draw Face Tool", 0, 0));
        toolMap.Add("E", new ToolData("Extrude Face Tool", 0, 0));
        toolMap.Add("F", new ToolData("Loft Tool", 0, 0));
        toolMap.Add("G", new ToolData("Group Tool", 0, 0));
        toolMap.Add("I", new ToolData("Primitive Tool", 0, 0));
        toolMap.Add("K", new ToolData("Clipping Tool", 0, 0));
        toolMap.Add("L", new ToolData("Line Tool", 0, 0));
        toolMap.Add("M", new ToolData("Mirror Tool", 0, 0));
        toolMap.Add("N", new ToolData("Selection Tool", 0, 0));
        toolMap.Add("O", new ToolData("Polygon Tool", 0, 0));
        toolMap.Add("P", new ToolData("Paint Tool", 0, 0));
        toolMap.Add("R", new ToolData("Eraser Tool", 0, 0));
        toolMap.Add("S", new ToolData("Spline Tool", 0, 0));
        toolMap.Add("U", new ToolData("No Tool", 0, 0));
        toolMap.Add("V", new ToolData("Gravity Tool", 0, 0));
        toolMap.Add("X", new ToolData("Extrude Curve Tool", 0, 0));
        toolMap.Add("Z", new ToolData("Measuring Tool", 0, 0));
    }
Example #3
0
 void ScaleDown()
 {
     if (eraser.transform.parent.parent.localScale.x > 0.2f)
     {
         eraser.transform.parent.parent.localScale -= scaleVector;
         ToolTracker.net[3]   = 3;
         ToolTracker.value[0] = "f";
         ToolTracker.value[2] = "" + scaleVector.magnitude;
         ToolTracker.setEmpty(2);
         TrackerScript.AddAction();
     }
 }
Example #4
0
    public void ScaleShapeDown()
    {
        float newRadius = radius - 0.005f;

        if (newRadius >= 0.02f)
        {
            radius               = newRadius;
            ToolTracker.net[2]   = 1;
            ToolTracker.net[3]   = 3;
            ToolTracker.value[0] = "f";
            ToolTracker.value[1] = "" + newRadius;
            ToolTracker.setEmpty(2);
            TrackerScript.AddAction();
        }
    }
Example #5
0
    public void ScaleShapeUp()
    {
        float newRadius = radius + 0.005f;

        if (newRadius <= 0.20f)
        {
            radius               = newRadius;
            ToolTracker.net[2]   = 1;
            ToolTracker.net[3]   = 2;
            ToolTracker.value[0] = "f";
            ToolTracker.value[1] = "" + newRadius;
            ToolTracker.setEmpty(2);
            TrackerScript.AddAction();
        }
    }
Example #6
0
    public void ToggleLengthConstraint()
    {
        ConstrainLength = !ConstrainLength;
        photonView.RPC("UpdateLengthConstraint", PhotonTargets.AllBufferedViaServer, ConstrainLength, LengthConstraint);

        ToolTracker.net[2] = 5;
        ToolTracker.net[3] = 1;
        if (ConstrainLength)
        {
            ToolTracker.value[0] = "2";
            ToolTracker.value[1] = "f";
            ToolTracker.value[2] = "" + LengthConstraint;
            ToolTracker.setEmpty(2);
        }
        else
        {
            ToolTracker.value[0] = "1";
            ToolTracker.setEmpty(1);
        }

        TrackerScript.AddAction();
    }
Example #7
0
 public static void AddAction()
 {
     actionList += ToolTracker.GetActions() + " \n";
 }
Example #8
0
    public void EndDrawing()
    {
        // set the collider and the mesh
        if (go != null)
        {
            if (objectType == ObjectType.Shape)
            {
                go.GetComponent <ShapeSplineTrail>().CancelTracking();

                // end reflection
                if (ms.gameObject.activeSelf)
                {
                    ms.reflection.GetComponent <ShapeSplineTrail>().CancelTracking();
                }
                GameObject.Find("Tracker").GetComponent <TrackerScript>().numMesh++;
                ObjectManager.instance.AddObject(go);
                go.GetComponent <MeshEditor>().StartGroupGeneration();
            }
            else if (objectType == ObjectType.Section)
            {
                go.GetComponent <SectionSplineTrail>().CancelTracking();

                // end reflection
                if (ms.gameObject.activeSelf)
                {
                    ms.reflection.GetComponent <SectionSplineTrail>().CancelTracking();
                }
                GameObject.Find("Tracker").GetComponent <TrackerScript>().numMesh++;
                ObjectManager.instance.AddObject(go);
                go.GetComponent <MeshEditor>().StartGroupGeneration();
            }
            else if (objectType == ObjectType.Hair)
            {
                go.GetComponent <HairSplineTrail>().CancelTracking();

                // end reflection
                if (ms.gameObject.activeSelf)
                {
                    ms.reflection.GetComponent <HairSplineTrail>().CancelTracking();
                }
                GameObject.Find("Tracker").GetComponent <TrackerScript>().numMesh++;

                var        refTrail = go.GetComponent <HairSplineTrail>();
                GameObject trail    = Instantiate(Resources.Load("NURBSTrail"), new Vector3(0, 0, 0), Quaternion.identity) as GameObject;
                trail.GetComponent <NURBSTrail>().InitNURBS(refTrail.spline, refTrail.trackLength, new Vector3(0.005f, 0, 0));
                trail.GetComponent <MeshRenderer>().material.color = go.GetComponent <MeshRenderer>().material.color;
                Destroy(go);
                refTrail.Init(hairObject);
                ObjectManager.instance.AddObject(trail);
            }

            shapeObject.GetComponent <ProcShape>().Init();
            sectionObject.GetComponent <ProcSection>().Init();
            hairObject.GetComponent <ProcHair>().Init();

            ToolTracker.setEmpty(4);
            TrackerScript.AddAction();
        }

        // add reflection
        if (ms.gameObject.activeSelf)
        {
            ObjectManager.instance.AddObject(ms.reflection);
        }

        go = null;
    }