博客
关于我
unity5.0的StateMachineBehaviours
阅读量:77 次
发布时间:2019-02-25

本文共 1567 字,大约阅读时间需要 5 分钟。

?Unity??????????StateMachineBehaviour?????????????????????????????????????????????????????

??????

?????????????Animation -> Event??????????????????Unity????????????????????????????????????State Machines Behaviors???????????????

????

  • ???

    ???????StateMachineBehaviour?????OnStateEnter?OnStateExit???

  • ??????????

    ?OnStateEnter?????Animator?????????????????????

  • ????

    AnimatorStateInfo??????????????????????animator.GetCurrentStateInfo(layerIndex)?

  • ???

    LayerIndex??????????????0??????1??????????

  • ??????

  • ????????????????

    ????????????????????????????????????

  • ?????????

    ?AttackSMB?????????????index?????????

  • ????

    using System.Collections;using System.Collections.Generic;using UnityEngine;public class AttackSMB : StateMachineBehaviour{    public int index;    public Transform effect;    public override void OnStateEnter(Animator animator, AnimatorStateInfo animatorStateInfo, int layerIndex)    {        // ????        (animator.transform.GetComponent
    ()).ShowWeapon(); // ???? effect = animator.transform.Find("TrailEffect/Ellen_Staff_Swish0" + index); effect.gameObject.SetActive(true); } public override void OnStateExit(Animator animator, AnimatorStateInfo animatorStateInfo, int layerIndex) { // ???? (animator.transform.GetComponent
    ()).HideWeapon(); // ???? effect.gameObject.SetActive(false); }}

    ????

  • ????

    ????????????????index??????????

  • ??????

    ??????????????OnStateEnter??????????????????????????OnStateExit???????????????????

  • ?????????????????????????????????????

    转载地址:http://uex.baihongyu.com/

    你可能感兴趣的文章
    poj2546
    查看>>
    POJ2728 Desert King
    查看>>
    POJ2794 Double Patience[离散概率 状压DP]
    查看>>
    poj2828(线段树查找序列第k小的值)
    查看>>
    POJ2891:Strange Way to Express Integers——题解
    查看>>
    poj3045 Cow Acrobats(二分最大化最小值)
    查看>>
    poj3061 Subsequence(尺取法)
    查看>>
    poj3074 DLX精确覆盖
    查看>>
    poj3252(组合数)
    查看>>
    Qt笔记——QToolBox开发简易QQ聊天界面
    查看>>
    poj3307
    查看>>
    Qt笔记——QString与隐式共享、MVC架构
    查看>>
    Qt笔记——QSemaphore处理生产者/消费者模式
    查看>>
    Qt笔记——QMutex&QWaitCondition处理生产者消费者模式
    查看>>
    Qt笔记——QLable+QPixmap图片缩放踩坑
    查看>>
    Qt笔记——foreach与forever
    查看>>
    QT程序怎么挪到Linux下,linux+Qt程序如何打包发布
    查看>>
    Qt知识:视图框架QGraphicsWidget详解
    查看>>
    SpringBoot中项目启动及定时任务缓存数据库常用数据至内存变量并转换后高频调用
    查看>>
    Qt知识: 画刷风格
    查看>>