Exemple #1
0
    private void Whack(InputAction.CallbackContext obj)
    {
        if (activeWhacks >= maxActiveWhacks)
        {
            return;
        }
        activeWhacks++;
        int holeIndex = 0;

        switch (obj.action.name)
        {
        case "Whack 1":
            holeIndex = 1;
            break;

        case "Whack 2":
            holeIndex = 2;
            break;

        case "Whack 3":
            holeIndex = 3;
            break;

        case "Whack 4":
            holeIndex = 4;
            break;

        case "Whack 5":
            holeIndex = 5;
            break;

        case "Whack 6":
            holeIndex = 6;
            break;
        }
        holeIndex--;
        Hole hole = Holes.holes[holeIndex].GetComponent <Hole>();

        hole.Hit();
    }