top of page
搜尋
  • 601746725

Pure Card Game Dev log (2): Animations


For this prototype, I'm using Prototype Hero created by Sven Thole.

Here's the link provided.



First, a good convention is cloning from the origin animator. Then open it and work on your own.


For example. When you click on a line between "Jump" and "JumpToFall". You'll see the transition time. and there's the condition below, showing that if bool variable "Fall" is equal to "true", will this transition trigger.


The variable are acutally not declared in our code. Instead, it's declared within the animator. However, we can call those variables from our code.




For example, in the Player Move action. You can invoke those transitions by calling method "SetInteger", "SetTrigger" to set the variables that declared in your animators.


Animation Events:

Not only do we have the function to call animations and transitions by code, we can also let our code be called by animations, via clicking "add animation events". It'll add a time stamp to your specific time frame.


For example, in this demo, we can add a function in our code "AE_SwordAttack"






Then in the "Animation" tab, we can add an animation event at time frame 0:01, naming it "AE_SwordAttack".



In the inspector, you can see the event can pass parameters such as float, int, string, or event objects.











In this way, we you play this animation, at the time "0:01", the function will be called, to play a piece of sound.

3 次查看0 則留言

最新文章

查看全部
文章: Blog2 Post
bottom of page