예제 #1
0
파일: PulseEffect.cs 프로젝트: Toreole/CLA
        public static Pulse GetRandom(float offset, float timeDeviation)
        {
            Pulse p = new Pulse();

            p.time          = Time.timeSinceLevelLoad + Random.value * timeDeviation;
            p.screenPoint.x = Mathf.Lerp(offset, 1f - offset, Random.value);
            p.screenPoint.y = Mathf.Lerp(offset, 1f - offset, Random.value);
            return(p);
        }
예제 #2
0
파일: PulseEffect.cs 프로젝트: Toreole/CLA
 public void OnStageClear(StageCleared st)
 {
     //Generate random pulses.
     for (int i = 0; i < 5; i++)
     {
         pulses[i] = Pulse.GetRandom(edgeOffset, maxTimeOffset);
     }
     mat.SetFloatArray("_Impacts", pulses.GetTimes());
     mat.SetVectorArray("_ImpactPoints", new Vector4[] {
         pulses[0].screenPoint,
         pulses[1].screenPoint,
         pulses[2].screenPoint,
         pulses[3].screenPoint,
         pulses[4].screenPoint
     });
 }