-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
110 changed files
with
4,588 additions
and
1,615 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions
6
.../Runtime/Shaders/OutlinePass2.shader.meta → Outline.Core/Assets/Common.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// Copyright (C) 2018-2020 Digimation. All rights reserved. | ||
// See the LICENSE.md file in the project root for more information. | ||
|
||
using System; | ||
using UnityEngine; | ||
|
||
/// <summary> | ||
/// An FPS counter. | ||
/// </summary> | ||
/// <seealso href="https://wiki.unity3d.com/index.php/FramesPerSecond"/> | ||
public class FpsCounter : MonoBehaviour | ||
{ | ||
private const float _updateInterval = 0.5F; | ||
|
||
private float _accum; | ||
private int _frames; | ||
private float _timeleft; | ||
private float _fps; | ||
|
||
public float Fps => _fps; | ||
|
||
public static void RenderFps(float fps, string s, Rect rc) | ||
{ | ||
var text = string.Format("{0}: {1:F2}", s, fps); | ||
|
||
if (fps < 10) | ||
{ | ||
GUI.color = Color.red; | ||
} | ||
else if (fps < 30) | ||
{ | ||
GUI.color = Color.yellow; | ||
} | ||
else | ||
{ | ||
GUI.color = Color.green; | ||
} | ||
|
||
GUI.Label(rc, text); | ||
} | ||
|
||
private void OnEnable() | ||
{ | ||
_accum = 0; | ||
_frames = 0; | ||
_timeleft = 0; | ||
_fps = 0; | ||
} | ||
|
||
private void Update() | ||
{ | ||
_timeleft -= Time.deltaTime; | ||
_accum += Time.timeScale / Time.deltaTime; | ||
|
||
++_frames; | ||
|
||
if (_timeleft <= 0.0) | ||
{ | ||
_fps = _accum / _frames; | ||
_timeleft = _updateInterval; | ||
_accum = 0.0F; | ||
_frames = 0; | ||
} | ||
} | ||
|
||
private void OnGUI() | ||
{ | ||
RenderFps(_fps, "FPS", new Rect(Screen.width - 80, 0, 80, 20)); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...itor/Scripts/OutlineRendererTests.cs.meta → ...ine.Core/Assets/Common/FpsCounter.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 0 additions & 88 deletions
88
Outline.Core/Assets/Examples/SimplePerCamera/OutlineEffectBuilder.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.