public static void CreateVT(string text, Transform location, Color textColour) { VariableText vt = Instantiate(m_VT); Vector2 screenPosition = Camera.main.WorldToScreenPoint(location.position); vt.transform.SetParent(GameObject.Find("Canvas").transform, false); vt.transform.position = screenPosition; vt.SetText(text); vt.SetColor(textColour); }
/// <summary> /// 変数で初期化 /// </summary> /// <param name="key">変数を生成するためのキー</param> /// <param name="val">変数文字列生成用の関数</param> public StringVariableFormat(string key, VariableText val) { _key = key; _val = val; }
/// <summary> /// 定数で初期化 /// </summary> /// <param name="fix"></param> public StringVariableFormat(string fix) { _key = fix; _val = null; }
public static void Initialize() { m_VT = Resources.Load <VariableText>("Prefabs/VTextParent"); }