Example #1
0
 void Update()
 {
     /* If this platform is linked to a button, check if it's pressed before moving */
     /* If it's not linked, move anyways */
     if ((bic && bic.GetIsActive()) || !bic)
     {
         Move();
     }
 }
Example #2
0
    void Update()
    {
        /* If this laser is linked to a button, check if it's pressed before activating */
        /* If it's not linked, active always */
        if (bic && bic.GetIsActive())
        {
            lr.enabled = true;
            an.SetBool("isActive", true);
        }
        else
        {
            lr.enabled = false;
            an.SetBool("isActive", false);
        }

        /* Renders the laser */
        if (lr.enabled)
        {
            RenderLaser();
        }

        /* Rotate shooter */
        shooter.transform.Rotate(Vector3.up * Time.deltaTime * rotationSpeed);
    }