Exemple #1
0
 private void ValidateShader(Material material)
 {
     if ((material.shader.ToString() == DefaultMaskedSpriteShader.ToString()) &&
         (material.shader.GetInstanceID() != DefaultMaskedSpriteShader.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.");
         DefaultMaskedSpriteShader = null;
     }
     if ((material.shader.ToString() == DefaultMaskedUnlitShader.ToString()) &&
         (material.shader.GetInstanceID() != DefaultMaskedUnlitShader.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.");
         DefaultMaskedUnlitShader = null;
     }
 }
Exemple #2
0
 private void VersionUpgradeMaskees(SpriteRenderer targetRen)
 {
     if (!AssetDatabase.Contains(targetRen.sharedMaterial))
     {
         if ((targetRen.sharedMaterial.shader.ToString() == DefaultMaskedSpriteShader.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;
             }
         }
     }
 }
Exemple #3
0
 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() == DefaultMaskedSpriteShader.ToString()))
         {
             if (!targetRen.material.Equals(SpritesAlphaMaskWorldCoords))
             {
                 ScheduleFullMaskRefresh();
                 Debug.Log("Version upgrade on: " + targetRen.gameObject.name, targetRen.gameObject);
                 if (!upgradeDiscards.Contains(targetRen.material))
                 {
                     upgradeDiscards.Add(targetRen.material);
                 }
                 targetRen.material = SpritesAlphaMaskWorldCoords;
                 return;
             }
         }
     }
 }