...la suite de mes aventures....
J'ai un script qui contrôle une animation pour une RA-Vuforia.
Grâce à l'aide des forumers (et de ma¨ître boubouk50), j'ai pu y adjoindre le contrôle d'un élément sonore.
Ma nouvelle demande consiste à ce que ce script contrôle en plus de l'animation et du son, un particle system.
Ci dessous mon script actuel:
Code : Tout sélectionner
using UnityEngine;
using System.Collections;
public class ControlAnimSound : MonoBehaviour {
private Animation anim;
public AudioSource audioSource;
void Start() {
anim = GetComponent<Animation> ();
}
void OnGUI () {
if (GUI.Button (new Rect (25, 25, 100, 30), "Play")) {
anim.wrapMode = WrapMode.Default;
anim.Play();
audioSource.Play();
}
if (GUI.Button (new Rect (25, 75, 100, 30), "Stop")) {
anim.Stop();
audioSource.Stop();
}
if (GUI.Button (new Rect (25, 175, 100, 30), "Quitter")) {
audioSource.Stop();
Application.Quit ();
}
}
}