Пример #1
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetMouseButton(0))
        {
            IFirearm firearm = equippedObject?.GetComponent <IFirearm>();
            if (firearm != null)
            {
                firearm.Shoot(relMousePos);
            }
        }

        animator.SetFloat("facingY", relMousePos.y);
        animator.SetFloat("facingX", relMousePos.x);

        IItem item = equippedObject?.GetComponent <IItem>();

        if (item != null)
        {
            float angle = Vector2.SignedAngle(Vector2.right, relMousePos);
            if (angle < 0.0f)
            {
                angle = 360.0f + angle;
            }
            item.Animate(angle);
        }
    }
Пример #2
0
 public Shooter(IFirearm firearm)
 {
     _firearm = firearm;
 }
Пример #3
0
 public Shooter(IFirearm firearm)
 {
     _firearm = firearm;
 }