How to make Ai use ouMouseDown() and onMouseUp() function in unity?

I want to make an ai for my game.

Currently my game controller uses onmousedown and onmouseup functions and some other factors?

My game is for two players on same screen but you don’t always have someone to play game with so I wanna design Ai for that.
How can I go about to design Ai for something like that?