// Update is called once per frame
    void Update()
    {
        velocity = atc.getVelocityFloat();
        angle    = atc.getAngleFloat();

        if (lr != null && Application.isPlaying)
        {
            RenderArc();
        }

        if (ready)
        {
            // shoot the projectile with applied velocity on y and z axis
            // transform direction is needed to convert from local space to worldspace
            Debug.Log("Shooting the bullet with vY: " + vY.ToString("F2") +
                      " and vZ: " + vZ.ToString("F2"));
            var pro = GameObject.FindGameObjectWithTag("bullet");
            if (pro != null)
            {
                pro.GetComponent <boom>().launch(vY, vZ);
                pro.tag = "Untagged";
            }
            ready = false;
        }
    }
Beispiel #2
0
 void setPlank()
 {
     if (mtc.getStartCamSet())
     {
         //angle constraints is from 20 to 70 degrees
         var angle = mtc.getAngleFloat();
         this.gameObject.GetComponent <ASL.ASLObject>().SendAndSetClaim(() =>
         {
             Debug.Log("Setting plank angle");
             this.gameObject.GetComponent <ASL.ASLObject>().SendAndSetLocalRotation(Quaternion.Euler(-angle, 0.0f, 0.0f));
         });
         //transform.localRotation = Quaternion.Euler(-angle,0.0f,0.0f);
     }
     else
     {
         if (transform.localRotation != Quaternion.identity)
         {
             transform.localRotation = Quaternion.identity;
         }
     }
 }