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

    你可能感兴趣的文章
    Objective-C实现Bilateral Filter双边滤波器算法(附完整源码)
    查看>>
    Objective-C实现binary exponentiation二进制幂运算算法(附完整源码)
    查看>>
    Objective-C实现binary search二分查找算法(附完整源码)
    查看>>
    Objective-C实现binary tree mirror二叉树镜像算法(附完整源码)
    查看>>
    Objective-C实现binary tree traversal二叉树遍历算法(附完整源码)
    查看>>
    Objective-C实现BinarySearchTreeNode树算法(附完整源码)
    查看>>
    Objective-C实现binarySearch二分查找算法(附完整源码)
    查看>>
    Objective-C实现binomial coefficient二项式系数算法(附完整源码)
    查看>>
    Objective-C实现binomial distribution二项分布算法(附完整源码)
    查看>>
    Objective-C实现bisection二分法算法(附完整源码)
    查看>>
    Objective-C实现bisection二等分算法(附完整源码)
    查看>>
    Objective-C实现BitMap算法(附完整源码)
    查看>>
    Objective-C实现bitmask位掩码算法(附完整源码)
    查看>>
    Objective-C实现bitonic sort双调排序算法(附完整源码)
    查看>>
    Objective-C实现BloomFilter布隆过滤器的算法(附完整源码)
    查看>>
    Objective-C实现BMP图像旋转180度(附完整源码)
    查看>>
    Objective-C实现bogo sort排序算法(附完整源码)
    查看>>
    Objective-C实现boruvka博鲁夫卡算法(附完整源码)
    查看>>
    Objective-C实现Boyer-Moore字符串搜索算法(附完整源码)
    查看>>
    Objective-C实现BP误差逆传播算法(附完整源码)
    查看>>