Archiving my functions

I think of a function, I write the function, I make a new game, I rewrite the function. Isn’t there a pro method that I can archive my functions to be used in different games so I have have to rewrite them and become time consuming?

Copy paste works pretty well for simple functions.

For more complicated functionality simply copy the entire script file.

Helper methods should be in their own class to allow easy porting.

For more complex relationships with multiple GameObjects or scripts simply export a package.

Edit: None of these methods are pro. Simply good DRY coding practice.

I just take the entire script from a previous game, and reconfigure it to fit the new game. all you would need to do is drag it from the assets from another game into your new one, and open it up and change it how you see fit.