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,11 +2,25 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
public class FontUtil : MonoBehaviour {
|
namespace Cyber.Util {
|
||||||
public static float GetCharacterWidth(Font font, int fontSize, FontStyle fontStyle) {
|
|
||||||
CharacterInfo CharInfo;
|
/// <summary>
|
||||||
font.RequestCharactersInTexture("W", fontSize, fontStyle);
|
/// Conjures useful information about fonts.
|
||||||
font.GetCharacterInfo('W', out CharInfo, fontSize, fontStyle);
|
/// </summary>
|
||||||
return CharInfo.glyphWidth - 1;
|
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) {
|
||||||
|
CharacterInfo CharInfo;
|
||||||
|
font.RequestCharactersInTexture("W", fontSize, fontStyle);
|
||||||
|
font.GetCharacterInfo('W', out CharInfo, fontSize, fontStyle);
|
||||||
|
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