private Vector3 DistortPoint(Vector3 point, float normalizedLength)
        {
            if (!distortionEnabled || distorters.Count == 0)
            {
                return(point);
            }

            float strength = uniformDistortionStrength;

            if (distortionMode == DistortionMode.NormalizedLength)
            {
                strength = distortionStrength.Evaluate(normalizedLength);
            }

            for (int i = 0; i < distorters.Count; i++)
            {
                Distorter distorter = distorters[i];

                if (!distorter.DistortionEnabled)
                {
                    continue;
                }

                point = distorter.DistortPoint(point, strength);
            }

            return(point);
        }
 public void AddDistorter(Distorter newDistorter)
 {
     if (!distorters.Contains(newDistorter))
     {
         distorters.Add(newDistorter);
     }
 }
    void Start()
    {
        if (am == null)
        {
            am = GetComponent <AudioManager>();
        }
        if (distorter == null)
        {
            distorter = FindObjectOfType <Distorter>();
        }
        if (victorySpeed == 0)
        {
            victorySpeed = c;
        }

        gm = GameManager.instance;
        if (controller == null)
        {
            controller = gm.movementController;
        }
    }
Example #4
0
 /// <summary>
 /// Constructs a BackgroundLayer object by loading the specified entry from the specified ROM object
 /// </summary>
 public BackgroundLayer(Rom src, int entry)
 {
     distort = new Distorter();
     bmp     = new Bitmap(256, 256, PixelFormat.Format24bppRgb);
     LoadEntry(src, entry);
 }