Skip to content

Instantly share code, notes, and snippets.

@jplebre
Last active June 6, 2016 08:29
Show Gist options
  • Select an option

  • Save jplebre/4da4525d97bce79ee450b946a1fade4a to your computer and use it in GitHub Desktop.

Select an option

Save jplebre/4da4525d97bce79ee450b946a1fade4a to your computer and use it in GitHub Desktop.
How to have nested collections in Unity while picking them up in the inspector
using System;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class MaterialToSoundMapper : MonoBehaviour
{
public MAudio[] MaterialFootsteps;
}
[Serializable]
public class MAudio
{
public Material material;
public List<AudioClip> AudioClips;
}
@jplebre

jplebre commented Jun 6, 2016

Copy link
Copy Markdown
Author

Someone asked on twitter how to make a collection of footstep sounds per material, that can be editable in the Inspector
example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment