Fix namespace definition and docs
This commit is contained in:
parent
cca48d095d
commit
55a10addbd
@ -4,6 +4,7 @@ using System.Collections.Generic;
|
|||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
using Cyber.Util;
|
||||||
|
|
||||||
namespace Cyber.Console {
|
namespace Cyber.Console {
|
||||||
|
|
||||||
|
@ -2,7 +2,20 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Cyber.Util {
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Conjures useful information about fonts.
|
||||||
|
/// </summary>
|
||||||
public class FontUtil : MonoBehaviour {
|
public class FontUtil : MonoBehaviour {
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the width of the character.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>The character width.</returns>
|
||||||
|
/// <param name="font">Font.</param>
|
||||||
|
/// <param name="fontSize">Font size.</param>
|
||||||
|
/// <param name="fontStyle">Font style.</param>
|
||||||
public static float GetCharacterWidth(Font font, int fontSize, FontStyle fontStyle) {
|
public static float GetCharacterWidth(Font font, int fontSize, FontStyle fontStyle) {
|
||||||
CharacterInfo CharInfo;
|
CharacterInfo CharInfo;
|
||||||
font.RequestCharactersInTexture("W", fontSize, fontStyle);
|
font.RequestCharactersInTexture("W", fontSize, fontStyle);
|
||||||
@ -10,3 +23,4 @@ public class FontUtil : MonoBehaviour {
|
|||||||
return CharInfo.glyphWidth - 1;
|
return CharInfo.glyphWidth - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
@ -23,6 +23,11 @@ namespace Cyber.Util {
|
|||||||
Singleton = this;
|
Singleton = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get the mesh at the defined index.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>The mesh.</returns>
|
||||||
|
/// <param name="index">Index.</param>
|
||||||
public static Mesh GetMesh(int index) {
|
public static Mesh GetMesh(int index) {
|
||||||
return Singleton.Meshes[index];
|
return Singleton.Meshes[index];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user