博客
关于我
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/

    你可能感兴趣的文章
    Postgresql运维常用命令_登录_权限设置_创建用户_创建数据库_创建postgis数据库_远程连接---Postgresql工作笔记009
    查看>>
    PostgreSQL远程连接配置
    查看>>
    PostgreSQL远程连接,发生致命错误:没有用于主机“…”,用户“…”,数据库“…”,SSL关闭的pg_hba.conf记录
    查看>>
    PostgreSQL配置文件--AUTOVACUUM参数
    查看>>
    PostgreSQL配置文件--其他
    查看>>
    Postman 内置的动态变量
    查看>>
    Qt开发——QProgressBar/QProgressDialog进度条
    查看>>
    Postman 汉化(Postman中文版)
    查看>>
    Postman+Newman+Git+Jenkins实现接口自动化测试持续集成
    查看>>
    Qt布局管理详解(5种布局控件)
    查看>>
    Qt工程转化为Vs工程
    查看>>
    postman之参数化详解
    查看>>
    QT实现TCPServer连接多个客户端(附完整源码)
    查看>>
    Postman做接口测试:如何自动校验接口响应
    查看>>
    postman做接口自动化测试
    查看>>
    Postman入门到入土
    查看>>
    Postman入门到精通01
    查看>>
    postman入门基础 —— 接口测试流程
    查看>>
    Postman如何做接口测试:如何导入 swagger 接口文档
    查看>>
    Postman如何做接口测试:如何导入 swagger 接口文档
    查看>>