Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var framesPerSecond = 60.0;
- var index : int;
- var Fightanim : Object[];
- var fightPlay = false;
- function Start(){
- Fightanim = Resources.LoadAll("Fight", Texture2D);
- }
- function Update () {
- DoPlay();
- }
- function DoPlay(){
- if(fightPlay == true){
- fightAnimShow();
- }
- }
- function fightAnimShow(){
- index = Time.time * framesPerSecond;
- index = index % Fightanim.Length;
- renderer.material.mainTexture = Fightanim[index] as Texture2D;
- yield WaitForSeconds (0.1);
- if (index > Fightanim.length-2)
- fightPlay = false;
- }
Advertisement
Add Comment
Please, Sign In to add comment