Анимации ожидания в main
This commit is contained in:
parent
cb269cfa70
commit
6081db5b15
Binary file not shown.
8
Assets/Racing_Game/UI/MainUI/Animations/Camera.meta
Normal file
8
Assets/Racing_Game/UI/MainUI/Animations/Camera.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 02e42aa68a49ffe40b9d552c186984a1
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0e475b941203345428a8c460bc5f93a3
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 7400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5b3cf7e41a22e904c930fca6e6585282
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 7400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 64f540471671d3e4bbc9c15ed87ef659
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 9100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
76
Assets/TimerOnInactiveScript.cs
Normal file
76
Assets/TimerOnInactiveScript.cs
Normal file
@ -0,0 +1,76 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
public class TimerOnInactiveScript : MonoBehaviour
|
||||
{
|
||||
[SerializeField] float _ValueTargetTime = 30.0f;
|
||||
[SerializeField] private Animator _Animator;
|
||||
[SerializeField] GameObject _UIActive;
|
||||
[SerializeField] GameObject _UIInactive;
|
||||
|
||||
private float _TargetTime;
|
||||
|
||||
private bool _CanMoveFrom;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_CanMoveFrom = false;
|
||||
_TargetTime = _ValueTargetTime;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
_TargetTime -= Time.deltaTime;
|
||||
if (_TargetTime <= 0.0f)
|
||||
{
|
||||
//Debug.Log("Òàéìåð Çàêîí÷èëñÿ");
|
||||
_CanMoveFrom = true;
|
||||
MoveCameraToRound();
|
||||
}
|
||||
|
||||
if (Gamepad.current.wasUpdatedThisFrame)
|
||||
{
|
||||
//Debug.Log("êíîïêà íàæàòà");
|
||||
ResetTimer();
|
||||
MoveCameraFromRound();
|
||||
}
|
||||
}
|
||||
|
||||
void MoveCameraToRound()
|
||||
{
|
||||
_UIActive.SetActive(false);
|
||||
//Debug.Log("Ïåðåìåñòèëñÿ ê");
|
||||
_Animator.Play("MoveCameraToRound");
|
||||
|
||||
}
|
||||
|
||||
void MoveCameraFromRound()
|
||||
{
|
||||
if (_CanMoveFrom)
|
||||
{
|
||||
_UIInactive.SetActive(false);
|
||||
_Animator.Play("MoveCameraFromRound");
|
||||
//Debug.Log("Ïåðåìåñòèëñÿ îò");
|
||||
ResetTimer();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void SetActiveInactive()
|
||||
{
|
||||
|
||||
_UIInactive.SetActive(true);
|
||||
}
|
||||
|
||||
public void SetActiveActive()
|
||||
{
|
||||
|
||||
_UIActive.SetActive(true);
|
||||
}
|
||||
|
||||
void ResetTimer()
|
||||
{
|
||||
_TargetTime = _ValueTargetTime;
|
||||
}
|
||||
}
|
11
Assets/TimerOnInactiveScript.cs.meta
Normal file
11
Assets/TimerOnInactiveScript.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 078165a11ead93242a8bd350c42fb2db
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
x
Reference in New Issue
Block a user