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.

46 lines
950 B

  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. [CreateAssetMenu(menuName = "Major Project/Combined Block")]
  5. public class CombinedBlock : LogicBlock
  6. {
  7. #region Inspector Variables
  8. [SerializeField]
  9. [Tooltip("Blocks this will run through")]
  10. protected BlockReader blockReader;
  11. #endregion Inspector Variables
  12. #region Private Variables
  13. #endregion Private Variables
  14. public override bool Run(Character player)
  15. {
  16. BlockLogic(player);
  17. if (blockReader.Finished)
  18. {
  19. blockReader.Reset();
  20. RepeatCount++;
  21. }
  22. return isFinished();
  23. }
  24. protected override void BlockLogic(Character player)
  25. {
  26. blockReader.Read(player);
  27. }
  28. /// <summary>
  29. /// Resets the block to be ready to used again
  30. /// </summary>
  31. public override void Reset()
  32. {
  33. base.Reset();
  34. blockReader.Reset();
  35. }
  36. }