Exemplo n.º 1
0
        public void reBackUpRange(OperatorController operatorController)
        {
            bool isActiveRange = operatorController.IsRangeShow();

            operatorController.DrowRange(operatorController.setupDirection, true);
            if (isActiveRange)
            {
                operatorController.ShowRange();
            }
            else
            {
                operatorController.HideRange();
            }
        }
Exemplo n.º 2
0
        void Update()
        {
            if (Input.GetMouseButtonDown(0))
            {
                RaycastHit hitInfo = new RaycastHit();
                bool       hit     = Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hitInfo);

                if (hit)
                {
                    if (EventSystem.current.IsPointerOverGameObject())
                    {
                        return;
                    }

                    if (hitInfo.transform.gameObject.TryGetComponent <OperatorController>(out OperatorController _operatorController))
                    {
                        if (operatorController != null)
                        {
                            operatorController.HideRange();
                        }
                        operatorController = _operatorController;
                        UpdateSelectInfo(operatorController._operatorData);
                        displaySelectedPanel.SetActive(true);
                        operatorController.ShowRange();
                    }
                    else
                    {
                        displaySelectedPanel.SetActive(false);

                        if (operatorController != null)
                        {
                            operatorController.HideRange();
                        }
                    }
                }
            }
        }