map/Assets/FantasyEnvironments/Environments/Town/Scripts/Door.cs
2026-02-02 20:41:46 +09:00

30 lines
527 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Door : MonoBehaviour {
public Animator anim;
// Use this for initialization
void Start () {
anim = GetComponent<Animator> ();
}
void OnTriggerEnter (Collider other) {
anim.SetBool ("DoorOpen", true);
anim.SetBool ("DoorClose", false);
}
void OnTriggerExit (Collider other) {
anim.SetBool ("DoorOpen", false);
anim.SetBool ("DoorClose", true);
}
// Update is called once per frame
void Update () {
}
}