Files
Gnome-s-Bounty/Assets/Scripts/EnvironmentObjects/Door.cs
T
vova 7579175d24 Refactor and reorganize scripts for improved structure and functionality
- Removed obsolete scripts: Chest, BreakableWall, Door, DoorInteract, and UiManager.
- Moved Chest and BreakableWall scripts to EnvironmentObjects folder.
- Introduced HammerThrower class to manage hammer throwing mechanics.
- Updated PlayerController to utilize new InputManager and HammerThrower.
- Refactored PlayerState to manage player state and item collection.
- Enhanced UI management in UiManager to reflect player item collection.
- Updated EnemyAI to remove unused movement logic.
- Adjusted KeyChest to interact with PlayerState instead of Player.
- Cleaned up code and improved event handling for item collection.
2026-06-05 14:33:20 +03:00

18 lines
369 B
C#

using Assets.Scripts;
using UnityEngine;
public class Door : MonoBehaviour,IDoor
{
[SerializeField]
private Sprite _openDoor;
public void OpenDoor()
{
//PlayOpenAnimation
GetComponentInChildren<SpriteRenderer>().sprite= _openDoor;
//Disable box collider
gameObject.GetComponent<BoxCollider2D>().enabled=false;
}
}