예제 #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)
 {
 }