You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.3 KiB

  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class PortalColourChange : MonoBehaviour
  5. {
  6. //get materials/colour from players
  7. //hard code for now
  8. Color person1 = new Color32(255, 91, 0, 255);
  9. Color red2 = new Color32(255, 0, 0, 255);
  10. Color purple1 = new Color32(183, 96, 255, 255);
  11. Color purple2 = new Color32(140, 0, 255, 255);
  12. Color yellow1 = new Color32(252, 255, 124, 255);
  13. Color yellow2 = new Color32(250, 255, 0, 255);
  14. Color green1 = new Color32(30, 255, 64, 255);
  15. Color green2 = new Color32(0, 196, 29, 255);
  16. //load portal
  17. public ParticleSystem Edge;
  18. public ParticleSystem InSpark;
  19. public ParticleSystem RandomSparks;
  20. public ParticleSystem Ring;
  21. public ParticleSystem Smoke;
  22. private void Awake()
  23. {
  24. var mainEdge = Edge.main;
  25. var mainInSpark = InSpark.main;
  26. var mainRandomSparks = RandomSparks.main;
  27. var mainRing = Ring.main;
  28. var mainSmoke = Smoke.main;
  29. //while not everyone has exited
  30. mainEdge.startColor = purple1;
  31. mainInSpark.startColor = new ParticleSystem.MinMaxGradient(purple2, purple1);
  32. mainRandomSparks.startColor = new ParticleSystem.MinMaxGradient(purple2, purple1);
  33. mainRing.startColor = purple1;
  34. mainSmoke.startColor = purple2;
  35. //yield return new WaitForSeconds(5);
  36. //loop until all players have fhit the portal
  37. }
  38. }