本文介绍了这段代码有什么问题??!?!?!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 使用System.Collections; 使用System.Collections.Generic; 使用UnityEngine; 公共类检测碰撞:MonoBehaviour { $     private var score:int = 0;     var guiScore:GUIText;    功能开始() {     guiScore.text ="得分:0" ;; } 函数更新() { b $ b $ } 函数OnCollisionEnter(Col:Collision) {     if(col.gameObject.name ==" Pill")     {        得分+ = 5;         guiScore.text ="得分:" +分数;        打印("与药丸碰撞");¥b $ b    } } }using System.Collections;using System.Collections.Generic;using UnityEngine;public class Detection collision : MonoBehaviour {    private var score: int = 0;    var guiScore: GUIText;    function Start(){    guiScore.text = "Score: 0";}function Update(){}function OnCollisionEnter(Col : Collision){    if (col.gameObject.name == "Pill")    {        score += 5;        guiScore.text = "Score: " + score;        print("collide with Pill");    }}}推荐答案 我认为  guiScore.text ="得分:" +得分;得分为int且会有"得分:"+得分.ToString();score is int and there would be "Score: "+score.ToString();可能您是否获得了有关某些错误的更多信息?Could you get more information about some error or something? 这篇关于这段代码有什么问题??!?!?!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
07-21 01:10
查看更多