Пример #1
0
 public void UpdateCursor(PlayerWeaponHandler handler)
 {
     if (currentCursor != null)
     {
         currentCursor.CursorUpdate(handler);
     }
 }
Пример #2
0
        public override void CursorUpdate(PlayerWeaponHandler handler)
        {
            cursorTransform.localPosition = ScreenToLocalPosition(Input.mousePosition);

            Ray        screenRay = rootCanvas.worldCamera.ScreenPointToRay(Input.mousePosition);
            RaycastHit screenRayHit;

            if (Physics.Raycast(screenRay, out screenRayHit))
            {
                handler.AimWeapon(screenRayHit.point);

                if (Input.GetKeyDown(KeyCode.Mouse0))
                {
                    handler.AttackWithTargetPosition(screenRayHit.point);
                }
            }
        }
Пример #3
0
        public override void CursorUpdate(PlayerWeaponHandler handler)
        {
            cursorTransform.localPosition = ScreenToLocalPosition(Input.mousePosition);

            screenRay = aimingCamera.ScreenPointToRay(Input.mousePosition);

            if (Physics.Raycast(screenRay, out screenRayHit))
            {
                Vector3 aimingOrigin = playerTransform.localPosition;

                aimingRay = new Ray(aimingOrigin, (screenRayHit.point - aimingOrigin).normalized);

                if (Physics.Raycast(aimingRay, out aimingRayHit))
                {
                    rayGuideTransform.localPosition = WorldToLocalPosition(aimingRayHit.point);

                    if (Input.GetKeyDown(KeyCode.Mouse0))
                    {
                        handler.AttackWithTargetPosition(aimingRayHit.point);
                    }
                }
            }
        }
Пример #4
0
 public abstract void CursorUpdate(PlayerWeaponHandler handler);
Пример #5
0
 public override void CursorUpdate(PlayerWeaponHandler handler)
 {
 }