Exemplo n.º 1
0
        private bool CheckPropertiesBindings(WallOpening wo)
        {
            woPropertiesForm.SetActive(wo != null);
            if (woPropertiesForm.activeInHierarchy)
            {
                if (m_needsUpdate)
                {
                    woWindowHeightField.transform.parent.gameObject.SetActive(wo.IsWindow);
                    woIsDoubleToggle.isOn = wo.IsDouble;
                    woIsDoubleToggle.transform.parent.gameObject.SetActive(wo.IsWindow);

                    woIsFlippedToggle.isOn = wo.IsPull;
                    woIsLeftToggle.isOn    = wo.IsLeft;
                    woIsLeftToggle.transform.parent.gameObject.SetActive(!wo.IsDouble);

                    if (wo.IsWindow)
                    {
                        var dble = wo.IsDouble ? " Double" : " Simple";

                        if (woNameText != null)
                        {
                            woNameText.text = "Fenetre" + dble;
                        }
                        woWindowHeightField.text = Mathf.Floor(wo.WindowHeight * 100f) + "";
                    }
                    else
                    {
                        if (woNameText != null)
                        {
                            woNameText.text = "Porte";
                        }
                    }

                    woXField.text = Mathf.Floor(wo.Size.x * 100f) + "";
                    woYField.text = Mathf.Floor(wo.Size.y * 100f) + "";
                }
            }

            m_needsUpdate = !woPropertiesForm.activeInHierarchy;

            return(woPropertiesForm.activeInHierarchy);
        }
Exemplo n.º 2
0
        // Update is called once per frame
        private void Update()
        {
            if (GlobalManager.Instance.GetActiveCamera().tag != "Cam2D")
            {
                leftArrow.SetActive(false);
                rightArrow.SetActive(false);
                return;
            }

            var show = SelectedObjectManager.Instance.currentWallOpenings.Count > 0;

            leftArrow.SetActive(show);
            rightArrow.SetActive(show);
            if (show)
            {
                wo = SelectedObjectManager.Instance.currentWallOpenings[0];
                if (leftArrow != currentArrow)
                {
                    leftArrow.transform.position = wo.Position + m_decal - wo.Wall.Direction * wo.Size.x / 2f;
                }
                //p1Arrow.transform.rotation = Quaternion.FromToRotation(Vector3.right, -wo.Wall.Direction);
                if (rightArrow != currentArrow)
                {
                    rightArrow.transform.position = wo.Position + m_decal + wo.Wall.Direction * wo.Size.x / 2f;
                }
                //p2Arrow.transform.rotation = Quaternion.FromToRotation(Vector3.right, wo.Wall.Direction);
                leftArrow.transform.localScale =
                    Vector3.one * Mathf.Abs(GlobalManager.Instance.cam2DTop.transform.position.z / 10f);
                rightArrow.transform.localScale =
                    Vector3.one * Mathf.Abs(GlobalManager.Instance.cam2DTop.transform.position.z / 10f);
            }

            if (show)
            {
                ClickArrow();
            }
            else
            {
                isMoving = false;
            }
        }