Beispiel #1
0
    private void Awake()
    {
        // Destroy the game object if there is already an OsFps instance.
        if (Instance != null)
        {
            enabled = false;
            gameObject.SetActive(false);
            Destroy(gameObject);
            return;
        }

        Assert.raiseExceptions = true;

        Instance = this;
        DontDestroyOnLoad(gameObject);

        GameObject guiContainer = Instantiate(GUIContainerPrefab);

        DontDestroyOnLoad(guiContainer);

        CreateDataObject();
        CanvasObject = guiContainer.FindDescendant("Canvas");

        var networkMatch = gameObject.AddComponent <NetworkMatch>();

        NetLib.NetworkMatch = networkMatch;
        NetLib.Setup();

        Settings.LoadFromFile(SettingsFilePath);
    }