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.

27 lines
663 B

  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. /// <summary>
  5. /// Logic block which deals with moving a character in a direction
  6. /// </summary>
  7. [CreateAssetMenu(menuName = "Major Project/Move Block")]
  8. public class Move : LogicBlock
  9. {
  10. [SerializeField]
  11. protected Direction direction = Direction.Forward;
  12. #region Class Functions
  13. /// <summary>
  14. /// Implementation of BlockLogic, moves the player forward
  15. /// </summary>
  16. /// <param name="player">Player to move</param>
  17. protected override void BlockLogic(Character player)
  18. {
  19. player.Move(direction);
  20. }
  21. #endregion Class Functions
  22. }