Exemple #1
0
    private void Controller_TriggerClicked(object sender, ClickedEventArgs e)
    {
        if (PW.WindowController == null)
        {
            PW.WindowController = this;
        }

        // If all the corners are not assigned yet
        if (!PW.IsConfigured)
        {
            // ... and this is the window controller, then assign one of the corners
            if (PW.WindowController == this)
            {
                PW.SetCorner(_tip.transform.position);
            }

            // ... otherwise it was started with another controller
            // so make sure it's model is turned back on, then make
            // this the window controller and reset the window
            else
            {
                if (PW.WindowController.Model != null)
                {
                    PW.WindowController.Model.SetActive(true);
                }
                PW.WindowController = this;
                PW.ResetWindow();
            }
        }
        else if (PW.WindowController == this)
        {
            PW.WindowCamera.SmoothCam.Enabled = !PW.WindowCamera.SmoothCam.Enabled;
            PW.WindowUI.ShowSubtitle("Smooth movement is " + (PW.WindowCamera.SmoothCam.Enabled ? "enabled" : "disabled"));
        }
    }