예제 #1
0
    public void Awake()
    {
        DontDestroyOnLoad(this);

        if (FindObjectsOfType(GetType()).Length > 1)
        {
            Destroy(gameObject);
        }

        GameObject menuControls = GameObject.Find("menuControls");

        menu = menuControls.GetComponent <startOver>();
    }
예제 #2
0
    // Use this for initialization
    void Start()
    {
        GameObject gameControllerObject = GameObject.FindWithTag("GameController");

        if (gameControllerObject != null)
        {
            score = gameControllerObject.GetComponent <scoreController>();
        }
        if (score == null)
        {
            Debug.Log("Cannot find 'GameController' script");
        }

        GameObject menuControls = GameObject.Find("menuControls");

        menu = menuControls.GetComponent <startOver>();
        menu.startScreen();
    }