Operator cannot be applied to operands of type method group' and
string'とエラーが出ました。
該当コードは
using UnityEngine; using System.Collections; using UnityEngine.UI; public class GameDirector : MonoBehaviour { GameObject timerText; GameObject pointText; float time = 60.0f; int point =0; public void GetApple(){ this.point += 100; } public void GetBomb(){ this.point /= 2; } // Use this for initialization void Start () { this.timerText = GameObject.Find ("Time"); this.pointText = GameObject.Find ("Point"); } // Update is called once per frame void Update () { this.time -= Time.deltaTime; this.timerText.GetComponent<Text>().text= this.time.ToString("F1"); this.pointText.GetComponent<Text>().text= this.point.ToString + "point" ; } }
の
this.pointText.GetComponent<Text>().text= this.point.ToString + " point" ;
の部分です。ストリング型に+は使えないということですが
この部分は本の通りにそのまま作りました。
だからどこが間違っているのかわかりません。
Unityのことは全くわかりませんが、ひょっとして ToString -> ToString() ですか?
回答1件
あなたの回答
tips
プレビュー