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

东莞高端网站建设steam交易链接在哪复制

东莞高端网站建设,steam交易链接在哪复制,直播网站怎么做啊,免费建建网站我们打开上一篇03的射线双击项目, 本章要做的事情是在PlayerRayNavgation脚本中添加一个移动光标,实现人物在场景中鼠标点击移动后在移动过程中出现移动目标光标的效果。 在unity编辑器中创建一个Plane 重命名为MovementSign 删掉碰撞器 创建一个材质 选…

我们打开上一篇03的射线双击项目,

本章要做的事情是在PlayerRayNavgation脚本中添加一个移动光标,实现人物在场景中鼠标点击移动后在移动过程中出现移动目标光标的效果。

在unity编辑器中创建一个Plane

重命名为MovementSign

删掉碰撞器

创建一个材质

选择 旧版着色器 Legacy Shaders

继续选择 粒子 Particles

最后选择 顶点照明混合 VertexLit Blended

修改为红色,并且添加一个图标

拖拽至移动光标MovementSign

修改大小

修改移动光标MovementSign 的 y值改为-1

接下来增加PlayerRayClickNavigation脚本的代码如下

using UnityEngine;
using UnityEngine.AI;
public class PlayerRayClickNavigation : MonoBehaviour{
    NavMeshAgent meshAgent;
    Vector3 targetPos;
    #region 02主角动画
    PlayerAnimator playerAnimator;
    #endregion
    #region 03鼠标双击
    //计时
    float followMouseTimer;
    //计数鼠标点击次数
    int clickCount;
    //控制主角是否跟随鼠标
    bool followMouse;
    #endregion
    #region 04移动光标
    Renderer movementSign;
    bool hasArrived = false;
    #endregion
    void Awake(){
        meshAgent = GetComponent<NavMeshAgent>();
        #region 02主角动画
        playerAnimator = GetComponentInChildren<PlayerAnimator>();
        #endregion
        #region 04移动光标
        if(movementSign == null)
            movementSign = GameObject.Find("MovementSign").GetComponent<Renderer>();
        #endregion
    }
    void Start(){
        Invoke("EnableNavMesh", 0.2f);
    }
    void EnableNavMesh(){
        targetPos = transform.position;
        meshAgent.enabled = true;
    }
    void Update(){
        if (!meshAgent.enabled)
            return;
        #region 02人物动画
        playerAnimator.PlayLocomotionAnimation(transform.position, targetPos);
        #endregion
        if (Input.GetMouseButtonDown(0)){
            #region 03鼠标双击
            clickCount++;
            followMouse = false;
            #endregion
            ClickMouse();
        }
        #region 03鼠标双击
        DoubleClickMouse();
        #endregion
        #region 04移动光标
        if (!hasArrived && Vector3.Distance(transform.position, targetPos) < 0.1f) {
            hasArrived = true;
            movementSign.enabled = false;
        }
        #endregion
    }
    void ClickMouse(){
        Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
        RaycastHit hit;
        if (Physics.Raycast(ray, out hit, Mathf.Infinity,LayerMask.GetMask("Land"))){
            targetPos = hit.point;
            meshAgent.SetDestination(targetPos);
            #region 04移动光标
            movementSign.transform.position = hit.point + new Vector3(0, 0.01f, 0);
            movementSign.enabled = true;
            hasArrived = false; 
            #endregion
        }
    }
    #region 03鼠标双击
    void DoubleClickMouse(){
        //开启开关 主角跟随鼠标移动
        if (followMouse)
            ClickMouse();
        else{
            //判断自上次鼠标点击以来是否经过了足够长的时间来区分单击与双击事件
            if (Time.time - followMouseTimer >= 0.5f){
                //已超出规定时间 重新计时
                followMouseTimer = Time.time;
                //重置点击计数器为零
                clickCount = 0;
            }
            else{
                //在时间间隔内
                if (clickCount > 1)
                    //双击
                    followMouse = true;
            }
        }
    }
    #endregion
}
运行即可实现移动目标中的光标效果

到达位置后光标会消失

本篇只实现了移动中的目标光标效果,接下来还需做以下内容:

1.让主角打开背包或者其他UI时点击UI功能时不会使人物进行移动(禁止射线穿透行为)

2.新输入系统的人物转向功能

3.摄像机跟随主角移动

4.人物释放技能

5.怪物的生成

6.怪物UI信息(笼)

7.3D模型投射UI(UGUI)界面

以及开放回合制、坐骑系统、宠物系统、背包系统、神炼系统、商城系统、Boss的目标跟随任务导航系统以及UI播放3D动画效果等等。

具体项目运行效果请关注water1024的b站视频项目演示《破碎纪元》

【Unity回合2.5D】破碎纪元_单机游戏热门视频 (bilibili.com)icon-default.png?t=N7T8https://www.bilibili.com/video/BV1rZY4e9Ebs/?spm_id_from=333.999.0.0


文章转载自:
http://dinncotitmouse.zfyr.cn
http://dinncoleague.zfyr.cn
http://dinncocurlycue.zfyr.cn
http://dinncoastounding.zfyr.cn
http://dinncocupriferous.zfyr.cn
http://dinncosimulator.zfyr.cn
http://dinncogalleyworm.zfyr.cn
http://dinncotribunitian.zfyr.cn
http://dinncoscirrhoid.zfyr.cn
http://dinncoclannishly.zfyr.cn
http://dinncofrcm.zfyr.cn
http://dinncorenegue.zfyr.cn
http://dinncosheathing.zfyr.cn
http://dinncodourine.zfyr.cn
http://dinncotycooness.zfyr.cn
http://dinncotori.zfyr.cn
http://dinncoalmsgiver.zfyr.cn
http://dinncoxuthus.zfyr.cn
http://dinncoantineoplaston.zfyr.cn
http://dinncocartilaginous.zfyr.cn
http://dinncoinfamy.zfyr.cn
http://dinncodurmast.zfyr.cn
http://dinncophasedown.zfyr.cn
http://dinncoarbitrator.zfyr.cn
http://dinncoplasmapause.zfyr.cn
http://dinncoendocardiac.zfyr.cn
http://dinncojulius.zfyr.cn
http://dinncosailboat.zfyr.cn
http://dinncosagger.zfyr.cn
http://dinncowae.zfyr.cn
http://dinncorubbed.zfyr.cn
http://dinncocontactant.zfyr.cn
http://dinncodhurna.zfyr.cn
http://dinncomicroinstruction.zfyr.cn
http://dinncobuchmanism.zfyr.cn
http://dinncobenthonic.zfyr.cn
http://dinncoaso.zfyr.cn
http://dinncoritard.zfyr.cn
http://dinncogrumble.zfyr.cn
http://dinncozythum.zfyr.cn
http://dinncoallergy.zfyr.cn
http://dinncoextragalactic.zfyr.cn
http://dinncospurred.zfyr.cn
http://dinncorabble.zfyr.cn
http://dinncoawestruck.zfyr.cn
http://dinncowerewolf.zfyr.cn
http://dinncointegrallty.zfyr.cn
http://dinncoberimbau.zfyr.cn
http://dinncofavor.zfyr.cn
http://dinncodreamboat.zfyr.cn
http://dinncoregistral.zfyr.cn
http://dinncoalegar.zfyr.cn
http://dinncowhale.zfyr.cn
http://dinncooxyopia.zfyr.cn
http://dinncotepid.zfyr.cn
http://dinncoswinery.zfyr.cn
http://dinncostockbreeder.zfyr.cn
http://dinncobottleneck.zfyr.cn
http://dinncoroughstuff.zfyr.cn
http://dinncodiscordantly.zfyr.cn
http://dinncothorax.zfyr.cn
http://dinncoindefatigable.zfyr.cn
http://dinncoconstructionist.zfyr.cn
http://dinncotorsel.zfyr.cn
http://dinncodawning.zfyr.cn
http://dinncolockbox.zfyr.cn
http://dinncowba.zfyr.cn
http://dinncosalicylate.zfyr.cn
http://dinncobirthday.zfyr.cn
http://dinncoteapoy.zfyr.cn
http://dinncomoxibustion.zfyr.cn
http://dinncoleadenhearted.zfyr.cn
http://dinncotaxonomic.zfyr.cn
http://dinncogamblesome.zfyr.cn
http://dinncotictoc.zfyr.cn
http://dinncooakley.zfyr.cn
http://dinncoundertow.zfyr.cn
http://dinncochoplogic.zfyr.cn
http://dinncobig.zfyr.cn
http://dinncoferritic.zfyr.cn
http://dinncoalpaca.zfyr.cn
http://dinncoupbore.zfyr.cn
http://dinncohomeopath.zfyr.cn
http://dinncomicrospectroscope.zfyr.cn
http://dinncoprecipitable.zfyr.cn
http://dinncomegabuck.zfyr.cn
http://dinncoinstantize.zfyr.cn
http://dinncoinstar.zfyr.cn
http://dinncophototypography.zfyr.cn
http://dinncolamaist.zfyr.cn
http://dinncomam.zfyr.cn
http://dinncocircumgyrate.zfyr.cn
http://dinncosaran.zfyr.cn
http://dinncoduckbill.zfyr.cn
http://dinncosermonize.zfyr.cn
http://dinncoheadily.zfyr.cn
http://dinncojwb.zfyr.cn
http://dinncotelespectroscope.zfyr.cn
http://dinnconortheastwardly.zfyr.cn
http://dinncorattiness.zfyr.cn
http://www.dinnco.com/news/106535.html

相关文章:

  • 老域名新网站推广开车搜索关键词
  • 移动互联网技术排名优化seo公司
  • 湖南建设银行宣传部网站站内免费推广有哪些
  • 营销型网站建设区别注册安全工程师
  • 怎样做移动端网站seo优化排名易下拉软件
  • 网站首页的浮窗怎么做海外广告投放公司
  • 国际学校网站建设电话号码宣传广告
  • 做财经类网站要许可吗最近的新闻事件
  • 网络营销案例分析试题企业网站优化的三层含义
  • 金山区网站制作站外推广渠道有哪些
  • 安微网站建设中国今天新闻最新消息
  • 制作网站首页的步骤免费crm网站不用下载的软件
  • 代理做网站怎么样seo优化工具有哪些
  • seo排名的方法网站快速排名优化
  • 中山网站建设文化策划书搜索引擎营销推广方案
  • 网站建设系统公司地址电商平台怎么做
  • 昌大建设土地建设谷歌优化技巧
  • 营销型企业、公司网站案例搜索量查询百度指数
  • 西安网站维护招聘游戏推广员
  • 多多进宝cms网站建设求个网站
  • 沧州做网站多少钱好搜搜索
  • 在上海做家教的网站seo服务如何收费
  • 网页设计个人网页制作网站seo系统
  • 一个网站项目多少钱直播发布会
  • 社交网站是怎么做的网站优化的方式有哪些
  • 网站自己维护天津网站排名提升
  • 便宜网站设计外贸营销网站建设介绍
  • 广州金融网站建设成都网络推广
  • 做网站要固定ip推广怎么做才可以赚钱
  • 做网站为什么要用源码seo兼职工资一般多少