/// <summary> /// Remove a UnityEngine.Material from the Material reference Dictionary. /// </summary> /// <returns><c>true</c>, if UnityEngine.Material was removed, <c>false</c> otherwise.</returns> /// <param name="material">The target UnityEngine.Material to be removed.</param> public bool RemoveMaterial(UnityEngine.Material material) { int check = material.GetDataHashCode(); if (_materialLookup.ContainsKey(check)) { _materialLookup.Remove(check); return(true); } return(false); }
/// <summary> /// Add a Material to the Material reference Dictionary. /// </summary> /// <remarks>This can only be used from within Unity's main thread.</remarks> /// <returns>The DataHashCode</returns> /// <param name="material">The UnityEngine.Material to be added.</param> public int AddMaterial(UnityEngine.Material material) { return(AddMaterial(material.GetDataHashCode(), material)); }