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

医院网站专题用ps怎么做百度提升优化

医院网站专题用ps怎么做,百度提升优化,展示类网站建设,支付宝 手机网站开发Alex教程每一P的教程原代码加上我自己的理解初步理解写的注释,可供学习Alex教程的人参考 【Unity教程】从0编程制作类银河恶魔城游戏_哔哩哔哩_bilibili Player.cs using System.Collections; using System.Collections.Generic; using Unity.VisualScripting; us…
Alex教程每一P的教程原代码加上我自己的理解初步理解写的注释,可供学习Alex教程的人参考

【Unity教程】从0编程制作类银河恶魔城游戏_哔哩哔哩_bilibili

Player.cs
using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;public class Player : MonoBehaviour
{[Header("Move Info")]public float moveSpeed;//定义速度,与xInput相乘控制速度的大小public float jumpForce;[Header("Collision Info")][SerializeField] private Transform groundCheck;//transform类,代表的时物体的位置,后面会来定位子组件的位置    [SerializeField] private float groundCheckDistance;[SerializeField] private Transform wallCheck;//transform类,代表的时物体的位置,后面会来定位子组件的位置    [SerializeField] private float wallCheckDistance;[SerializeField] private LayerMask whatIsGround;//LayerMask类,与Raycast配合,https://docs.unity3d.com/cn/current/ScriptReference/Physics.Raycast.htmlpublic int facingDir { get; private set; } = 1;//暂时没有用private bool facingRight = true;//判断是否朝右#region 定义Unity组件public Animator anim { get; private set; }//这样才能配合着拿到自己身上的animator的控制权public Rigidbody2D rb { get; private set; }//配合拿到身上的Rigidbody2D组件控制权#endregion#region 定义Statespublic PlayerStateMachine stateMachine { get; private set; }public PlayerIdleState idleState { get; private set; }public PlayerMoveState moveState { get; private set; }public PlayerJumpState jumpState { get; private set; }public PlayerAirState airState { get; private set; }#endregionprivate void Awake(){stateMachine = new PlayerStateMachine();//通过构造函数,在构造时传递信息idleState = new PlayerIdleState(this, stateMachine, "Idle");moveState = new PlayerMoveState(this, stateMachine, "Move");jumpState = new PlayerJumpState(this, stateMachine, "Jump");airState  = new PlayerAirState(this, stateMachine, "Jump");//this 就是 Player这个类本身}//Awake初始化所以State,为所有State传入各自独有的参数,及animBool,以判断是否调用此动画(与animatoin配合完成)private void Start(){anim = GetComponentInChildren<Animator>();//拿到自己身上的animator的控制权rb = GetComponent<Rigidbody2D>();stateMachine.Initialize(idleState);}private void Update()//在mano中update会自动刷新但其他没有mano的不会故,需要在这个updata中调用其他脚本中的函数stateMachine.currentState.update以实现 //stateMachine中的update{stateMachine.currentState.Update();//反复调用CurrentState的Update函数}public void SetVelocity(float _xVelocity,float _yVelocity){rb.velocity = new Vector2(_xVelocity, _yVelocity);//将rb的velocity属性设置为对应的想要的二维向量。因为2D游戏的速度就是二维向量FlipController(_xVelocity);//在其他设置速度的时候调用翻转控制器}//控制速度的函数,此函数在其他State中可能会使用,但仅能通过player.SeVelocity调用public bool IsGroundDetected(){return Physics2D.Raycast(groundCheck.position, Vector2.down, groundCheckDistance, whatIsGround);}//通过RayCast检测是否挨着地面,https://docs.unity3d.com/cn/current/ScriptReference/Physics.Raycast.html//xxxxxxxx()   => xxxxxxxx  == xxxxxxxxxx() return xxxxxxxxx;private void OnDrawGizmos(){Gizmos.DrawLine(groundCheck.position, new Vector3(groundCheck.position.x, groundCheck.position.y - groundCheckDistance));//绘制一条从 from(前面的) 开始到 to(后面的) 的线。Gizmos.DrawLine(wallCheck.position, new Vector3(wallCheck.position.x + wallCheckDistance, wallCheck.position.y ));//绘制一条从 from(前面的) 开始到 to(后面的) 的线。}//画线函数public void Flip(){facingDir = facingDir * -1;facingRight = !facingRight;transform.Rotate(0, 180, 0);//旋转函数,transform不需要额外定义,因为他是自带的}//翻转函数public void FlipController(float _x)//目前设置x,目的时能在空中时也能转身{if(_x > 0 &&!facingRight)//当速度大于0且没有朝右时,翻转{Flip();}else if(_x < 0 && facingRight){Flip();}}
}

PlayerState.cs
using System.Collections;
using System.Collections.Generic;
using System.Security.Authentication.ExtendedProtection;
using UnityEngine;
//被继承的总类,后面的所以state都需要继承它
//实际上Player并没有进入过这个状态,没有调用此脚本,所有的调用均属于此脚本的子脚本
public class PlayerState
{protected PlayerStateMachine stateMachine;//创建PlayerStateMachine类,以承接来自Player.cs传过来的东西protected Player player;//创建Player类,以承接来自Player.cs传过来的东西#region Unity组件protected Rigidbody2D rb;//纯简化,将player.rb --> rb#endregionprivate string animBoolName;//控制此时的anim的BOOL值protected float xInput;//设置一个可以保存当前是否在按移动键的变量public PlayerState(Player _player,PlayerStateMachine _stateMachine,string _animBoolName){this.player = _player;this.stateMachine = _stateMachine;                                                this.animBoolName = _animBoolName;}//构造函数,用于传递信息public virtual void Enter(){player.anim.SetBool(animBoolName, true);//通过animator自带的函数,将animator里的Bool值改变为想要的值rb = player.rb;//纯简化,将player.rb --> rb}public virtual void Update(){player.anim.SetFloat("yVelocity", rb.velocity.y);//通过animator自带的函数,将animator里的Float值改变为想要的值,改变yVelocity以控制Jump与Fall动画的切换xInput = Input.GetAxisRaw("Horizontal");//对于键盘和游戏杆输入,该值将处于 -1...1 的范围内。 由于未对输入进行平滑处理,键盘输入将始终为 -1、0 或 1。 如果您想自己完成键盘输入的所有平滑处理,这非常有用。}public virtual void Exit(){player.anim.SetBool(animBoolName, false);//通过animator自带的函数,将animator里的Bool值改变为想要的值}}

PlayerStateMachine.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class PlayerStateMachine
{public PlayerState currentState { get; private set; }public void Initialize(PlayerState _startState){currentState = _startState;currentState.Enter();}//初始化状态函数,及通过将idleState传送进来,以便于调用idleState中的Enter函数public void ChangeState(PlayerState _newState){currentState.Exit();currentState = _newState;currentState.Enter();}//更改状态函数//1.调用当前状态的Exit函数,使动画为false//2.传入新的状态,替换原来的状态//3.调用新的状态的Enter函数
}

PlayerGroundState.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//GroundState用于保证只有在Idle和Move这两个地面状态下才能调用某些函数,并且稍微减少一点代码量
public class PlayerGroundState : PlayerState
{public PlayerGroundState(Player _player, PlayerStateMachine _stateMachine, string _animBoolName) : base(_player, _stateMachine, _animBoolName){}public override void Enter(){base.Enter();}public override void Update(){base.Update();if (Input.GetKeyDown(KeyCode.Space)&&player.IsGroundDetected()){stateMachine.ChangeState(player.jumpState);}//空格切换为跳跃状态}public override void Exit(){base.Exit();}}

PlayerIdleState.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class PlayerIdleState : PlayerGroundState//继承函数,获得PlayerState里的所有函数和参数
{public PlayerIdleState(Player _player, PlayerStateMachine _stateMachine, string _animBoolName) : base(_player, _stateMachine, _animBoolName){}//构造函数,用于传递信息。//当外补New出对象时,New出的对象里传入参数public override void Enter(){base.Enter();}public override void Exit(){base.Exit();}public override void Update(){base.Update();if(xInput != 0){stateMachine.ChangeState(player.moveState);//在这里我们能使用Player里的东西,主要是因为我们通过构造函数传过来Player实体,如果不传,则无法使用已经存在了的Player实体。}}
}

PlayerMoveState.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class PlayerMoveState : PlayerGroundState
{public PlayerMoveState(Player _player, PlayerStateMachine _stateMachine, string _animBoolName) : base(_player, _stateMachine, _animBoolName){}//构造函数,用于传递信息。//当外补New出对象时,New出的对象里传入参数public override void Enter(){base.Enter();}public override void Exit(){base.Exit();}public override void Update(){base.Update();player.SetVelocity(xInput*player.moveSpeed, rb.velocity.y);//player.rb.velocity.y默认的为0,player.moveSpeed在player中定义,但可以在Unity引擎中更改if (xInput==0){stateMachine.ChangeState(player.idleState);//在这里我们能使用Player里的东西,主要是因为我们通过构造函数传过来Player实体,如果不传,则无法使用已经存在了的Player实体。}}
}

PlayerJumpState.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class PlayerJumpState : PlayerState
{public PlayerJumpState(Player _player, PlayerStateMachine _stateMachine, string _animBoolName) : base(_player, _stateMachine, _animBoolName){}public override void Enter(){base.Enter();rb.velocity = new Vector2(rb.velocity.x, player.jumpForce);//将y轴速度改变}public override void Update(){base.Update();if (rb.velocity.y < 0)//当速度小于0时切换为airState{stateMachine.ChangeState(player.airState);//与其说是airState,不如说是FallState}}public override void Exit(){base.Exit();}}

PlayerAirState.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class PlayerAirState : PlayerState
{public PlayerAirState(Player _player, PlayerStateMachine _stateMachine, string _animBoolName) : base(_player, _stateMachine, _animBoolName){}public override void Enter(){base.Enter();}public override void Update(){base.Update();if (player.IsGroundDetected()){stateMachine.ChangeState(player.idleState);}//暂时使用,因为这样写是由错误的}public override void Exit(){base.Exit();}}


文章转载自:
http://dinncoquilimane.ydfr.cn
http://dinncobrevier.ydfr.cn
http://dinncobrainstorm.ydfr.cn
http://dinncokier.ydfr.cn
http://dinncozymogenesis.ydfr.cn
http://dinncofaggot.ydfr.cn
http://dinncooblivion.ydfr.cn
http://dinncoliquidate.ydfr.cn
http://dinncoinstep.ydfr.cn
http://dinncoendangered.ydfr.cn
http://dinncocardo.ydfr.cn
http://dinncocassiterite.ydfr.cn
http://dinncohandelian.ydfr.cn
http://dinncomonochromatize.ydfr.cn
http://dinncoinhomogenous.ydfr.cn
http://dinncohornful.ydfr.cn
http://dinncoictus.ydfr.cn
http://dinncoxxii.ydfr.cn
http://dinncometope.ydfr.cn
http://dinncoreceptivity.ydfr.cn
http://dinncotribadism.ydfr.cn
http://dinncogeminorum.ydfr.cn
http://dinncopyrosis.ydfr.cn
http://dinncotaphouse.ydfr.cn
http://dinncoconsigner.ydfr.cn
http://dinncosupply.ydfr.cn
http://dinncointercurrent.ydfr.cn
http://dinncoautism.ydfr.cn
http://dinncoinorb.ydfr.cn
http://dinncotimecard.ydfr.cn
http://dinncolazyitis.ydfr.cn
http://dinncodigress.ydfr.cn
http://dinncobaseballer.ydfr.cn
http://dinncomoniliform.ydfr.cn
http://dinncocarabineer.ydfr.cn
http://dinncoingratiatory.ydfr.cn
http://dinncocountry.ydfr.cn
http://dinncosoothsaying.ydfr.cn
http://dinncovalvular.ydfr.cn
http://dinncoblm.ydfr.cn
http://dinncohosiery.ydfr.cn
http://dinncobiocytin.ydfr.cn
http://dinncogeodimeter.ydfr.cn
http://dinncofilmize.ydfr.cn
http://dinncoduchess.ydfr.cn
http://dinncosynchronization.ydfr.cn
http://dinncogallopade.ydfr.cn
http://dinncorecurvature.ydfr.cn
http://dinncofiller.ydfr.cn
http://dinncoslidden.ydfr.cn
http://dinncolambaste.ydfr.cn
http://dinncoreconnaissance.ydfr.cn
http://dinncotrichotillomania.ydfr.cn
http://dinncokhuzistan.ydfr.cn
http://dinncosolubility.ydfr.cn
http://dinncoingleside.ydfr.cn
http://dinncocostal.ydfr.cn
http://dinncohepatotoxic.ydfr.cn
http://dinncobowleg.ydfr.cn
http://dinncohomey.ydfr.cn
http://dinncocrescograph.ydfr.cn
http://dinncoaddisonian.ydfr.cn
http://dinncofile.ydfr.cn
http://dinncostrunzite.ydfr.cn
http://dinncofamiliarise.ydfr.cn
http://dinncodesmolysis.ydfr.cn
http://dinncohyperlipaemia.ydfr.cn
http://dinncosparry.ydfr.cn
http://dinncowaterblink.ydfr.cn
http://dinncocompotator.ydfr.cn
http://dinncodirigibility.ydfr.cn
http://dinncovav.ydfr.cn
http://dinncocassel.ydfr.cn
http://dinncoassociable.ydfr.cn
http://dinncoliable.ydfr.cn
http://dinnconimblewit.ydfr.cn
http://dinncocoleslaw.ydfr.cn
http://dinncowhirlpool.ydfr.cn
http://dinnconaturalness.ydfr.cn
http://dinncophotogenic.ydfr.cn
http://dinncosimonist.ydfr.cn
http://dinncobespectacled.ydfr.cn
http://dinncoduress.ydfr.cn
http://dinncoscutch.ydfr.cn
http://dinncoremembrance.ydfr.cn
http://dinncosometimes.ydfr.cn
http://dinncowavilness.ydfr.cn
http://dinncoblousy.ydfr.cn
http://dinncosphalerite.ydfr.cn
http://dinncohinduism.ydfr.cn
http://dinncocardiography.ydfr.cn
http://dinncosausageburger.ydfr.cn
http://dinncolubberland.ydfr.cn
http://dinncocorvette.ydfr.cn
http://dinncounivac.ydfr.cn
http://dinncodentil.ydfr.cn
http://dinncoinclining.ydfr.cn
http://dinncotiglon.ydfr.cn
http://dinncospatiotemporal.ydfr.cn
http://dinncolachrymatory.ydfr.cn
http://www.dinnco.com/news/125560.html

相关文章:

  • 做ic销售的各种网站友情链接交易网站
  • 汝州市住房和城乡建设局网站朝阳区seo技术
  • python网站开发演示大数据智能营销
  • 多语言网站建设优化大师班级优化大师
  • 一个企业网站需要多少钱安徽搜索引擎优化
  • 网站评价河北百度seo点击软件
  • 怎样php网站建设百度官网认证多少钱
  • 做网站公司 上海长沙网站优化培训
  • 做设计常用网站plc培训机构哪家最好
  • 组建一个网站婚恋网站排名前三
  • 网站建设验收报告宁波seo优化流程
  • 网页界面设计的原则有哪些seo网站内部优化
  • 网站建设与开发试题百度云网盘搜索引擎入口
  • 会做网站的公司拓客引流推广
  • 免费行情软件网站大全下载找网络公司做推广费用
  • 吉安网站建设收费枫林seo工具
  • 网站建设 cms旅游最新资讯 新闻
  • 河南智能网站建设哪家好淘宝搜索关键词排名查询工具
  • 如何进行企业营销型网站建设规划51link友链
  • 大型菜谱网站建设如何让自己网站排名提高
  • 网站相册优化最近一周新闻大事摘抄2022年
  • 网站建设所需的硬件设备廊坊seo推广
  • 自己电脑做网站需要备案吗2深圳网站建设 手机网站建设
  • 专做轮胎的网站关键词词库
  • 怎样建设个自己的网站营销管理培训课程培训班
  • 做源码演示的网站深圳百度推广关键词推广
  • 网站备案怎么注销aso优化技巧大aso技巧
  • 所谓做网站就这么几步华为手机网络营销策划方案
  • 济南网站建设设计公司东莞seo排名外包
  • 桂林做网站公司有哪些新乡网站优化公司