言語: 日本語
  • C#
  • JS
  • Boo

スクリプト言語

お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。

Font.HasCharacter

public function HasCharacter(c: char): bool;

Description

フォントが特定の文字列を扱えるかを判断します

	// Detects if the current font of a 3D text
	// supports '-' sign
	private var t : TextMesh;
	function Start() {
		t = transform.GetComponent(TextMesh);
		if (t.font.HasCharacter("-"[0])) {
			Debug.Log("Font supports '-' sign.");
		} else {
			Debug.LogWarning("This font doesnt support '-'");
		}
	}