zoukankan      html  css  js  c++  java
  • MecanimControl插件随笔



    -----------------------------------------
    4个animatorController是怎么回事?
    分别对应 1镜像动画速度>0 2镜像播放速度<0 3非镜像播放速度>0 4非镜像播放速度<0

    -----------------------------------------
    MecanimControl类分析

    基本思路是建立animationData的list,用于添加删除runtime动画

    核心代码位于MecanimControl->_playAnimation

    每次播放新建立AnimatorOverrideController,设置state,并替换默认的AnimationController
    (每次播放new AnimatorOverrideController有点浪费)

    默认animatorController(4个,用法相同)中有3个状态,Default,State1,State2(这两个state默认
    是有动画在上面的),每次新建立AnimatorOverrideController都会替换State1和State2
    State1 用 currentAnimationData.clip
    State2 用 targetAnimationData.clip

    最后直接根据blendingTime直接调用
    animator.Play或animator.CrossFade

    -----------------------------------------
    注意一点
    Demo中的AnimationClip是以动画形式直接存在工程中的
    在AddClip时是用animData.clip = (AnimationClip) Instantiate(clip);
    猜测如果是使用从bundle加载进来的clip就直接(AnimationClip)clip就可以,不经过bundle就没有引用计数?就需要clone?


    -----------------------------------------

    问题

    没用到Mecanim的状态连线功能,都是直接切换到某个状态直接播放的,完全是代码控制,暂时不知道能不能扩展使用动画融合


    -----------------------------------------


  • 相关阅读:
    linux C总结篇(进程)
    进程与线程的区分
    递归的两种思路
    Linux下git与github的一般使用
    文件读写和文件指针的移动
    文件的创建,打开与关闭
    一个简单脚本
    linux 三剑客命令(grep,sed ,awk)
    常用正则表达式
    PAT:1002. A+B for Polynomials (25) 部分错误
  • 原文地址:https://www.cnblogs.com/nafio/p/9137357.html
Copyright © 2011-2022 走看看