j'ai une version de Unity 5 free avec MidiUnified et Playmaker, j'arrive à faire changer l'animation de mon personnage en passant par un script qui déclenche un trigger ou un bool de la fenêtre Animator mais je voudrais passer par Playmaker et du coup récupérer les éléments de mon message midi (canal, note, vélocité) dans des variables FSM de playmaker mais là je bloque complêtement!!!
Pourriez vous me filer un petit coup de main?
voici mon premier script qui déclenche un bool lorsque la note midi spécifié est jouée :
Code : Tout sélectionner
using UnityEngine;
using System.Collections;
using ForieroEngine.MIDIUnified;
using HutongGames.PlayMaker;
public class MusicCubetest2 : MonoBehaviour
{
public int midiIndex = 60;
Animator anim;
void Awake ()
{
MidiOut.ShortMessageEvent += ShortMessage;
anim = GetComponent<Animator> ();
}
void ShortMessage (int Command, int Data1, int Data2)
{
if (Command.ToMidiCommand () == 144 && Data1 == midiIndex) {
anim.SetBool ("Eye2", true);
}
if (Command.ToMidiCommand () == 128 && Data1 == midiIndex) {
anim.SetBool ("Eye2", false);
}
}
}