Пример #1
0
        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="rayAction">射线击中事件</param>
        public void OnInitialization(HTFAction <MouseRayTargetBase, Vector3, Vector2> rayAction)
        {
            _module             = Module as ControllerManager;
            MainCamera          = _module.transform.GetComponentByChild <Camera>("MainCamera");
            _cameraTarget       = _module.transform.GetComponentByChild <CameraTarget>("CameraTarget");
            _mousePosition      = MainCamera.GetComponent <MousePosition>();
            _mouseRotation      = MainCamera.GetComponent <MouseRotation>();
            _mouseRay           = MainCamera.GetComponent <MouseRay>();
            _highlightingEffect = MainCamera.GetComponent <HighlightingEffect>();

            _mousePosition.Target = _cameraTarget;
            _mousePosition.MR     = _mouseRotation;
            _mouseRotation.Target = _cameraTarget;
            _mouseRay.RayCamera   = MainCamera;
            _mouseRay.RayEvent   += rayAction;
        }
Пример #2
0
        public override void Initialization()
        {
            base.Initialization();

            MainCamera          = transform.GetComponentByChild <Camera>("MainCamera");
            _cameraTarget       = transform.GetComponentByChild <CameraTarget>("CameraTarget");
            _mousePosition      = MainCamera.GetComponent <MousePosition>();
            _mouseRotation      = MainCamera.GetComponent <MouseRotation>();
            _mouseRay           = MainCamera.GetComponent <MouseRay>();
            _highlightingEffect = MainCamera.GetComponent <HighlightingEffect>();

            _mousePosition.Target = _cameraTarget;
            _mousePosition.MR     = _mouseRotation;
            _mouseRotation.Target = _cameraTarget;
            _mouseRay.RayCamera   = MainCamera;
        }
Пример #3
0
        /// <summary>
        /// 初始化助手
        /// </summary>
        public void OnInitialization()
        {
            MainCamera          = Module.GetComponentByChild <Camera>("MainCamera");
            _cameraTarget       = Module.GetComponentByChild <CameraTarget>("CameraTarget");
            _mousePosition      = MainCamera.GetComponent <MousePosition>();
            _mouseRotation      = MainCamera.GetComponent <MouseRotation>();
            _mouseRay           = MainCamera.GetComponent <MouseRay>();
            _highlightingEffect = MainCamera.GetComponent <HighlightingEffect>();

            _mousePosition.Target  = _cameraTarget;
            _mousePosition.MR      = _mouseRotation;
            _mousePosition.Manager = Module as ControllerManager;
            _mouseRotation.Target  = _cameraTarget;
            _mouseRotation.Manager = Module as ControllerManager;
            _mouseRay.RayCamera    = MainCamera;
            _mouseRay.RayEvent    += (target, point, point2D) =>
            {
                RayEvent?.Invoke(target, point, point2D);
            };
        }
Пример #4
0
        public override void OnInitialization()
        {
            base.OnInitialization();

            DOTween.defaultEaseType = DefaultEase;
            DOTween.defaultAutoPlay = DefaultAutoPlay;
            DOTween.defaultAutoKill = IsAutoKill;

            MainCamera          = transform.GetComponentByChild <Camera>("MainCamera");
            _cameraTarget       = transform.GetComponentByChild <CameraTarget>("CameraTarget");
            _mousePosition      = MainCamera.GetComponent <MousePosition>();
            _mouseRotation      = MainCamera.GetComponent <MouseRotation>();
            _mouseRay           = MainCamera.GetComponent <MouseRay>();
            _highlightingEffect = MainCamera.GetComponent <HighlightingEffect>();

            _mousePosition.Target = _cameraTarget;
            _mousePosition.MR     = _mouseRotation;
            _mouseRotation.Target = _cameraTarget;
            _mouseRay.RayCamera   = MainCamera;
            _mouseRay.RayEvent   += OnRay;
        }