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.

31 lines
810 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/Rotate Block")]
  8. public class Rotate : LogicBlock
  9. {
  10. #region Inspector Fields
  11. [SerializeField]
  12. [Header("Rotate Settings")]
  13. [Tooltip("Direction to rotate in")]
  14. protected Direction direction;
  15. #endregion Inspector Fields
  16. #region Class Functions
  17. /// <summary>
  18. /// Rotates the player in the direction specified by this block
  19. /// </summary>
  20. /// <param name="player">Player to rotate</param>
  21. protected override void BlockLogic(Character player, float animationTime)
  22. {
  23. player.Rotate(direction);
  24. }
  25. #endregion Class Functions
  26. }