Example #1
0
        /// <summary>
        ///     Get all data in UI and store it to json
        /// </summary>
        public void SaveParameters()
        {
            // Software
            SettingsManager.Instance.SoftwareParameters.CameraSpeed      = cameraSlider.value;
            SettingsManager.Instance.SoftwareParameters.VitesseZoom      = vitesseZoom.value;
            SettingsManager.Instance.SoftwareParameters.ShowGrid         = showGridToggle.isOn;
            SettingsManager.Instance.SoftwareParameters.ScreenShotFolder = Screenshot.Instance.folderPath;
            SettingsManager.Instance.SoftwareParameters.TagOnlyWall      = tagWalltagAllDD.value == 1;

            // Project
            ParsingFunctions.ParseFloatCommaDot(thicknessField.text, out var tf);
            ParsingFunctions.ParseFloatCommaDot(wallsHeightField.text, out var wf);

            if (WallsCreator.Instance != null)
            {
                ProjectManager.Instance.Project.WallHeight    = WallsCreator.Instance.wallHeight = wf / 100f;
                ProjectManager.Instance.Project.WallThickness = WallsCreator.Instance.wallThickness = tf / 100f;
            }



            //Theme
            SettingsManager.Instance.SoftwareParameters.Theme = ThemeManager.Instance.Theme;

            // Auto Save Software parameters
            SettingsManager.Instance.SaveParameters();
        }
Example #2
0
 public float GetWidth()
 {
     if (ParsingFunctions.ParseFloatCommaDot(widthField.text, out var res))
     {
         return(res);
     }
     return(-1f);
 }
Example #3
0
 public float GetHeight()
 {
     if (ParsingFunctions.ParseFloatCommaDot(heightField.text, out var res))
     {
         return(res);
     }
     return(-1f);
 }
Example #4
0
        public void SetFurnitureRotation(string r)
        {
            float res = 0;

            if (ParsingFunctions.ParseFloatCommaDot(r, out res))
            {
                SetFurnitureRotation(res);
            }
        }
        public void SetCharacterRotation(string r)
        {
            float res = 0;

            if (ParsingFunctions.ParseFloatCommaDot(r, out res))
            {
                SetCharacterRotation(res);
            }
        }
Example #6
0
        public void SetWallLength(string length)
        {
            float res = 0;
            var   ok  = ParsingFunctions.ParseFloatCommaDot(length, out res);

            if (ok)
            {
                WallsCreator.Instance.UpdateWallLength(SelectedObjectManager.Instance.currentWallsData[0], res / 100f,
                                                       true);
                SelectedObjectManager.Instance.StartCoroutine(
                    SelectedObjectManager.Instance.SWLRoutine(
                        SelectedObjectManager.Instance.currentWallsData[0], res / 100f, true));
            }
        }
Example #7
0
 // Start is called before the first frame update
 private void Start()
 {
     if (multix == 0)
     {
         multix = 1;
     }
     slider.onValueChanged.AddListener(v => { input.text = v * multix + ""; });
     input.onEndEdit.AddListener(s =>
     {
         float f;
         if (ParsingFunctions.ParseFloatCommaDot(s, out f))
         {
             slider.value = f / multix;
         }
     });
 }
Example #8
0
        //private void ResetWallRoomPropertiesForm()
        //{
        //    for (int i = 0; i < wallColorsGameObject.transform.childCount; i++)
        //    {
        //        wallColorsGameObject.transform.GetChild(i).GetComponent<UnityEngine.UI.Outline>().enabled = false;
        //    }
        //}

        public void SetWallThickness(string thick)
        {
            float res = 0;
            var   ok  = ParsingFunctions.ParseFloatCommaDot(thick, out res);

            if (ok)
            {
                foreach (var w in SelectedObjectManager.Instance.currentWallsData)
                {
                    w.Thickness = res / 100f;
                }
                UpdateWallProperties();

                WallsCreator.Instance.AdjustAllWalls();
            }
        }
Example #9
0
        public void SetWOX(string x)
        {
            float res = 0;
            var   ok  = ParsingFunctions.ParseFloatCommaDot(x, out res);

            if (!ok)
            {
                return;
            }
            res /= 100f;
            foreach (var wo in SelectedObjectManager.Instance.currentWallOpenings)
            {
                wo.Size = new Vector3(res, wo.Size.y, wo.Size.z);
            }
            WallsCreator.Instance.AdjustAllWalls();
            UpdateWallOpeningProperties();
        }
Example #10
0
        public void SetWindowHeight(string h)
        {
            float res = 0;
            var   ok  = ParsingFunctions.ParseFloatCommaDot(h, out res);

            if (!ok)
            {
                return;
            }
            res /= 100f;
            foreach (var wo in SelectedObjectManager.Instance.currentWallOpenings)
            {
                wo.WindowHeight = res;
            }
            WallsCreator.Instance.AdjustAllWalls();
            Instance.UpdateWallOpeningProperties();
        }
Example #11
0
        public void SetFurnitureX(string x)
        {
            float res = 0;
            var   ok  = ParsingFunctions.ParseFloatCommaDot(x, out res);

            if (!ok)
            {
                return;
            }
            res /= 100f;
            foreach (var f in SelectedObjectManager.Instance.currentFurnitureData)
            {
                f.Size =
                    new Vector3(
                        res,
                        f.Size.y,
                        f.Size.z);
                SelectedObjectManager.Instance.UpdateFurnitureSize();
            }

            UpdateFurnitureProperties();
        }
        public void SetCharacterZ(string z)
        {
            float res = 0;
            var   ok  = ParsingFunctions.ParseFloatCommaDot(z, out res);

            if (!ok)
            {
                return;
            }
            res /= 100f;
            foreach (var f in SelectedObjectManager.Instance.currentCharacters)
            {
                f.Size =
                    new Vector3(
                        f.Size.x,
                        f.Size.y,
                        res);
                SelectedObjectManager.Instance.UpdateCharacterSize();
            }

            UpdateCharacterProperties();
        }