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.

62 lines
1.4 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 deactiveGrey = new Color32(120, 120, 120, 255);
  9. Color red = new Color32(255, 0, 0, 255);
  10. Color purple = new Color32(183, 96, 255, 255);
  11. Color yellow = new Color32(255, 241, 36, 255);
  12. //load portal
  13. public ParticleSystem Edge;
  14. public ParticleSystem InSpark;
  15. public ParticleSystem RandomSparks;
  16. public ParticleSystem Ring;
  17. public ParticleSystem Smoke;
  18. private void Awake()
  19. {
  20. var mainEdge = Edge.main;
  21. var mainInSpark = InSpark.main;
  22. var mainRandomSparks = RandomSparks.main;
  23. var mainRing = Ring.main;
  24. var mainSmoke = Smoke.main;
  25. mainEdge.startColor = deactiveGrey;
  26. mainInSpark.startColor = deactiveGrey;
  27. InSpark.Stop();
  28. mainRandomSparks.startColor = deactiveGrey;
  29. RandomSparks.Stop();
  30. mainRing.startColor = deactiveGrey;
  31. mainSmoke.startColor = deactiveGrey;
  32. Smoke.Stop();
  33. }
  34. private void start()
  35. {
  36. //when someone collects enough items
  37. //InSpark.Play();
  38. //RandomSparks.Play();
  39. //Smoke.Play();
  40. //while not everyone has exited
  41. //mainEdge.startColor = red;
  42. //mainInSpark.startColor = red;
  43. //mainRandomSparks.startColor = red;
  44. //mainRing.startColor = red;
  45. //mainSmoke.startColor = red;
  46. //yield return new WaitForSeconds(5);
  47. //loop until all players have hit the portal
  48. }
  49. }