private void ValidateShader(Material material) { if ((material.shader.ToString() == MaskedSpriteWorldCoordsShader.ToString()) && (material.shader.GetInstanceID() != MaskedSpriteWorldCoordsShader.GetInstanceID())) { Debug.Log("There seems to be more than one masked shader in the project with the same display name, and it's preventing the mask from being properly applied."); MaskedSpriteWorldCoordsShader = null; } if ((material.shader.ToString() == MaskedUnlitWorldCoordsShader.ToString()) && (material.shader.GetInstanceID() != MaskedUnlitWorldCoordsShader.GetInstanceID())) { Debug.Log("There seems to be more than one masked shader in the project with the same display name, and it's preventing the mask from being properly applied."); MaskedUnlitWorldCoordsShader = null; } }
private void VersionUpgradeMaskees(SpriteRenderer targetRen) { if (!AssetDatabase.Contains(targetRen.sharedMaterial)) { if ((targetRen.sharedMaterial.shader.ToString() == MaskedSpriteWorldCoordsShader.ToString())) { if (!targetRen.sharedMaterial.Equals(SpritesAlphaMaskWorldCoords)) { Debug.Log("Version upgrade on: " + targetRen.gameObject.name, targetRen.gameObject); if (!upgradeDiscards.Contains(targetRen.sharedMaterial)) { upgradeDiscards.Add(targetRen.sharedMaterial); } targetRen.material = SpritesAlphaMaskWorldCoords; return; } } } }
private void VersionUpgradeMaskees(Graphic targetRen) { if (!AssetDatabase.Contains(targetRen.material)) { //Version upgrade content. Switches old instantiated materials to reference to core material. if ((targetRen.material.shader.ToString() == MaskedSpriteWorldCoordsShader.ToString())) { if (!targetRen.material.Equals(SpritesAlphaMaskWorldCoords)) { fullMaskRefresh = true; Debug.Log("Version upgrade on: " + targetRen.gameObject.name, targetRen.gameObject); if (!upgradeDiscards.Contains(targetRen.material)) { upgradeDiscards.Add(targetRen.material); } targetRen.material = SpritesAlphaMaskWorldCoords; return; } } } }