Fps counter for editor & builds
This commit is contained in:
parent
67fb0cbba4
commit
b8cd4c1388
@ -1116,6 +1116,50 @@ MonoBehaviour:
|
|||||||
- {fileID: 4534840833812050506}
|
- {fileID: 4534840833812050506}
|
||||||
- {fileID: 8394233754574761252}
|
- {fileID: 8394233754574761252}
|
||||||
GameOptionsUI: {fileID: 3456748640505479282}
|
GameOptionsUI: {fileID: 3456748640505479282}
|
||||||
|
--- !u!1 &4251882848588872769
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 5367955312913647889}
|
||||||
|
- component: {fileID: 3387936705118306209}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: FPS Counter
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &5367955312913647889
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 4251882848588872769}
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 7475116342638198534}
|
||||||
|
m_RootOrder: 23
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!114 &3387936705118306209
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 4251882848588872769}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: d9815cca592bf9d44a1813123eedecaf, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
--- !u!1 &5057941381125395910
|
--- !u!1 &5057941381125395910
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -3441,6 +3485,7 @@ Transform:
|
|||||||
- {fileID: 9185201680463777955}
|
- {fileID: 9185201680463777955}
|
||||||
- {fileID: 6180095685914955686}
|
- {fileID: 6180095685914955686}
|
||||||
- {fileID: 6635204016449054619}
|
- {fileID: 6635204016449054619}
|
||||||
|
- {fileID: 5367955312913647889}
|
||||||
m_Father: {fileID: 7475116341965418816}
|
m_Father: {fileID: 7475116341965418816}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 0
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
22
Assets/Scripts/FPSCounter.cs
Normal file
22
Assets/Scripts/FPSCounter.cs
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
|
public class FPSCounter : MonoBehaviour
|
||||||
|
{
|
||||||
|
private float count;
|
||||||
|
|
||||||
|
private IEnumerator Start()
|
||||||
|
{
|
||||||
|
GUI.depth = 2;
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
count = 1f / Time.unscaledDeltaTime;
|
||||||
|
yield return new WaitForSeconds(0.1f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnGUI()
|
||||||
|
{
|
||||||
|
GUI.Label(new Rect(5, 40, 100, 25), "FPS: " + Mathf.Round(count));
|
||||||
|
}
|
||||||
|
}
|
11
Assets/Scripts/FPSCounter.cs.meta
Normal file
11
Assets/Scripts/FPSCounter.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d9815cca592bf9d44a1813123eedecaf
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -11,6 +11,8 @@ public class GameOptionsController : MonoBehaviour
|
|||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
GameOptionsUI.SetActive(false);
|
GameOptionsUI.SetActive(false);
|
||||||
|
|
||||||
|
QualitySettings.vSyncCount = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
|
@ -94,7 +94,7 @@ Material:
|
|||||||
- _Mode: 0
|
- _Mode: 0
|
||||||
- _OcclusionStrength: 1
|
- _OcclusionStrength: 1
|
||||||
- _Parallax: 0.02
|
- _Parallax: 0.02
|
||||||
- _Rotation: 9.336136
|
- _Rotation: 8.693292
|
||||||
- _SmoothnessTextureChannel: 0
|
- _SmoothnessTextureChannel: 0
|
||||||
- _SpecularHighlights: 1
|
- _SpecularHighlights: 1
|
||||||
- _SrcBlend: 1
|
- _SrcBlend: 1
|
||||||
|
File diff suppressed because one or more lines are too long
@ -134,7 +134,7 @@ PlayerSettings:
|
|||||||
16:10: 1
|
16:10: 1
|
||||||
16:9: 1
|
16:9: 1
|
||||||
Others: 1
|
Others: 1
|
||||||
bundleVersion: 0.7.7
|
bundleVersion: 0.7.8
|
||||||
preloadedAssets: []
|
preloadedAssets: []
|
||||||
metroInputSource: 0
|
metroInputSource: 0
|
||||||
wsaTransparentSwapchain: 0
|
wsaTransparentSwapchain: 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user