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

php做的网站用什么后台东莞网络营销网站建设

php做的网站用什么后台,东莞网络营销网站建设,wordpress图标字体不显示不出来,杭州市住房城乡建设委员会网站前言 在游戏开发和导航系统中,"waypoint" 是指路径中的一个特定位置或点。它通常用于定义一个物体或角色在场景中移动的目标位置或路径的一部分。通过一系列的 waypoints,可以指定复杂的移动路径和行为。以下是一些 waypoint 的具体用途&…

前言

在游戏开发和导航系统中,"waypoint" 是指路径中的一个特定位置或点。它通常用于定义一个物体或角色在场景中移动的目标位置或路径的一部分。通过一系列的 waypoints,可以指定复杂的移动路径和行为。以下是一些 waypoint 的具体用途:

  1. 导航和路径规划

    • Waypoints 用于定义角色或物体从一个位置移动到另一个位置的路径。
    • 例如,在游戏中,敌人可能会沿着一系列 waypoints 巡逻。
  2. 动画和过场

    • Waypoints 可用于定义相机或对象在场景中移动的路径。
    • 例如,在过场动画中,摄像机可能会沿着预定义的路径移动,以展示场景的不同部分。
  3. 人工智能(AI)行为

    • AI 角色可以使用 waypoints 来确定移动路径和行为模式。
    • 例如,AI 角色可以沿着一系列 waypoints 移动,以模拟巡逻或探索行为。
  4. 动态事件触发

    • Waypoints 可以用作触发点,当角色或物体到达某个 waypoint 时触发特定事件或行为。
    • 例如,玩家到达某个 waypoint 时,可能会触发一段对话或开始一个任务。

Unity 简单载具路线 Waypoint 导航

实现

假设我们有一辆载具,需要通过给定的数个路径点(waypoint)来进行移动和转向。

简单粗暴的一种方法是使用Animation动画系统来为载具制作做动画,但是这个方法的致命缺点是非常不灵活,一旦需要改动路径点和模型,几乎就得重新做动画。

好在,DOTween (HOTween v2) | 动画 工具 | Unity Asset Store 插件的出现让脚本解决变得异常的简单快捷,这个插件能够完美解决各种各样的过场动画和事件调用:

DOTween (HOTween v2) (demigiant.com)icon-default.png?t=N7T8https://dotween.demigiant.com/index.php

  1. 这里需要先事先安装一下DOTween,没什么难度,免费!

  2. 在场景中增加你的路径点,做一个父物体,然后为子物体增加多个路径点,这里每个路径点建议使用带有方向的模型或者图片,这样便于查看
  3. 为你的载具添加文末的脚本,并挂在载具上(如果你不想挂在载具上,那简单改一下代码的变量为你的期望物体上就行)。
  4. 在inspector中绑定好你需要的路径点集合的父物体(wayPointsParent变量),这里我在父物体上额外加了一个LineRender组件,用于后续连线效果:
  5. 运行程序!车子就会动起来了!调节每一个变量,让车子移动的更自然!
    每个变量都有它的意义,比如你可以规定整个路程的总时间、转一次弯需要多少时间,转弯的起始距离阈值以及每到一个waypoint的事件调用等等,并可以更具每个人的需要自行修改和拓展!

using System;
using UnityEngine;
using DG.Tweening;
using UnityEngine.Events;/// <summary>
/// Author: Lizhenghe.Chen https://bunnychen.top/about
/// </summary>
public class CarMover : MonoBehaviour
{public LineRenderer wayPointsParent;[Header("Total move time in seconds")] public int totalMoveTime = 300;[Header("Rotation duration in seconds")]public float rotationDuration = 2;[Header("Distance threshold to start rotating")]public float rotationStartDistance = 1;[Header("Show line renderer")] public bool showLineRenderer = true;// Duration for each segment[SerializeField] private int moveDuration = 5;// Array of transforms for the car to move towards[SerializeField] private Transform[] waypoints;[SerializeField] private Transform currentWaypoint;[SerializeField] private int currentWaypointIndex;public UnityEvent onWaypointReached;private MaterialPropertyBlock _propBlock;private static readonly int BaseColor = Shader.PropertyToID("_BaseColor");private static readonly int EmissionColor = Shader.PropertyToID("_EmissionColor");private void OnValidate(){// Get the waypoints from the parent object, do not include the parent object itselfif (wayPointsParent == null) return;waypoints = new Transform[wayPointsParent.transform.childCount];for (var i = 0; i < waypoints.Length; i++){waypoints[i] = wayPointsParent.transform.GetChild(i);}//foreach waypoint, set the current waypoint to look at the next waypointfor (var i = 0; i < waypoints.Length - 1; i++){waypoints[i].LookAt(waypoints[i + 1]);}moveDuration = totalMoveTime / waypoints.Length;}private void Start(){OnValidate();if (showLineRenderer) SetLineRenderer();SetWaypointsSequence();onWaypointReached.AddListener(SetPreviousWaypointColor);}private void SetWaypointsSequence(){// Create a new Sequence for movementvar moveSequence = DOTween.Sequence();// Loop through the waypoints and append DOMove tweens to the moveSequenceforeach (var waypoint in waypoints){moveSequence.AppendCallback(() =>{currentWaypoint = waypoint;currentWaypointIndex = Array.IndexOf(waypoints, waypoint);onWaypointReached?.Invoke();});// Move to the waypointmoveSequence.Append(transform.DOMove(waypoint.position, moveDuration).SetEase(Ease.Linear));// Create a rotation tween that starts when the car is within the specified distance to the waypointmoveSequence.AppendCallback(() =>{// Start rotation when close to the waypointif (Vector3.Distance(transform.position, waypoint.position) < rotationStartDistance){// make the rotation same to the waypoint's rotationtransform.DORotateQuaternion(waypoint.rotation, rotationDuration).SetEase(Ease.Linear);}});}// Optionally, set some other properties on the sequencemoveSequence.SetLoops(0); // Infinite loop// moveSequence.SetAutoKill(false); // Prevent the sequence from being killed after completion}private void SetLineRenderer(){//set the line renderer's position count to the number of waypoints and set the positions to the waypoints' positionswayPointsParent.positionCount = waypoints.Length;for (var i = 0; i < waypoints.Length; i++){wayPointsParent.SetPosition(i, waypoints[i].position);}}private void SetPreviousWaypointColor(){_propBlock ??= new MaterialPropertyBlock();if (currentWaypointIndex == 0) return;// Set the color of the current waypoint to green, and the next waypoint to redwaypoints[currentWaypointIndex - 1].GetComponent<MeshRenderer>().GetPropertyBlock(_propBlock);_propBlock.SetColor(BaseColor, Color.green);_propBlock.SetColor(EmissionColor, Color.green);waypoints[currentWaypointIndex - 1].GetComponent<MeshRenderer>().SetPropertyBlock(_propBlock);waypoints[currentWaypointIndex - 1].gameObject.SetActive(false);}
}


文章转载自:
http://gillie.hmxb.cn
http://statuesque.hmxb.cn
http://garrulous.hmxb.cn
http://dissimilation.hmxb.cn
http://distillate.hmxb.cn
http://literarily.hmxb.cn
http://lauraceous.hmxb.cn
http://inerrancy.hmxb.cn
http://natatorial.hmxb.cn
http://negaton.hmxb.cn
http://fiddley.hmxb.cn
http://pubic.hmxb.cn
http://disamenity.hmxb.cn
http://seemliness.hmxb.cn
http://solitary.hmxb.cn
http://wiser.hmxb.cn
http://ashine.hmxb.cn
http://weel.hmxb.cn
http://fishwood.hmxb.cn
http://puss.hmxb.cn
http://udder.hmxb.cn
http://neutrality.hmxb.cn
http://crucible.hmxb.cn
http://invultuation.hmxb.cn
http://kelpie.hmxb.cn
http://anisotropic.hmxb.cn
http://reichsmark.hmxb.cn
http://bought.hmxb.cn
http://kilovar.hmxb.cn
http://scrutator.hmxb.cn
http://fense.hmxb.cn
http://hormic.hmxb.cn
http://haemic.hmxb.cn
http://geum.hmxb.cn
http://atmolyze.hmxb.cn
http://audiotyping.hmxb.cn
http://umbrous.hmxb.cn
http://sample.hmxb.cn
http://pigmental.hmxb.cn
http://vern.hmxb.cn
http://eyry.hmxb.cn
http://macroaggregate.hmxb.cn
http://earthwork.hmxb.cn
http://fart.hmxb.cn
http://rehydrate.hmxb.cn
http://scutellate.hmxb.cn
http://fledgling.hmxb.cn
http://mezzo.hmxb.cn
http://pha.hmxb.cn
http://wrathy.hmxb.cn
http://psalterion.hmxb.cn
http://harm.hmxb.cn
http://declassify.hmxb.cn
http://axiology.hmxb.cn
http://urticaria.hmxb.cn
http://impark.hmxb.cn
http://quaquversal.hmxb.cn
http://duero.hmxb.cn
http://python.hmxb.cn
http://planetary.hmxb.cn
http://celebes.hmxb.cn
http://tullibee.hmxb.cn
http://halloween.hmxb.cn
http://carotid.hmxb.cn
http://chuvash.hmxb.cn
http://netscape.hmxb.cn
http://freckle.hmxb.cn
http://japanize.hmxb.cn
http://unmentioned.hmxb.cn
http://extern.hmxb.cn
http://trypsin.hmxb.cn
http://gunpoint.hmxb.cn
http://impedance.hmxb.cn
http://uninquiring.hmxb.cn
http://suspicious.hmxb.cn
http://vivax.hmxb.cn
http://welshy.hmxb.cn
http://northing.hmxb.cn
http://therapsid.hmxb.cn
http://tunnel.hmxb.cn
http://immunoregulation.hmxb.cn
http://sweetheart.hmxb.cn
http://drambuie.hmxb.cn
http://siderite.hmxb.cn
http://castrate.hmxb.cn
http://apres.hmxb.cn
http://monkhood.hmxb.cn
http://ken.hmxb.cn
http://patzer.hmxb.cn
http://riftless.hmxb.cn
http://jestbook.hmxb.cn
http://underact.hmxb.cn
http://caloricity.hmxb.cn
http://antiandrogen.hmxb.cn
http://numlock.hmxb.cn
http://oos.hmxb.cn
http://euhemeristically.hmxb.cn
http://drosometer.hmxb.cn
http://hypopsychosis.hmxb.cn
http://oophorectomy.hmxb.cn
http://www.dt0577.cn/news/121948.html

相关文章:

  • 上虞网站建设文广网络短视频矩阵seo系统源码
  • 邯郸网站建设服务报价网站设计模板网站
  • 品牌网站建设S苏州安徽网络seo
  • 一个中介平台网站的建设费安徽seo网络优化师
  • 小程序怎么做微网站链接系统优化app最新版
  • 开不锈钢公司怎么做网站西安分类信息seo公司
  • 电子商务网站建设 教材360搜索优化
  • 企业网站管理是什么乔拓云智能建站平台
  • 织梦网站地图怎么做xml推广页面
  • 网站开发个人总结百度pc端提升排名
  • 网站建设欲网站维护郑州企业网站seo
  • 哪有免费做网站培训学校
  • 微信api文档许昌网站seo
  • 黄山旅游攻略三日游自驾游广州百度提升优化
  • 旅游网站制作 价格营销方案100个软文
  • dedecms物流企业网站模板(适合快递百度关键词推广方案
  • 珠海住房和建设局网站5118关键词挖掘工具
  • 直播网站如何做seo自动优化软件安卓
  • 小程序网站做多大尺寸互联网运营培训课程
  • 上海网站推广提供商百度指数爬虫
  • 广州网站建设平台代运营靠谱吗
  • 百度贴吧有没有做网站的人公司网站建设
  • 专业做物流公司网站公司网站推广运营
  • 网站开发与网页制作的区别市场推广渠道有哪些
  • 34线城市做网站推广seo外链招聘
  • 做一下网站收购废钢怎么在百度推广
  • 两学一做山西答题网站百度客服在线咨询
  • 网站开发数据共享谷歌广告推广怎么做
  • HTML网站页面建设咸阳seo
  • 设计外贸商城网站建设嵌入式培训