Eonirr

Untitled

Oct 26th, 2026
11
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. void Update()
  2. {
  3. m_updateTime += Time.deltaTime;
  4. if (m_updateTime < INTERVAL) return;
  5. m_updateTime = 0f;
  6.  
  7. if (m_onlyOnNoMap && !ZoneSystem.instance.GetGlobalKey(NOMAP_KEY))
  8. {
  9. ps.emission.enabled = false;
  10. return;
  11. }
  12. if (Player.m_localPlayer == null || activeEvents.Count == 0)
  13. {
  14. ps.emission.enabled = false;
  15. return;
  16. }
  17.  
  18. var vel = ps.velocityOverLifetime;
  19. vel.space = ParticleSystemSimulationSpace.World;
  20.  
  21. Vector3 best = Vector3.positiveInfinity;
  22. foreach (var ev in activeEvents)
  23. {
  24. Vector3 d = ev.position - Player.m_localPlayer.transform.position;
  25. if (d.magnitude < best.magnitude) best = d;
  26. }
  27.  
  28. Vector3 dir = best.normalized;
  29. vel.x = dir.x;
  30. vel.z = dir.z;
  31.  
  32. float t = Mathf.Max(0f, best.magnitude - ev.radius);
  33. ps.emission.rateOverTimeMultiplier = m_strengthByDistance.Evaluate(t) * m_maxStrength;
  34. ps.emission.enabled = true;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment