From 55a10addbd4d90448ec48c0993cce3df464f04b2 Mon Sep 17 00:00:00 2001 From: excitedneon Date: Sun, 14 May 2017 21:51:50 +0300 Subject: [PATCH] Fix namespace definition and docs --- Assets/Scripts/Console/DebugConsole.cs | 1 + Assets/Scripts/Util/FontUtil.cs | 28 +++++++++++++++++++------- Assets/Scripts/Util/MeshDB.cs | 5 +++++ 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/Assets/Scripts/Console/DebugConsole.cs b/Assets/Scripts/Console/DebugConsole.cs index 8d0cc41..a9d2eda 100644 --- a/Assets/Scripts/Console/DebugConsole.cs +++ b/Assets/Scripts/Console/DebugConsole.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.RegularExpressions; using UnityEngine; using UnityEngine.UI; +using Cyber.Util; namespace Cyber.Console { diff --git a/Assets/Scripts/Util/FontUtil.cs b/Assets/Scripts/Util/FontUtil.cs index 06c10df..32a6c06 100644 --- a/Assets/Scripts/Util/FontUtil.cs +++ b/Assets/Scripts/Util/FontUtil.cs @@ -2,11 +2,25 @@ using System.Collections.Generic; using UnityEngine; -public class FontUtil : MonoBehaviour { - public static float GetCharacterWidth(Font font, int fontSize, FontStyle fontStyle) { - CharacterInfo CharInfo; - font.RequestCharactersInTexture("W", fontSize, fontStyle); - font.GetCharacterInfo('W', out CharInfo, fontSize, fontStyle); - return CharInfo.glyphWidth - 1; +namespace Cyber.Util { + + /// + /// Conjures useful information about fonts. + /// + public class FontUtil : MonoBehaviour { + + /// + /// Gets the width of the character. + /// + /// The character width. + /// Font. + /// Font size. + /// Font style. + public static float GetCharacterWidth(Font font, int fontSize, FontStyle fontStyle) { + CharacterInfo CharInfo; + font.RequestCharactersInTexture("W", fontSize, fontStyle); + font.GetCharacterInfo('W', out CharInfo, fontSize, fontStyle); + return CharInfo.glyphWidth - 1; + } } -} +} \ No newline at end of file diff --git a/Assets/Scripts/Util/MeshDB.cs b/Assets/Scripts/Util/MeshDB.cs index a8af146..e034dfa 100644 --- a/Assets/Scripts/Util/MeshDB.cs +++ b/Assets/Scripts/Util/MeshDB.cs @@ -23,6 +23,11 @@ namespace Cyber.Util { Singleton = this; } + /// + /// Get the mesh at the defined index. + /// + /// The mesh. + /// Index. public static Mesh GetMesh(int index) { return Singleton.Meshes[index]; }