чё то чё то есть

This commit is contained in:
vladislove committed 2026-09-22 21:08:47 +03:00
1 parent f632508497
commit f12b4aef0d
14 files changed
+571 -97

No files matched your search

@@ -0,0 +1,65 @@
using System.Collections;
using UnityEngine;
using UnityEngine.UI;
namespace _Project.Scripts
{//Only for learning ideas
public class ColorChanger : MonoBehaviour
{
Coroutine coroutine;
Image image;
[SerializeField] GameObject target;
private Color prevColor;
[SerializeField] private float TimeForChange;
[SerializeField] private bool isStarted = false;
private bool isWorking = false;
[SerializeField]private bool isLooped = false;
void Start()
{
image = target.GetComponent<Image>();
prevColor = image.color;
}
void Update()
{
if (isStarted && !isWorking)
{
isStarted = false;
isWorking = true;
coroutine = StartCoroutine(ColorCoroutine());
}
}
IEnumerator ColorCoroutine()
{
do
{
float elapsedTime = 0f;
while (elapsedTime < TimeForChange)
{
image.color = Color.Lerp(prevColor, Color.clear, elapsedTime / TimeForChange);
elapsedTime += Time.deltaTime;
yield return null;
}
elapsedTime = 0f;
while (elapsedTime < TimeForChange)
{
elapsedTime += Time.deltaTime;
image.color = Color.Lerp(Color.clear, prevColor, elapsedTime / TimeForChange);
yield return null;
}
coroutine = null;
isWorking = false;
} while (isLooped);
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 8cf1795fc21943f48878d4a8f1b0a792
timeCreated: 1790073521
@@ -0,0 +1,17 @@
using UnityEngine;
public class GameBootstrapper : MonoBehaviour
{
private void Awake()
{
// 1. Принудительно отключаем вертикальную синхронизацию в коде
QualitySettings.vSyncCount = 0;
// 2. Разблокируем частоту кадров (убираем лок в 60 FPS)
// Можно поставить 300 (как fps_max 300 в CS) или -1 (без ограничений)
Application.targetFrameRate = 300;
// 3. Полноэкранный режим для минимального инпут-лага видеокарты
Screen.fullScreenMode = FullScreenMode.ExclusiveFullScreen;
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 8ed86d5f41017334ab4a96944ac06e99