Tis in the title.
Here is the script:
#pragma strict
var Combo1 : boolean;
var pipe : GameObject;
var mainCam : GameObject;
var mainCam2 : GameObject;
var m9 : GameObject;
function Start ()
{
pipe.GetComponent.().Play("Ready");
}
function Update () {
if (Input.GetKey("2")) {
Switch();
}
if (Input.GetButton("Fire1") && (!!Combo1)) {
pipe.GetComponent.().Play("Swing");
yield WaitForSeconds(0.5);
Combo1 = true;
yield WaitForSeconds(0.5);
Combo1 = false;
}
if (Input.GetButton("Fire1") && (!Combo1)) {
pipe.GetComponent.().Play("Swing2");
}
}
function Switch()
{
pipe.GetComponent.().Play("Rest");
yield WaitForSeconds(0.3);
m9.active = true;
pipe.active = false;
}
The animations disable scripts themselves at certan keyframes.
THIS IS USING UNITY 5 SCRIPT. It will be different from Unity4
↧