Ejemplo n.º 1
0
 public void UpdateCursor(PlayerWeaponHandler handler)
 {
     if (currentCursor != null)
     {
         currentCursor.CursorUpdate(handler);
     }
 }
Ejemplo n.º 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);
                }
            }
        }
Ejemplo n.º 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);
                    }
                }
            }
        }
Ejemplo n.º 4
0
 public abstract void CursorUpdate(PlayerWeaponHandler handler);
Ejemplo n.º 5
0
 public override void CursorUpdate(PlayerWeaponHandler handler)
 {
 }