| | |
| | | using Assets.Scripts.Helpers; |
| | | using System; |
| | | using System.ComponentModel.Design; |
| | | using UnityEngine; |
| | |
| | | private float maxFallSpeedCurrent = 0f; |
| | | Vector2 moveInput; |
| | | |
| | | Rigidbody2D rb; |
| | | public Rigidbody2D rb; |
| | | Animator animator; |
| | | Animator animator_rotor; |
| | | public GameObject rotorGO; |
| | | TouchingDirections touchingDirections; |
| | | Damageable health; |
| | | public Damageable health; |
| | | |
| | | [SerializeField] |
| | | private bool _isMoving; |
| | |
| | | { |
| | | get |
| | | { |
| | | return animator.GetBool(AnimationStrings.canMove); |
| | | return animator.GetBool(AnimationStrings.canMove) && !PauseMenu.GameIsPaused; |
| | | } |
| | | } |
| | | |
| | |
| | | animator_rotor = rotorGO.GetComponent<Animator>(); |
| | | touchingDirections = GetComponent<TouchingDirections>(); |
| | | health = GetComponent<Damageable>(); |
| | | if (SaveSystem.isGameLoaded) |
| | | { |
| | | GameObject uiManager = GameObject.Find("UIManager"); |
| | | uiManager.GetComponent<UIManager>().GameLoaded(); |
| | | SaveData save = SaveSystem.LoadPlayer(); |
| | | health.MaxHealth = save.maxHealth; |
| | | health.Health = save.health; |
| | | transform.position = VectorHelper.ConvertToVector3(save.position); |
| | | rb.velocity = VectorHelper.ConvertToVector2(save.velocity); |
| | | SaveSystem.isGameLoaded = false; |
| | | } |
| | | } |
| | | |
| | | private void FixedUpdate() |
| | |
| | | } |
| | | } |
| | | |
| | | public void TakeDamage(int damage) |
| | | { |
| | | health.Hit(damage); |
| | | } |
| | | |
| | | public void TakeFallDamage(int fallDamage) |
| | | { |
| | | health.Hit(fallDamage); |
| | | TakeDamage(fallDamage); |
| | | } |
| | | |
| | | //public void OnRun(InputAction.CallbackContext context) |