Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        void Update()
        {
            if (Input.GetKeyDown(KeyCode.R))
            {
                ResetModel();
            }

            if (_status == CollapseStatus.Incomplete)
            {
                for (int i = 0; i < _substeps; i++)
                {
                    _status = _model.Step();

                    if (_status == CollapseStatus.Contradiction)
                    {
                        Debug.Log("Contradiction found! Reset the model and try again.");
                        return;
                    }
                    else if (_status == CollapseStatus.Complete)
                    {
                        Debug.Log("Collapse complete!");
                        return;
                    }
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        void Update()
        {
            if (Input.GetKeyDown(KeyCode.Space))
            {
                RotateView();
            }

            if (Input.GetKeyDown(KeyCode.R))
            {
                ResetModel();
            }

            if (_status == CollapseStatus.Incomplete)
            {
                for (int i = 0; i < _substeps; i++)
                {
                    _status = _model.Step();

                    if (_status == CollapseStatus.Contradiction)
                    {
                        Debug.Log("Contradiction found! Reset the model and try again.");
                        return;
                    }
                    else if (_status == CollapseStatus.Complete)
                    {
                        _structureAnalyzer = GetComponent <StructureAnalyzer>();
                        _structureAnalyzer.Analyse();
                        Debug.Log("Collapse complete!");
                        return;
                    }
                }
            }
        }