精品偷拍一区二区三区,亚洲精品永久 码,亚洲综合日韩精品欧美国产,亚洲国产日韩a在线亚洲

  • <center id="usuqs"></center>
  • 
    
  • C#IndexOutOfRangeException:Array index is out of range怎么解決

    C#IndexOutOfRangeException:Array index is out of range怎么解決
    using UnityEngine;
    using System.Collections;
    public class script_10_03 :MonoBehaviour {
    \x05Object[] texmube;
    \x05int number=1;
    \x05
    \x05// Use this for initialization
    \x05void Start () {
    \x05texmube=Resources.LoadAll("Texture");
    \x05}
    \x05void OnGUI(){
    \x05\x05DrawImageNumber(0,100,number,texmube);}
    \x05void DrawImageNumber(int x,int y,int number,Object[] texmube)
    \x05{char[] chars=number.ToString().ToCharArray();
    \x05\x05Texture2D tex=(Texture2D)texmube[0];
    \x05\x05int width=tex.width;
    \x05\x05int height=tex.height;
    \x05\x05foreach(char s in chars)
    \x05\x05{int i=int.Parse(s.ToString());
    \x05\x05\x05GUI.DrawTexture(new Rect(x,0,width,height),(Texture2D)texmube[i]);
    \x05\x05\x05x+=width;
    \x05\x05}}
    \x05// Update is called once per frame
    \x05void Update () {
    \x05
    \x05}
    }
    其他人氣:312 ℃時間:2020-06-15 21:06:39
    優(yōu)質(zhì)解答
    OnGUI()方法里面沒有對于texmube是不是為空的判斷或者是不是有100的長度.
    我來回答
    類似推薦
    請使用1024x768 IE6.0或更高版本瀏覽器瀏覽本站點(diǎn),以保證最佳閱讀效果。本頁提供作業(yè)小助手,一起搜作業(yè)以及作業(yè)好幫手最新版!
    版權(quán)所有 CopyRight © 2012-2024 作業(yè)小助手 All Rights Reserved. 手機(jī)版