Ejemplo n.º 1
0
    private static void Shoot(Player pPlayer, Rocks rRocks, Action onShootSuccess, PlayerInput playerInput)
    {
        var  pos  = pPlayer.currentLight.positionIndex;
        Rock rock = rRocks.FindNearest(pos);

        if (rock == null)
        {
            return;
        }

        if (pPlayer.color != rock.color)
        {
            playerInput.ShowUU();
            return;
        }

        rock.Boom();
        onShootSuccess();
        Debug.Log("Shoot");
    }