TwirlEffect.cs 467 B

1234567891011121314
  1. using UnityEngine;
  2. [ExecuteInEditMode]
  3. [AddComponentMenu("Image Effects/Twirl")]
  4. public class TwirlEffect : ImageEffectBase {
  5. public Vector2 radius = new Vector2(0.3F,0.3F);
  6. public float angle = 50;
  7. public Vector2 center = new Vector2 (0.5F, 0.5F);
  8. // Called by camera to apply image effect
  9. void OnRenderImage (RenderTexture source, RenderTexture destination) {
  10. ImageEffects.RenderDistortion (material, source, destination, angle, center, radius);
  11. }
  12. }