H.Pなどの情報表示

「H.Pなどの情報表示」の編集履歴(バックアップ)一覧に戻る

H.Pなどの情報表示 - (2015/05/26 (火) 19:03:39) のソース

hpというobjectをキャラの子供に配置しておく
3Dtextも子どもとして配置しておく

 private void HPboard()
 {
   GameObject childObject = gameObject.transform.FindChild("hp").gameObject;
   childObject.transform.localScale = new Vector3( (float)hp/hpMax, 0.1f, 0.01f);
   childObject = gameObject.transform.FindChild("exp").gameObject;

   string temp = "#" + no + " "+status+"\nhp"+hp+" exp" + exp;

   if (eval >= 3f)
     temp += " 脅威";
   childObject.GetComponent<TextMesh> ().text = temp;
 }