private void OnEnable()
    {
        _camera           = FindObjectOfType <Camera>();
        _lineCircle       = FindObjectOfType <LineCircle>();
        _shuffler         = FindObjectOfType <Shuffler>();
        _timeStepper      = FindObjectOfType <TimeStepper>();
        _snapToBounds     = FindObjectOfType <SnapToBounds>();
        _patternOverrides = FindObjectOfType <PatternOverrides>();
        _post             = FindObjectOfType <PostProcessVolume>().profile;
        _cameraControl    = FindObjectOfType <CameraControl>();
        _pauser           = FindObjectOfType <LineCirclePauser>();

        _mainPanel = transform.Find("Container").gameObject;

        var mainPanelTransform = _mainPanel.transform;

        SetupContainerControls(mainPanelTransform);
        SetupCameraControls();
        SetupPatternControls();
        SetupGeneratorControls();
        SetupAdvancedControls();

        _lineCircle.OnPatternChanged += HandlePatternChanged;

        NavigateToPage(0);
        SetMenu(false);
    }
示例#2
0
        protected override double RunSolverOneStep(int TimestepNo, double phystime, double dt)
        {
            int printInterval = Control.PrintInterval;

            if (DatabaseDriver.MyRank == 0 && TimestepNo % printInterval == 0)
            {
#if DEBUG
                Console.WriteLine();
#endif
                Console.Write("Starting time step #" + TimestepNo + "...");
            }

            // Set time step size manually
            if (dt <= 0)
            {
                dt = this.Control.dtFixed;
            }

            Exception e = null;
            try {
                TimeStepper.Solve(phystime, dt);
            } catch (Exception ee) {
                e = ee;
            }
            e.ExceptionBcast();

            // Update sensor
            this.Sensor?.UpdateSensorValues(this.Density);

            // Update artificial viscosity
            if (this.ArtificialViscosityField != null)
            {
                UpdateArtificialViscosity();
            }

            if (DatabaseDriver.MyRank == 0 && TimestepNo % printInterval == 0)
            {
                if (TimestepNo % printInterval == 0)
                {
                    Console.WriteLine(" done. PhysTime: {0:0.#######E-00}, dt: {1:0.#######E-00}", phystime, dt);
                }
            }

            return(dt);
        }