If Else Statement Multiple Audio Sources on One Game Object

I am a COMPLETE beginner when it comes to coding and Unity.

I have two game objects (cubes) in a scene. Let’s call them CubeA and CubeB. I have two different audio sources attached to CubeA.

Basically, what I am trying to do is this:

IF the user clicks CubeA and has not yet clicked CubeB, THEN play Audio Source 1
IF the user clicks CubeA and has already clicked CubeB, THEN play Audio Source 2

Can I do this using Event Triggers in the Inspector, or do I need to write a script for it? Thanks in advance for any help!

oYou need a script on each cube, CubeA.cs and CubeB.cs

You have to use OnMouseDown - Check out

Implement that into the scrips and this will give you an idea of how to get a method callback when you click a box.

Then you need to trigger a sound effect inside the OnMouseDown callback. You need an AudioSource and AudioClip component for that. Check out this guide on how you play a sound effect.