Example #1
0
 void ReleaseTexture()
 {
     if (!string.IsNullOrEmpty(m_TextureName))
     {
         ReferencedTextureManager.ReleaseTexture(m_TextureName);
     }
 }
Example #2
0
    void UpdateTexture()
    {
        target.material.SetTexture("_MainTex", null);
        target.material.SetTexture("_MaskTex", null);
        target.mainTexture = null;

        if (!string.IsNullOrEmpty(m_TextureName))
        {
            ReferencedTextureManager.GetTexture2DAsync(m_TextureName, SetTextureAction, gameObject);
        }
    }
Example #3
0
    void UpdateTexture()
    {
        if (string.IsNullOrEmpty(m_TextureName))
        {
            target.mainTexture = null;
            if (!string.IsNullOrEmpty(m_LastTextureName))
            {
                ReferencedTextureManager.ReleaseTexture(m_LastTextureName);
            }
            m_LastTextureName = m_TextureName;
        }
        if (!string.IsNullOrEmpty(m_TextureName) && !m_TextureName.Equals(m_LastTextureName))
        {
            if (!string.IsNullOrEmpty(m_LastTextureName))
            {
                ReferencedTextureManager.ReleaseTexture(m_LastTextureName);
            }

            ReferencedTextureManager.GetTexture2DAsync(m_TextureName, SetTextureAction, gameObject);
            m_LastTextureName = m_TextureName;
        }
    }