Exemple #1
0
    public void Confirm()
    {
        // Check if the strings are not empty.
        if (TextX.text != "" && TextY.text != "")
        {
            // Convert text in input field to floats.
            X = float.Parse(TextX.text);
            Y = float.Parse(TextY.text);

            // Check if is inside size bounds.
            if (X < ModelConfigurator.Info.MinX || Y < ModelConfigurator.Info.MinY)
            {
                return;
            }
            if (X > ModelConfigurator.Info.MaxX || Y > ModelConfigurator.Info.MaxY)
            {
                return;
            }

            // Convert size in meters, to converted size for configurated.
            int windowCount = ModelConfigurator.Info.WindowCount;
            X = X * 0.5f + 1;

            // Send new values to configurator.
            ModelConfigurator.SetSize(X, Y);
        }
        else
        {
            return;
        }
    }
Exemple #2
0
        public void Confirm()
        {
            // Check if the strings are not empty.
            if (TextX.text != "" && TextY.text != "")
            {
                // Convert text in input field to floats.
                m_X = float.Parse(TextX.text);
                m_Y = float.Parse(TextY.text);

                // Check if is inside size bounds.
                WindowInfo info = ModelConfigurator.Info;
                if (m_X < info.MinX || m_Y < info.MinY)
                {
                    return;
                }
                if (m_X > info.MaxX || m_Y > info.MaxY)
                {
                    return;
                }

                // Convert size in meters, to converted size for configurator.
                var windowCount = ModelConfigurator.Info.WindowCount;
                m_X = m_X * (1.0f / windowCount) + windowCount - 1.0f;

                // Send new values to configurator.
                if (ModelConfigurator.transform.parent.GetComponent <ModelConfiguratorBiCorner>())
                {
                    ModelConfigurator.transform.parent.GetComponent <ModelConfiguratorBiCorner>().SetSize(m_X, m_Y);
                }
                else
                {
                    ModelConfigurator.SetSize(m_X, m_Y);
                }
            }
            else
            {
                return;
            }
        }