How to make an event fired when a clip of animation played over

How to make an event fired when a clip of animation played over
I mean,when the clip is playing,it could break into another clip at anypoint,
I want to fire an event when the clip has been finished playing,
(in the event, i want do do something,eg.adjust layer weight)

You can use animation event, simply create an animation event at the end of your clip which will call a function of your choice which should adjust the layer weight.

1 Like

Thanks ,U guy,But whe clip may not play over,it could be break out at some points before the end frame

In 4.x you have to monitor State change.
Use the following function to monitor state change and when your state info change it mean that the clip doesn’t play anymore.

If you are using 5.0 beta, you can use StateMachineBehaviour and simply override void OnStateExit() on the desire state.

Ok, that is it, thanks