By default Unity doesn't serialize Dictionary, So it is not possible to show key/value pair directly in Unity3d inspector. But this can be achieved using some simple tweaks shown below,
using UnityEngine;
using System.Collections;
public class SoundManager : MonoBehaviour
public class AudioClip_Dir_Class
{
public string audioClipName;
public AudioClip audioClipvalue;
}
{
public AudioClip_Dir_Class []audioClip_Dir;
}
Alternatively you can also go with below one,
public List<string> keys = new List<string>();
public List<MyClass> values = new List<MyClass>();
private Dictionary<string,MyClass> dict;
Moreover you can use Extended Inspector available on asset store.
[System.Serializable]
ReplyDeletepublic class AudioClip_Dir_Class
{
public string audioClipName;
public AudioClip audioClipvalue;
}
This class should be marked with Serializable attribute. Main class already Serializable since it inherited from MonoBehaviour