protected void StopConflictEnvironment()
        {
            //Debug.Log("Stopping conflict environment");

            conflictController = cameraRig.gameObject.GetComponent <ConflictZoneModel>();

            conflictController.IntoConflict();

            conflictController.Show(false);

            AtomExpiry(0, false, "-> Called from StopConflictEnvironment. Physics state 2. After audio expires.");
        }
        protected ConflictZoneModel StartConflictEnvironment()
        {
            //Debug.Log("Start Conflict Environment");
            //Set luminance to defaults

            cameraRig.EqualiseCameraBrightness();

            assetSwitcher.SwitchAssetsToNamed("asset-test"); // This should show our wavy lines

            //Setup the conflict zones - Activate them and asset swap basically.
            conflictController = cameraRig.gameObject.GetComponent <ConflictZoneModel>();

            conflictController.Show(true);

            return(conflictController);
        }
        IEnumerator DemonstrateBinocularSuppressionRatio(EyeSkillsVRHeadsetInput ratioController,
                                                         ConflictZoneModel model,
                                                         EyeSkillsCameraRig cameraRig)
        {
            float brightnessRatio;

            while (true)
            {
                //Update the luminance ratio for each eye
                brightnessRatio = Mathf.Clamp(ratioController.getVerticalDirection(), -1, 1);

                cameraRig.SetBinocularSuppressionRatio(brightnessRatio);

                yield return(null);
            }
        }
        /// <summary>
        /// Identifies the binocular suppression ratio.
        /// </summary>
        /// <returns>The binocular suppression ratio.</returns>
        /// <param name="ratioController">Ratio controller. Where we get our signal from to alter the ratio - e.g. tilt angle of head</param>
        /// <param name="model">Model. The model that provides us the conflict images.</param>
        /// <param name="cameraRig">Camera rig. The cameras whose relative brightness we wish to alter.</param>
        /// <param name="stillness">Stillness. Where we get information from about whether or not the headset is still. Might have been better to pass this headset specific mechanism to the VRHeadsetInput, which could have implemented a generic interface for reporting "stillness"</param>
        /// <param name="indicator">Indicator. The element which informs the user about the progress of the stillness based selection</param>
        /// <param name="NextStep">Next step.</param>
        /// <param name="secondsOfStillnessForSelect">Seconds of stillness for select.</param>
        IEnumerator IdentifyBinocularSuppressionRatio(EyeSkillsVRHeadsetInput ratioController,
                                                      ConflictZoneModel model,
                                                      EyeSkillsCameraRig cameraRig,
                                                      EyeSkillsVRHeadsetSelectByStillness stillness,
                                                      SelectionIndicatorScaler indicator,
                                                      Action <float> NextStep,
                                                      float secondsOfStillnessForSelect)
        {
            float suppressionRatio = 0;
            float still            = 0;
            float brightnessRatio;

            stillness.StartTracking();

            //TODO : We probably need a maximum timeout for if the headset never appears to settle!
            still = stillness.getTimeStill();
            while (still < secondsOfStillnessForSelect)
            {
                //Update the luminance ratio for each eye
                brightnessRatio = Mathf.Clamp(ratioController.getVerticalDirection(), -1, 1);

                cameraRig.SetBinocularSuppressionRatio(brightnessRatio);

                //redraw the indicator and play a rising tone?!?
                float percentage = (still / secondsOfStillnessForSelect);
                //Debug.Log("Percentage still " + percentage);
                indicator.SetIndicatorPercentage(percentage);
                yield return(null);

                still = stillness.getTimeStill();

                //Debug.Log("ratio : "+ brightnessRatio + " %:" + percentage);
            }

            stillness.StopTracking();
            indicator.Reset();
            StopConflictEnvironment();
            NextStep(suppressionRatio);
        }