XffectHelper.cs 677 B

123456789101112131415161718192021222324252627282930
  1. using System;
  2. using UnityEngine;
  3. using Xft;
  4. public class XffectHelper : MonoBehaviour
  5. {
  6. public void SetVortexSpeed(float speed)
  7. {
  8. this.distortionLayer.VortexMag = speed;
  9. }
  10. public void SetDir(int dir)
  11. {
  12. if (dir > 0)
  13. {
  14. this.faceTrans.localPosition = new Vector3(0f, 0f, -100000f);
  15. this.distortionLayer.EmitPoint = new Vector3(-50f, 70f, 0f);
  16. }
  17. else
  18. {
  19. this.faceTrans.localPosition = new Vector3(0f, 0f, 100000f);
  20. this.distortionLayer.EmitPoint = new Vector3(50f, 70f, 0f);
  21. this.distortionLayer.VortexMag = -this.distortionLayer.VortexMag;
  22. }
  23. }
  24. public EffectLayer distortionLayer;
  25. public Transform faceTrans;
  26. }