Lately I've been working on a FPS game with a storyline in unity and I've encountered something that has been making my head explode for days. My objective is to be able to force the player to do a certain objective before being able to continue the game and to also give the new missions straight after the player has completed the past ones.
To help the player out I've created a panel with the description of the mission so that the player can check it out whenever he wants to. I've already created some code of my own for one mission but it seems to be a mess, I'm sure I should have different scripts for different things so that I didn't need to repeat code so much when I'm about to create a new mission script.
My problem is that I don't have the skills yet to do and I would like some suggestions: how could reduce my code and how I could create a universal script that would be able to recognize which missions are done and which are not, instead of doing it over and over again in every single mission script?
I'm kinda of new to unity and I've never posted to stack overflow so if I made any mistakes I'm sorry.
Extra information: the storyline is a linear, what I mean by that is that it doesn't give the player a choice to change it, it will always be the same and the quests/missions are here to force the player into following it. For example, the first mission is for the player to go down stairs and turn on two batteries. The second mission is for the player to kill a certain amount of enemies that appear right after.