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

    你可能感兴趣的文章
    node.js 配置首页打开页面
    查看>>
    node.js+react写的一个登录注册 demo测试
    查看>>
    Node.js中环境变量process.env详解
    查看>>
    Node.js之async_hooks
    查看>>
    Node.js卸载超详细步骤(附图文讲解)
    查看>>
    Node.js基于Express框架搭建一个简单的注册登录Web功能
    查看>>
    Node.js安装与配置指南:轻松启航您的JavaScript服务器之旅
    查看>>
    Node.js安装及环境配置之Windows篇
    查看>>
    Node.js安装和入门 - 2行代码让你能够启动一个Server
    查看>>
    node.js安装方法
    查看>>
    Node.js官网无法正常访问时安装NodeJS的方法
    查看>>
    Node.js的循环与异步问题
    查看>>
    Node.js高级编程:用Javascript构建可伸缩应用(1)1.1 介绍和安装-安装Node
    查看>>
    nodejs + socket.io 同时使用http 和 https
    查看>>
    NodeJS @kubernetes/client-node连接到kubernetes集群的方法
    查看>>
    Nodejs express 获取url参数,post参数的三种方式
    查看>>
    nodejs http小爬虫
    查看>>
    nodejs libararies
    查看>>
    nodejs npm常用命令
    查看>>
    Nodejs process.nextTick() 使用详解
    查看>>