12 第1页 | 共2 页下一页
返回列表 发新帖
查看: 5386|回复: 10
打印 上一主题 下一主题

[经验分享] unity3d动作事件运用(一)

[复制链接]

5552

主题

2

听众

8万

积分

首席设计师

Rank: 8Rank: 8

纳金币
-1
精华
11

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

跳转到指定楼层
楼主
发表于 2011-11-14 15:22:00 |只看该作者 |倒序浏览


           不错的英文教程,有源文件供下载,主要讲解unity3d动画事件的运用!
           

           I recently changed jobs a couple of months ago and have been pretty busy trying to get up to speed with it. I have been neglecting this blog for a while, which is something that I don’t like.
         

           For the Witch Training game I have been working on, the biggest thing that I am proud of myself right now is getting all of the controls about 90% done along with getting in the animation events to fire off walking***nning sounds.
         

           I wrote a post a little while ago on animation events describing what they are and how to do them in code. In the original article, I said how to just do it all in code because I don’t like the copying method. I firmly retract my statement and think that doing the copy method is the best way for looped animations. I did have to do some trickery to get it to work right though.
         

           If you can’t here it, there is sound effects for every footstep whether the witch is walking or***nning. The way I did it is the following.
         

           Animation States
           

           To create animation events for locked animations, the best way to add events is to duplicate the animation state. What does that mean? It means that you need to select the animation in your project window and go to Edit > Copy . See image below.
         

            
           








           Copying the animation from model
         

           The above image is the type of thing you want to copy. If you aren’t using the model in my project, Ramius is the character’s model I made in Blender3D. Unity will create all of these items based on your import settings. The animations were created in the import settings as well with the names you give them. Select the animation like above copy and paste it.
         

           The reason why you have to copy it is because the original walk animation is really just a dynamically created setting that Unity creates from the source file. You can’t edit or save it because it will constantly rebuild itself everytime you load new files or update anything. The only way to do anything with these files is duplicate them so there is a static version. You can do things like animation events at that point.
         

            
           






           Animation state copies sitting safely outside of the model
         

           Once you have the copy, you can add it to your animation state on your game object  in your animation component. Once you’ve added a animation component to your gameobject you want to animate, select the object you have your animation component on and add the new references to it. See below.
         




            
         

           I added the new***n and walk animations to the “Elements”. I do that by usually selecting one of the small “0&rime; on the right side of the image. You can select your duplicated animation state. With the game object still selected go to Window > Animation in the top toolbar to start setting points.
           








           Selecting animation state to add animation event
         

           You will see that when you choose which animation you want to edit, most of them will say “Read-Only”. This is because these animations are getting pulled from Blender,the 3d program I am using, to get this animation data. You can’t edit or add and save animation events with these.
         

           But that doesn’t matter since we already created a copy of what we want to use. You can see by the picture above that the***n and walk animations don’t have “Read-only”, since we duplicated them.
         

           Side Note: You must have your gameobject in the heirarchy selected to see your new animations with your object. If you select your 3d model in the project panel, your new animations won’t appear. This is because they aren’t linked to your model. That is what you were doing when you added them to the animation  component.
           

            
         
分享到: QQ好友和群QQ好友和群 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
转播转播0 分享淘帖0 收藏收藏0 支持支持0 反对反对0
回复

使用道具 举报

无效楼层,该帖已经被删除
无效楼层,该帖已经被删除

1023

主题

3

听众

359

积分

设计实习生

Rank: 2

纳金币
335582
精华
0

最佳新人

地板
发表于 2012-5-9 23:22:42 |只看该作者
不错哦,谢谢楼主
回复

使用道具 举报

tc    

5089

主题

1

听众

33万

积分

首席设计师

Rank: 8Rank: 8

纳金币
-1
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

5#
发表于 2012-8-15 23:44:03 |只看该作者
既来之,则看之!
回复

使用道具 举报

tc    

5089

主题

1

听众

33万

积分

首席设计师

Rank: 8Rank: 8

纳金币
-1
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

6#
发表于 2012-8-18 23:46:06 |只看该作者
楼主收集的可真全哦
回复

使用道具 举报

462

主题

1

听众

31万

积分

首席设计师

Rank: 8Rank: 8

纳金币
2
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

7#
发表于 2012-8-24 00:09:30 |只看该作者
你们都躲开,我来顶
回复

使用道具 举报

8#
无效楼层,该帖已经被删除
9#
无效楼层,该帖已经被删除
nts    

3

主题

1

听众

743

积分

初级设计师

Rank: 3Rank: 3

纳金币
7
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

10#
发表于 2013-10-17 10:46:48 |只看该作者
强大的文章,慢慢学习
回复

使用道具 举报

12 第1页 | 共2 页下一页
返回列表 发新帖
您需要登录后才可以回帖 登录 | 立即注册

手机版|纳金网 ( 闽ICP备2021016425号-2/3

GMT+8, 2024-11-17 20:41 , Processed in 0.209996 second(s), 29 queries .

Powered by Discuz!-创意设计 X2.5

© 2008-2019 Narkii Inc.

回顶部