예제 #1
0
 private void DisableShadowRendering()
 {
     if (shadowRenderer)
     {
         DestroyImmediate(shadowRenderer);
     }
     else
     {
         try
         {
             //Try to look for an old unreferenced component and delete it
             if (shadowCaster)
             {
                 shadowRenderer = shadowCaster.GetComponent <StylizedWaterShadowCaster>();
             }
             if (shadowRenderer)
             {
                 DestroyImmediate(shadowRenderer);
             }
         }
         catch (Exception)
         {
             throw;
         }
     }
 }
예제 #2
0
 private void EnableShadowRendering()
 {
     if (shadowCaster.GetComponent <StylizedWaterShadowCaster>() == null)
     {
         shadowRenderer = shadowCaster.gameObject.AddComponent <StylizedWaterShadowCaster>();
     }
 }