Example #1
0
 // Update is called once per frame
 void Update()
 {
     if (ViveInput.GetPress(hand, ControllerButton.Pad))
     {
         whichStroke++;
         if (whichStroke >= strokes.Length)
         {
             whichStroke = 0;
         }
     }
     if (ViveInput.GetPress(hand, ControllerButton.Trigger))
     {
         if (!isDrawing)
         {
             thisStroke = Instantiate(strokes[whichStroke]);
             thisStroke.Setup();
             sequencer.MakeStroke(thisStroke, this);
             isDrawing = true;
         }
         thisStroke.Draw(this.transform.position);
     }
     else if (ViveInput.GetPressUp(hand, ControllerButton.Trigger))
     {
         thisStroke.OnEnd();
         isDrawing = false;
     }
 }
Example #2
0
        public void MakeStroke(SP_Stroke stroke, SP_Brush brush)
        {
            SP_Bulb b = layers[0].FindClosestBulb(brush.transform.position);

            //stroke.container = layers[0].GetComponent<SP_BuildBulbs>().container;
            b.strokes.Add(stroke);
            stroke.transform.parent = b.transform;
        }