Inheritance: MonoBehaviour
Exemplo n.º 1
0
    UploadService uploadService; // Initialising Upload Service.

    #endregion Fields

    #region Methods

    public static Upload_Main GetInstance()
    {
        if (con == null) {
                con = (new GameObject ("Upload_Main")).AddComponent<Upload_Main> ();
                return con;
            } else {
                return con;
            }
    }
Exemplo n.º 2
0
    void Awake()
    {
        // First we check if there are any other instances conflicting
            if (con != null && con != this) {
                // If that is the case, we destroy other instances
                Destroy (gameObject);
            }

            // Here we save our singleton instance
            con = this;

            // Furthermore we make sure that we don't destroy between scenes (this is optional)
            DontDestroyOnLoad (gameObject);
    }