示例#1
0
    //Restart level
    public void restart()
    {
        transform.position = sPos;

        foreach (GameObject obj in GameObject.FindGameObjectsWithTag("PushableBlock"))
        {
            PushableBlockScript script = obj.GetComponent <PushableBlockScript>();
            script.Reset();
        }

        foreach (GameObject obj in GameObject.FindGameObjectsWithTag("Lantern"))
        {
            Lantern script = obj.GetComponent <Lantern>();
            script.Reset();
        }

        foreach (GameObject obj in GameObject.FindGameObjectsWithTag("Switch"))
        {
            Switch script = obj.GetComponent <Switch>();
            script.Reset();
        }


        death.enabled = false;
    }