- Twirl.cs
- Scripts /
- ImageEffects /
- Effects /
- Standard Assets /
- Assets /
- project /
1 using System;
2 using UnityEngine;
3
4 namespace UnityStandardAssets.ImageEffects
5 {
6 [ExecuteInEditMode]
7 [AddComponentMenu("Image Effects/Displacement/Twirl")]
8 public class Twirl : ImageEffectBase
9 {
10 public Vector2 radius = new Vector2(0.3F,0.3F);
11 [Range(0.0f,360.0f)]
12 public float angle = 50;
13 public Vector2 center = new Vector2 (0.5F, 0.5F);
14
15
16 // Called by camera to apply image effect
17 void OnRenderImage (RenderTexture source, RenderTexture destination)
18 {
19 ImageEffects.RenderDistortion (material, source, destination, angle, center, radius);
20 }
21 }
22 }
2 using UnityEngine;
3
4 namespace UnityStandardAssets.ImageEffects
5 {
6 [ExecuteInEditMode]
7 [AddComponentMenu("Image Effects/Displacement/Twirl")]
8 public class Twirl : ImageEffectBase
9 {
10 public Vector2 radius = new Vector2(0.3F,0.3F);
11 [Range(0.0f,360.0f)]
12 public float angle = 50;
13 public Vector2 center = new Vector2 (0.5F, 0.5F);
14
15
16 // Called by camera to apply image effect
17 void OnRenderImage (RenderTexture source, RenderTexture destination)
18 {
19 ImageEffects.RenderDistortion (material, source, destination, angle, center, radius);
20 }
21 }
22 }