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

    你可能感兴趣的文章
    python+flask计算机毕业设计高校学生饮食推荐系统(程序+开题+论文)
    查看>>
    python+flask计算机毕业设计高校教务管理系统(程序+开题+论文)
    查看>>
    python+flask计算机毕业设计高校教学档案管理系统(程序+开题+论文)
    查看>>
    python+flask计算机毕业设计高校教学督导平台(程序+开题+论文)
    查看>>
    python+flask计算机毕业设计高校数字化迎新系统(程序+开题+论文)
    查看>>
    python+flask计算机毕业设计高校校内景点平台(程序+开题+论文)
    查看>>
    python+flask计算机毕业设计高校校园线上跳蚤市场的系统设计(程序+开题+论文)
    查看>>
    Python图形处理
    查看>>
    python+flask计算机毕业设计高校物品使用互益平台的设计与实现(程序+开题+论文)
    查看>>
    Python函数,匿名函数,高阶函数,内置函数——08
    查看>>
    python+flask计算机毕业设计高校疫情防控管理平台(程序+开题+论文)
    查看>>
    python+flask计算机毕业设计高校网上迎新系统(程序+开题+论文)
    查看>>
    python+flask计算机毕业设计高校运动会(程序+开题+论文)
    查看>>
    python+flask计算机毕业设计高校选课系统(程序+开题+论文)
    查看>>
    Python+Jenkins+Allure Report接口自动化测试持续集成
    查看>>
    python+locust电商全流程性能测试
    查看>>