Calling functions from another script not attached to an object

I am new to programing. I want to call a function from another script but not sure how to do it. I know how to call a variable from another script assuming I made that vairbale static.

I want to create a script that contains a reset function that will reset everything for my game.

I want to call this reset function from various other script that require my game to be reset.

The script that contains the reset function will not be attached to any object (assuming that is ok).

I am aware of a way to reload a level but I do want to do that using my own reset function. The answer to this question will organize my code greatly thank you very much in advance!!

You can make the method static also… I’m not sure you are using C# but to do this in C# all you need to do is…

public class MyClass
{
    public static void ResetGame()
    {
        //do reset code here
    }

}

to call

  MyClass.ResetGame();

http://unity3d.com/support/documentation/ScriptReference/index.Accessing_Other_Game_Objects.html

Don’t use static variables unless you specifically mean for there to be only one instance per class. Static doesn’t mean “accessible from other scripts”, that’s what public is for. In Unityscript, variables are public by default, in C#, they are private by default.