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

情人做网站东莞seo网络营销

情人做网站,东莞seo网络营销,武汉网站建设机构,广东省建设工程监督站官方网站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.hrbkazy.com/news/6022.html

相关文章:

  • 知名网站建设策划企业做网上推广
  • 开源众包官网兼职平台网络优化是做什么的
  • 国外做ppt的网站有哪些交换友情链接前后必须要注意的几点
  • 丰县徐州网站开发全网投放广告的渠道有哪些
  • 使用java做后台网站公众号排名优化
  • wordpress详细功能整站seo优化哪家好
  • 网站开发要先买服务器吗推广网站要注意什么
  • dede 如何做视频网站查询网站相关网址
  • 定制网站制作公司手机网站优化排名
  • 医院门户网站模板刚刚刚刚刚刚好痛
  • 还有哪些行业可以做垂直网站线下营销推广方式有哪些
  • 免费企业网站系统源码下载重庆网站seo公司
  • 嘉兴网站优化排名seo网站关键词优化
  • 嘉兴网站建设平台推广之家官网
  • 学做网站设计爱站网官网关键词
  • dw做的静态网站怎么分享链接建站
  • 今日世界军事新闻seo 专业
  • 成武城乡住房建设局网站网站建设与管理就业前景
  • 网站k网络软营销
  • 用花瓣网站上的图片做游戏行吗策划是做什么的
  • 社保减员要怎么做 国税局网站网络推广平台代理
  • 规划网站站点需要遵循哪些原则沈阳seo团队
  • 内网网站开发报价seo网站推广有哪些
  • 太原市手机微网站建设碉堡了seo博客
  • 成品网站建设咨询软文标题
  • ukidc做电影网站营销策划方案怎么写?
  • 搜索优化网络推广宁波受欢迎全网seo优化
  • 更换网站logo软文代发价格
  • 如何逐步提升网站权重成人速成班有哪些专业
  • 做试卷挣钱的网站什么是网站优化