个人对unity inspector面板中不显示二维数组的解决方法
2015-09-19 11:44
4714 查看
在学习unity 时遇到inspector面板无法显示二维数组是令人头疼的一件事,网上找了资料,有人认为要自己写一个编辑器布局,但这种方法有点麻烦,于是就找到另一种方法:
using UnityEngine;
using System.Collections;
public class GameManager : MonoBehaviour {
public CustomArrays[]
Arrays;
}
[System.Serializable]
public class CustomArrays
{
public float[]
Array;
public float this[int index]
{
get
{
return
Array[index];
}
}
public CustomArray()
{
this.Array= new float[4];
}
public CustomArray(int index)
{
this.Array= new float[index];
}
}
using UnityEngine;
using System.Collections;
public class GameManager : MonoBehaviour {
public CustomArrays[]
Arrays;
}
[System.Serializable]
public class CustomArrays
{
public float[]
Array;
public float this[int index]
{
get
{
return
Array[index];
}
}
public CustomArray()
{
this.Array= new float[4];
}
public CustomArray(int index)
{
this.Array= new float[index];
}
}
相关文章推荐
- unity3d模仿魔兽世界鼠标对游戏操作
- Immunity1.85 新增API
- Unity 3DC#语法基本知识点
- Unity3D和Android交互(Android调用Unity的场景)
- Vuforia SDK----从Unity的SD卡装入一个DataSet
- Unity_酷炫塔防插件TDTK(一)
- 于Unity3D调用安卓AlertDialog
- unity3d 免费好用的数据库处理框架 数据库直连框架
- unity的forward rendering 中光源的使用和light的render mode
- Unity脚本中使用NGUI的预先准备
- 【unity-lua】笔记(备忘)
- Unity3D for Android 纹理压缩支持
- Ogre中四元数与三维向量(Unity3D异曲同工)
- Unity将来时:IL2CPP是什么?
- Unity开发shader中要用到的内置状态变量
- unity3d 在UGUI中制作自适应调整大小的滚动布局控件
- unity3d 中进行安卓版本的发布
- Default clip could not be found in attached animations list
- Unity3D Resources TextAsset 正文
- unity3d实现插件快速开发对话系统