Level.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. public class Level : MonoBehaviour
  6. {
  7. public HeartController HeartController;
  8. public LevelTargets LevelTargets;
  9. public List<Transform> ListPlayerSpawnPoints;
  10. public int Stages;
  11. public Transform PivotCameraLevel;
  12. public GameObject ArrowsChangePlayer;
  13. public Transform SpawnPointPlayer;
  14. public GameObject Logo;
  15. public FinishTrigger FinishTrigger;
  16. public List<PickUp> BaloonsList;
  17. public List<PickUp> HearthList;
  18. public List<PickUp> RocksList;
  19. public List<PickUp> CristalsList;
  20. public List<PickUp> CandysList;
  21. public TriggerRollerActive TriggerRollerActive;
  22. public TriggerRollerDeactive TriggerRollerDeactive;
  23. public void Init()
  24. {
  25. UIManager.Instance.Camera.transform.SetParent(PivotCameraLevel);
  26. UIManager.Instance.Camera.transform.localPosition = Vector3.zero;
  27. }
  28. public void ResetFinishTrigger()
  29. {
  30. FinishTrigger.ResetAnimation();
  31. }
  32. public void ResetLever()
  33. {
  34. ResetFinishTrigger();
  35. ResetBallons();
  36. ResetHearth();
  37. ResetCandy();
  38. ResetCristals();
  39. ResetRock();
  40. TriggerRollerActive.ResetRolley();
  41. TriggerRollerDeactive.ResetRolley();
  42. }
  43. private void ResetBallons()
  44. {
  45. for(var i = 0; i< BaloonsList.Count;i++)
  46. {
  47. BaloonsList[i].ResetPickUp();
  48. }
  49. }
  50. private void ResetHearth()
  51. {
  52. for (var i = 0; i < HearthList.Count; i++)
  53. {
  54. HearthList[i].ResetPickUp();
  55. }
  56. }
  57. private void ResetCandy()
  58. {
  59. for (var i = 0; i < CandysList.Count; i++)
  60. {
  61. CandysList[i].ResetPickUp();
  62. }
  63. }
  64. private void ResetRock()
  65. {
  66. for (var i = 0; i < RocksList.Count; i++)
  67. {
  68. RocksList[i].ResetPickUp();
  69. }
  70. }
  71. private void ResetCristals()
  72. {
  73. for (var i = 0; i < CristalsList.Count; i++)
  74. {
  75. CristalsList[i].ResetPickUp();
  76. }
  77. }
  78. }