Files
Two-World/Assets/Cainos/Pixel Art Platformer - Village Props/Script/Chest.cs
2025-05-08 16:03:30 +09:00

38 lines
928 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Cainos.LucidEditor;
namespace Cainos.PixelArtPlatformer_VillageProps
{
public class Chest : MonoBehaviour
{
[FoldoutGroup("Reference")]
public Animator animator;
[FoldoutGroup("Runtime"), ShowInInspector, DisableInEditMode]
public bool IsOpened
{
get { return isOpened; }
set
{
isOpened = value;
animator.SetBool("IsOpened", isOpened);
}
}
private bool isOpened;
[FoldoutGroup("Runtime"),Button("Open"), HorizontalGroup("Runtime/Button")]
public void Open()
{
IsOpened = true;
}
[FoldoutGroup("Runtime"), Button("Close"), HorizontalGroup("Runtime/Button")]
public void Close()
{
IsOpened = false;
}
}
}