public void ResetPlatformData()
    {
        if (CustomDebug.Enable)
        {
            if (OnSpriteCollectionReset != null)
            {
                OnSpriteCollectionReset(this);
            }
        }

        tk2dEditorSpriteDataUnloader.Unregister(this);

        if (platformSpecificData != null)
        {
            platformSpecificData.DestroyTextureInsts();
            platformSpecificData.DestroyMaterialInsts();
        }
        DestroyTextureInsts();
        DestroyMaterialInsts();

        if (platformSpecificData)
        {
            platformSpecificData = null;
        }

        materialInsts = null;
    }
Пример #2
0
    /// <summary>
    /// Unloads the atlas texture data in this sprite collection.
    /// This will be reloaded when the data is accessed again.
    /// Make sure all sprites using this collection have already been destroyed.
    /// </summary>
    public void UnloadTextures()
    {
        // Debug.Log(Resources.FindObjectsOfTypeAll(typeof(Texture2D)).Length);

        tk2dSpriteCollectionData theInst = inst;

        foreach (Texture2D texture in theInst.textures)
        {
            Resources.UnloadAsset(texture);
        }

        theInst.DestroyTextureInsts();

        // Debug.Log(Resources.FindObjectsOfTypeAll(typeof(Texture2D)).Length);
    }
Пример #3
0
    public void ResetPlatformData()
    {
        if (platformSpecificData != null)
        {
            platformSpecificData.DestroyTextureInsts();
        }
        DestroyTextureInsts();

        if (platformSpecificData)
        {
            platformSpecificData = null;
        }

        materialInsts = null;
    }
Пример #4
0
    public void ResetPlatformData()
    {
        tk2dEditorSpriteDataUnloader.Unregister(this);

        if (platformSpecificData != null)
        {
            platformSpecificData.DestroyTextureInsts();
        }
        DestroyTextureInsts();

        if (platformSpecificData)
        {
            platformSpecificData = null;
        }

        materialInsts = null;
    }