Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
649 B
1
Indexable
Never
using System.Collections;
using System.Collections.Generic;
using UnityEditor.Build.Content;
using UnityEngine;

public class DoorController : MonoBehaviour
{
	[SerializeField] private Animator ajto = null;
	[SerializeField] private bool openTrigger = false;
	[SerializeField] private bool closeTrigger = false;

	private void OnTriggerEnter(Collider other)
	{
		if (other.CompareTag("Player"))
		{
			if (openTrigger)
			{
				ajto.Play("AjtoKinyit", 0, 0.0f);
				gameObject.SetActive(false);
			}

			else if (closeTrigger)
			{
				ajto.Play("AjtoBezar", 0, 0.0f);
				gameObject.SetActive(false);
			}
		}
	}
}