当前位置: 首页 > news >正文

shopify建站成都家装排名前十名

shopify建站,成都家装排名前十名,网站建设在线学习,上海宣传片拍摄的公司Alex教程每一P的教程原代码加上我自己的理解初步理解写的注释,可供学习Alex教程的人参考 此代码仅为较上一P有所改变的代码 【Unity教程】从0编程制作类银河恶魔城游戏_哔哩哔哩_bilibili Enemy.cs using System.Collections; using System.Collections.Generic;…
Alex教程每一P的教程原代码加上我自己的理解初步理解写的注释,可供学习Alex教程的人参考
此代码仅为较上一P有所改变的代码
【Unity教程】从0编程制作类银河恶魔城游戏_哔哩哔哩_bilibili
Enemy.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class Enemy : MonoBehaviour
{#region 组件public Animator anim { get; private set; }public Rigidbody2D rb { get; private set; }#endregion#region 类public EnemyStateMachine stateMachine;public EnemyIdleState idleState;#endregionprivate void Awake(){stateMachine = new EnemyStateMachine();idleState = new EnemyIdleState(this, stateMachine, "Idle");anim = GetComponentInChildren<Animator>();rb = GetComponent<Rigidbody2D>();}void Start(){stateMachine.Initialize(idleState);}void Update(){stateMachine.currentState.Update();}
}

EnemyState.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class EnemyState
{protected Enemy enemy;protected EnemyStateMachine stateMachine;protected bool triggerCalled;private string animBoolName;protected float stateTimer;public EnemyState(Enemy _enemy, EnemyStateMachine _stateMachine, string _animBoolName){this.enemy = _enemy;this.stateMachine = _stateMachine;this.animBoolName = _animBoolName;}public virtual void Enter(){triggerCalled = false;Debug.Log("I enter" + animBoolName);enemy.anim.SetBool(animBoolName, true);}public virtual void Update(){stateTimer -= Time.deltaTime;Debug.Log("I'm in " + animBoolName);}public virtual void Exit(){enemy.anim.SetBool(animBoolName, false);}}

EnemyStateMachine.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class EnemyStateMachine
{public EnemyState currentState { get; private set; }//记得加private set,不然很可能会被外部改了public void Initialize(EnemyState _startState){currentState = _startState;currentState.Enter();}public void ChangeState(EnemyState _newState){currentState.Exit();currentState = _newState;currentState.Enter();}
}

EnemyIdleState.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class EnemyIdleState : EnemyState
{public EnemyIdleState(Enemy _enemy, EnemyStateMachine _stateMachine, string _animBoolName) : base(_enemy, _stateMachine, _animBoolName){}public override void Enter(){base.Enter();}public override void Exit(){base.Exit();}public override void Update(){base.Update();}
}

http://www.bjxfkj.com.cn/article/108124.html

相关文章:

  • 网站免费推广100种方法wordpress个人淘宝客
  • 辽宁鞍山网站建设建设网站公司招聘
  • 凡科网建站模板物流网站首页图片
  • 做网站很麻烦吗都是些什么企业需要建设网站
  • 做网站的好处做兼职网站
  • 合肥市建设通网站上海关键词排名手机优化软件
  • 深圳个人网站建设移动互联网开发技术就业前景
  • 网站开发常用的框架360免费建站怎么做
  • 小程序网站开发机构wordpress更新显示失败
  • 公司名字测吉凶免费中山做网站优化
  • 响应式网站尺寸节点网络营销课程个人总结范文
  • 昆明网站建设方案策划浙江省建筑考证服务平台
  • 内容网站设计范例phpnow 安装wordpress
  • 时间轴网站设计自己做套现要建网站吗
  • 手机网站支付签约长治网站制作厂家
  • 网站开发的数据库视频直播网站开发流程
  • c 用mysql做的网站床上做受网站
  • 石狮市网站建设做英文简历的网站
  • 母婴网站建设的目的网站制作咨询
  • 手机百度建设网站wordpress怎么建站
  • 互联网网站建设 选择题两学一做 答题 网站
  • 固始县网站建设培训股票分析网站可以做推广吗
  • 湖北长城建设实业有限公司网站关键词有哪些关联词
  • 在线购物网站 模版新手如何找cps推广渠道
  • 电商如何推广企业网站优化内容
  • 中小型网站建设哪家好个人网站盈利
  • 广西圣泰建设工程有限公司网站微信公众号对接网站
  • 2免费做网站app应用下载网站源码
  • 栖霞建设采购网站如何网上接单做设计
  • 徐州网站开发服务网上投资项目的平台有哪些