Example #1
0
    void Awake()
    {
        if (instance != null && instance != this)
        {
            Destroy(gameObject);
            return;
        }

        instance = this;
    }
Example #2
0
    public bool shuffleSTagList; // Only for use in Single Player

    void Awake()
    {
        if (instance != null && instance != this)
        {
            print("Destroying duplicate AssetManager");
            Destroy(gameObject);
            return;
        }

        instance = this;
    }
        public AssetManager()
        {
            dic = new Dictionary <string, IAssetManagerUnit> ();

            if (LOADASYNC)
            {
                go = new GameObject("AssetManagerGameObject");

                GameObject.DontDestroyOnLoad(go);

                script = go.AddComponent <AssetManagerScript>();
            }
        }