rabidus-test/Assets/Scripts/CutsceneLookAt.cs

27 lines
595 B
C#
Raw Normal View History

2023-09-11 15:44:17 +03:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CutsceneLookAt : MonoBehaviour
{
private Animator _animator;
2023-10-02 19:12:35 +03:00
[SerializeField] private Transform _carier;
[SerializeField] private string _animation;
2023-10-21 11:36:49 +03:00
[SerializeField] private EndGameModule _gameModule;
2023-09-11 15:44:17 +03:00
private void Awake()
{
_animator = GetComponent<Animator>();
}
public void StartCutscene()
{
2023-09-18 20:09:22 +03:00
_animator.Play(_animation);
2023-10-02 19:12:35 +03:00
_carier.parent = transform;
2023-09-11 15:44:17 +03:00
}
2023-10-21 11:36:49 +03:00
public void StopCutscene()
{
_gameModule.ShowEndMenu(true);
}
2023-09-11 15:44:17 +03:00
}