Animation (*.anim)

Hi,

I made a little one-minute film on the disassembly of a PC: VUEDEHAUT - L'univers Prise De Vue Aerienne..

This “film” contains 12 animations (. anim) for parts of the PC + 1 for the main camera, not using SRIPT, but using only the curves of the windows animation files (. anim ).

I should have thought before, but now I want to start all with a button.

My question is: Is it possible to order by Script (js) all my animations?

Philippe

current script only works for the animation of the camera?

var beep : AudioClip;

animation.Stop();

function OnGUI () {

	var ScreenX=Screen.width-90; 	
	var ScreenY=Screen.height-135;		

	GUILayout.BeginArea (Rect(ScreenX,ScreenY,70,125));

	if (GUILayout.Button("Auto")){
		
		audio.PlayOneShot(beep);
		animation.Play("0 Animation Camera1");
		animation.Play("1 Animation Capot");
		animation.Play("2 Animation Alim");
		animation.Play("3 Animation driveHDD");
		animation.Play("4 Animation driveSSD");
		animation.Play("5 Animation DVD");
		animation.Play("6 Animation CG");
		animation.Play("7 Animation Coeur");
		animation.Play("8 Animation ventirad");
		animation.Play("9 Animation RAM1");
		animation.Play("10 Animation RAM2");
		animation.Play("11 Animation RAM3");
		animation.Play("12 Animation i920");
	}

	if (GUILayout.Button("Manuel")){
		print ("Bouton Manuel");	
		audio.PlayOneShot(beep);
	}

	if (GUILayout.Button("RAZ")){
		
		audio.PlayOneShot(beep);
		animation.Stop("0 Animation Camera1");
		animation.Stop("1 Animation Capot");
		animation.Stop("2 Animation Alim");
		animation.Stop("3 Animation driveHDD");
		animation.Stop("4 Animation driveSSD");
		animation.Stop("5 Animation DVD");
		animation.Stop("6 Animation CG");
		animation.Stop("7 Animation Coeur");
		animation.Stop("8 Animation ventirad");
		animation.Stop("9 Animation RAM1");
		animation.Stop("10 Animation RAM2");
		animation.Stop("11 Animation RAM3");
		animation.Stop("12 Animation i920");
	}
	
	if (GUILayout.Button("Com'3D")){
		print ("Bouton Web");
		audio.PlayOneShot(beep);
		Application.OpenURL ("http://www.com3d.fr/");
	}

	if (GUILayout.Button("Quitter")){
		audio.PlayOneShot(beep);
		Application.Quit();
	}

	GUILayout.EndArea();
}

@script RequireComponent (AudioSource)

'Course it is.

var animations : String[];

function PlayAnimationsInOrder() {
  for ( var s in animations ) {
    animation.PlayQueued( s );
  }
}

function Stop() {
  animation.Stop();
}

(What you’re doing is playing them all at once; the one with highest priority will be the only one playing.)

Hi,
Thank you for this method.
It is possible that I did not understand how to apply this method because it does not work.
But I just realized something, if I want to trigger animations with the script.
Currently, all my animations are 60 seconds, even if some have their event at the end of 50 seconds …
I’m going to reduce all the animations to the “event” in script and order their actions and their durations.
It is perhaps here that my method blocks?
Philippe

Hi,
I want to achieve something similar to this but each animation should run in a sequence on each button click like a video player with play, pause, next and previous. I have functional implementation for this using if else but dont thing its feasible for 30 more animation.

public void nextSq()
{

if (CPU_Model.GetCurrentAnimatorStateInfo(0).IsName(“Parent_1”))
{

CPU_Model.Play(“Parent_2”, -1, 0f);
CPU_Model.speed = 0.25f;
}

else if (CPU_Model.GetCurrentAnimatorStateInfo(0).IsName(“Parent_2”))
{

CPU_Model.Play(“Parent_3”, -1, 0f);
CPU_Model.speed = 0.25f;
}
else if (CPU_Model.GetCurrentAnimatorStateInfo(0).IsName(“Parent_3”))
{

CPU_Model.Play(“Parent_4”, -1, 0f);
CPU_Model.speed = 0.25f;
}

}

If you have any idea please guide