1
\$\begingroup\$

I am just trying to generate a list from all animations within my Blender Asset file (see image)

enter image description here

This is what I have so far:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class DropDown : MonoBehaviour {

    public GameObject character;
    public Dropdown dropdown;

    // Use this for initialization
    void Start () {
        PopulateList();
    }

    void PopulateList(){
        // TODO: Read values from character
        List<string> names = new List<string>() { "idle", "cheering" , "jump" };
        dropdown.AddOptions(names);
    }
}

The character is the actual blender asset (base_character_29). The List names needs to be replaced with an array of my animations so I can populate a dropdown. I am using a humanoid rig so I am only having an "Animator" Component on my GameObject.

I appreciate any kind of help, thanks in advance!

\$\endgroup\$

0

You must log in to answer this question.

Browse other questions tagged .