Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

Search the Community

Showing results for tags 'frames'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • GENERAL
    • Introduce yourself
    • Discussions
    • Showcase
    • Need help?
    • Seeking team members?
    • Offtopic
  • RESOURCES
    • Example Projects
    • Scripts
    • Shaders
    • Unity Tutorials
    • FPS Kit Tutorials
    • 3D models
    • Animated 3D Models
    • Graphic design
    • Textures
    • Sounds
    • Other
  • SELL | REQUEST
    • Sell
    • Request
  • Mars' Modular Multiplayer Photon FPS Kit's Topics
  • Mars' Modular Multiplayer Photon FPS Kit's Reviews
  • Mars' Modular Multiplayer Photon FPS Kit's Updates
  • Mars' Modular Multiplayer Photon FPS Kit's Tutorials
  • Busy People's Introductions
  • Photon's Tutorials
  • Photon's Photon General
  • Photon's Showcase

Categories

  • Free Projects
  • Free Assets
  • Game Demos
  • Photon's Files

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


YouTube URL


Facebook URL


Twitter URL


IndieGoGo URL


Kickstarter URL


IndieDB URL


GreenLight URL


Location:


Interests

Found 1 result

  1. Here is guys the SMART FPS COUNTER Script... you are ready to say "just another script for counting fps, smart and bullsh*** The answer : It converts the float to int : if it is 61.33232 = 61 61.54634 = 62 59.93435 = 60 and it use color to declare if the fps is good example less than 30 = red equals to 30 or less than 40 = yellow greater than 40 = green also the fps do not refresh each frame but after 10 frames and it can be enabled/disabled by pressing ~ and the best .. its C# //Written by DarkStudio [Nightbird0] using UnityEngine; using System.Collections; public class SmartFPS : MonoBehaviour { private float frames; public GUIStyle style; private int fr; private int refresh; private bool isenabled = true; void Start() { style.fontSize = 20; } void Update() { if (Input.GetKeyDown(KeyCode.BackQuote)) { if (isenabled) isenabled = false; else isenabled = true; } if (isenabled) { refresh += 10; if (refresh >= 100) { if (Time.timeScale != 0) { frames = 1 / Time.deltaTime / Time.timeScale; fr = (int)Mathf.CeilToInt(frames); if (frames > 0 && frames < 30) { style.normal.textColor = Color.red; } else if (frames >= 30 && frames < 40) { style.normal.textColor = Color.yellow; } else if (frames >= 40) { style.normal.textColor = Color.green; } else { style.normal.textColor = Color.blue; } } refresh = 0; } } } void OnGUI() { if (isenabled) GUI.Label(new Rect(0, 0, 100, 20), "" + fr, style); } }
×
×
  • Create New...