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.

47 lines
1.0 KiB

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