Coder Social home page Coder Social logo

eam_unityanim's Introduction

##Unity中的动画

###1.普通Animation动画

Animation界面:

备注:

录制模式的红点,开启后为开启关键帧录制模式: 这个模式下,改变当前物体的属性(如场景里拖拽改变位置属性),会直接在当前帧的动画数据中记录该属性值,作为动画中当前帧的物体状态;而未开启该模式这不会自动记录在动画里。

底部的Dopesheet为关键帧,Curves为动画曲线(可以调整动画加速度)。


###2.UGUI的按钮动画

Button的Animation切换模式

用于按钮的点击或者选择动画。

选择Animation后,选择自动生成动画(Unity2017),然后会自动生成AnimatorController和四个状态的动画。可设置正常、悬浮、按下、禁用(Button设置为Interactable为false)四种状态的按钮的动画,然后进入对应事件时切换播放动画。


###3.2D精灵动画

2D游戏中动画一般使用图片帧动画,如下面一张图切成3份,不停切换形成动画。

1/ 图片导入到Unity设置为2D精灵,在SpriteEditor里切图,切成3个精灵。

2/ 然后选择这几个精灵直接拖拽到Hierarchy面板中,直接生成动画。

可以看到:场景里创建了一个物体,挂了SpriteRenderer组件用于渲染这个2D图,挂了Animator组件用于播放动画。(会使SpriteRenderer里的Sprite不停切换形成动画)

3/ 可以选择物体,打开Animation界面,编辑动画,修改Samples值来改变每秒帧数来改变动画速度。

4/ 我们也可以不拖拽,创建一个Animation选择物体的SpriteRenderer属性进行帧修改就行了。


###4.骨骼动画 Mecanim动画系统

1/ 导入模式

模型动画导入模式有三种(操作源文件-Rig):

  • Lagacy :旧版本Animation系统,使用后直接使用Animation组件播放动画
  • Generic:Mecanim系统,动物骨骼动画(动物/怪物/带披风触角尾巴任务),动画不可复用;选择后文件下生生成Avatar
  • Humanoid:Mecanim系统,人形骨骼动画,动画可以复用;选择后文件下生生成Avatar

2/ 切割动画

美术可能把所有动作做在了一个动画上,需要在源文件-Animation切页里裁剪。

切割完成会在文件下得到动画片段。

eam_unityanim's People

Contributors

eam727 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.