/// <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; }
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; }
/// <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); }; }
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; }