Example #1
0
        /// <summary>
        /// 刷新助手
        /// </summary>
        public void OnRefresh()
        {
            _mouseRay.OnRefresh();
            switch (TheControlMode)
            {
            case ControlMode.FreeControl:
                _mousePosition.OnRefresh();
                _mouseRotation.OnRefresh();
                break;
            }

            if (Main.m_Input.GetButtonDown(InputButtonType.MouseLeft))
            {
                if (RayTarget != null)
                {
                    if (_mouseClickTargets.ContainsKey(RayTarget))
                    {
                        _mouseClickTargets[RayTarget]?.Invoke();
                    }
                }
            }
            if (Main.m_Input.GetButtonDown(InputButtonType.MouseLeftDoubleClick))
            {
                if (RayTarget != null)
                {
                    MouseRayTarget target = RayTarget as MouseRayTarget;
                    if (target && target.IsDoubleClickFocus)
                    {
                        SetLookPoint(target.transform.position);
                    }
                }
            }
        }
        /// <summary>
        /// 刷新助手
        /// </summary>
        public void OnRefresh()
        {
            _mouseRay.OnRefresh();
            if (Mode == ControlMode.FreeControl)
            {
                _mousePosition.OnRefresh();
                _mouseRotation.OnRefresh();
            }

            if (Main.m_Input.GetButtonDown(InputButtonType.MouseLeft))
            {
                if (RayTarget != null)
                {
                    RayTarget.OnMouseClick.Invoke();
                }
            }
            if (Main.m_Input.GetButtonDown(InputButtonType.MouseLeftDoubleClick))
            {
                if (RayTarget != null)
                {
                    MouseRayTarget target = RayTarget as MouseRayTarget;
                    if (target && target.IsDoubleClickFocus)
                    {
                        SetLookPoint(target.transform.position);
                    }
                }
            }
        }
 /// <summary>
 /// 刷新
 /// </summary>
 public void OnRefresh()
 {
     _mouseRay.OnRefresh();
     switch (TheControlMode)
     {
     case ControlMode.FreeControl:
         _mousePosition.OnRefresh();
         _mouseRotation.OnRefresh();
         break;
     }
 }
        public override void OnRefresh()
        {
            base.OnRefresh();

            _mouseRay.OnRefresh();
            switch (TheControlMode)
            {
            case ControlMode.FreeControl:
                FreeControlUpdateEvent?.Invoke();

                _mousePosition.OnRefresh();
                _mouseRotation.OnRefresh();
                break;

            case ControlMode.FirstPerson:
                FirstPersonUpdateEvent?.Invoke();
                break;

            case ControlMode.ThirdPerson:
                ThirdPersonUpdateEvent?.Invoke();
                break;
            }
        }
        public override void OnRefresh()
        {
            base.OnRefresh();

            _mouseRay.OnRefresh();
            switch (TheControlMode)
            {
            case ControlMode.FreeControl:
                _mousePosition.OnRefresh();
                _mouseRotation.OnRefresh();
                break;
            }

            if (Main.m_Input.GetButtonDown(InputButtonType.MouseLeft))
            {
                if (RayTarget != null)
                {
                    if (_mouseClickTargets.ContainsKey(RayTarget))
                    {
                        _mouseClickTargets[RayTarget]?.Invoke();
                    }
                }
            }
        }