Newer
Older
HardPoint-Project-Abertay-University-Unity3D / Assets / Scripts / Systems / RandomGeneration / RoomEntity.cs
@Rackday Rackday on 18 Aug 860 bytes Project Added
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class RoomEntity : MonoBehaviour
  5. {
  6. [HideInInspector]
  7. public ProgressController pc;
  8. [HideInInspector]
  9. public PlatformController platformController;
  10. [SerializeField]
  11. private bool contributesToProgress;
  12. private bool contributed = false;
  13. private void Start()
  14. {
  15. pc = transform.parent.GetComponent<ProgressController>();
  16. if(contributesToProgress)
  17. IncreaseTotalProgress();
  18. }
  19. public void IncreaseTotalProgress()
  20. {
  21. pc.AddToUpdatables(gameObject);
  22. pc.totalProgress += 1;
  23. }
  24. public void UpdateRoomInfo()
  25. {
  26. if(pc != null && !contributed)
  27. {
  28. if(contributesToProgress)
  29. pc.UpdateProgress();
  30. contributed= true;
  31. }
  32. }
  33. }