UPF/Assets/NEW VFX TO CHECK/Particle Systems/_Common/Scripts/_Demo/FPSTest.cs

99 lines
2.3 KiB
C#

// =================================
// Namespaces.
// =================================
using UnityEngine;
// =================================
// Define namespace.
// =================================
namespace MirzaBeig
{
namespace ParticleSystems
{
namespace Demos
{
// =================================
// Classes.
// =================================
public class FPSTest : MonoBehaviour
{
// =================================
// Nested classes and structures.
// =================================
// ...
// =================================
// Variables.
// =================================
// ...
public int targetFPS1 = 60;
public int targetFPS2 = 10;
int previousVSyncCount;
// =================================
// Functions.
// =================================
// ...
void Awake()
{
}
// ...
void Start()
{
}
// ...
void Update()
{
if (Input.GetKey(KeyCode.Space))
{
Application.targetFrameRate = targetFPS2;
previousVSyncCount = QualitySettings.vSyncCount;
QualitySettings.vSyncCount = 0;
}
else if (Input.GetKeyUp(KeyCode.Space))
{
Application.targetFrameRate = targetFPS1;
QualitySettings.vSyncCount = previousVSyncCount;
}
}
// =================================
// End functions.
// =================================
}
// =================================
// End namespace.
// =================================
}
}
}
// =================================
// --END-- //
// =================================