53 lines
1.0 KiB
C#
53 lines
1.0 KiB
C#
using System.Collections;
|
|
using UnityEngine;
|
|
using UnityEngine.SceneManagement;
|
|
using UnityEngine.Video;
|
|
|
|
public class PresentScene : MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
private VideoPlayer videoPlayer;
|
|
|
|
[SerializeField]
|
|
private Animator gameLogoAnimator;
|
|
|
|
[SerializeField]
|
|
private Animator reelAnimator;
|
|
|
|
private bool isSkiped;
|
|
|
|
private void Start()
|
|
{
|
|
videoPlayer.loopPointReached += CheckOver;
|
|
QualitySettings.vSyncCount = 0;
|
|
Application.targetFrameRate = 120;
|
|
gameLogoAnimator.SetTrigger("Start");
|
|
reelAnimator.SetTrigger("Handle");
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
if ((GameManager.Instance.player.GetButtonDown("MouseClick") || GameManager.Instance.player.GetButtonDown("LMB")) && !isSkiped)
|
|
{
|
|
videoPlayer.Stop();
|
|
StartCoroutine(LoadStartSceneY());
|
|
isSkiped = true;
|
|
}
|
|
}
|
|
|
|
private void CheckOver(VideoPlayer vp)
|
|
{
|
|
}
|
|
|
|
private IEnumerator LoadStartSceneY()
|
|
{
|
|
yield return null;
|
|
LoadStartScene();
|
|
}
|
|
|
|
public void LoadStartScene()
|
|
{
|
|
SceneManager.LoadSceneAsync("Startowa", LoadSceneMode.Single);
|
|
}
|
|
}
|