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

旅游电网站建设目标重庆百度推广电话

旅游电网站建设目标,重庆百度推广电话,免费做爰网站,有什么做网兼的网站👨‍💻个人主页:元宇宙-秩沅 hallo 欢迎 点赞👍 收藏⭐ 留言📝 加关注✅! 本文由 秩沅 原创 收录于专栏:unity游戏制作 ⭐mango的冒险场景二——镜头和法球特效跟随⭐ 文章目录⭐mango的冒险场景二——镜…

在这里插入图片描述


👨‍💻个人主页:@元宇宙-秩沅

hallo 欢迎 点赞👍 收藏⭐ 留言📝 加关注✅!

本文由 秩沅 原创

收录于专栏:unity游戏制作


⭐mango的冒险场景二——镜头和法球特效跟随⭐


文章目录

    • ⭐mango的冒险场景二——镜头和法球特效跟随⭐
    • 🎶版本前言
    • 👨‍💻相机的差值跟随
      • 👺步骤和效果图
      • 👺代码
      • 👺可能出现的BUG
    • 👨‍💻法球攻击系统的实现
      • 👺法球的生成和跟随
      • 👺代码
    • ⭐相关文章⭐


🎶版本前言


🎶版本: 为 Ltp 2021年版本的unity
🎶类型: 简单2D类冒险游戏
🎶目的: 熟悉掌握基本unityAPI
🎶视频教程:【2023小白狂飙unity2D冒险类游戏制作【mango的冒险】】


👨‍💻相机的差值跟随


重点: 做辅助点 和 用lerp()方法


👺步骤和效果图


实现一般相机跟随的简单方法
①手动挂载
②代码实现

  • 1.🧠通过API获取主对象mango,然后将相机用API附成mango的子对象即可实现跟随第一步
  • 2.🧠若当时任务转向的方法采用的是方法二旋转的话那么画面辉变成如下效果,画面也跟着转了

获取

  • 3.🧠若当时任务转向的方法采用的是方法三Scale的话那么画面会变成如下效果,那么这个才是我们想要的效果

在这里插入图片描述

  • 4.🧠用差值移动让相机平滑的跟随,先给mango添加子物体辅助点,该点的位置与相机初始值的位置一致
  • 5.🧠让相机跟着该辅助点进行lerp差值移动,故此就不需要上面让相机变成子物体这一步,原因如下

左右移动切换十分不流畅

在这里插入图片描述

  • 6.🧠相机跟着该辅助点进行lerp差值移动的效果如下

🎶这是最终我们想要的效果
在这里插入图片描述


👺代码


using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;
//-----------------------
//--作用:相机的移动
//-----------------------
public class CameraMove : MonoBehaviour
{private Transform  Mango;void Start(){Mango = GameObject.Find("Mango").transform;}void LateUpdate(){transform .position = Vector3.Lerp(transform.position, GameObject.Find("Mango").transform.GetChild(1).position, 0.1f);}

👺可能出现的BUG


【unity细节】基于unity子对象(如相机)为什么无法进行z轴的拖拽移动和z轴自动归位的问题


👨‍💻法球攻击系统的实现


👺法球的生成和跟随


重点: 做辅助点 和 用lerp()方法,倒计时方法


  • 1.将母体变成预制体,以便捷之后的操作

  • 2.添加四个点前两个作为高层级法球的定点,后两个作为低层级的定点
    在这里插入图片描述

  • 3.法球分成高层级预制体和低层级预制体,添加自定义的粒子特效
    +、

  • 4.实例化四个法球,让四个法球跟着四个定点进行lerp差值跟随移动,给母体添加脚本
    (方式为:通过代码添加)

在这里插入图片描述

  • 5.给法球添加抖动效果
    (要实现每个法球都上下晃动的话需要随机数,只需要改变其Y轴的位置即可,那么要取其晃动的范围,法球最好跟着辅助点进行Lerp差值跟随)
    在这里插入图片描述
    额 搞错了再来🤣
    在这里插入图片描述
    最终效果如上🧠🧠🧠🧠🧠🧠

👺代码



using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.PlayerLoop;
using UnityEngine.Rendering;
//-----------------------
//--作用:法球的跟随移动
//-----------------------public class BallMove : MonoBehaviour
{// Start is called before the first frame updateprivate GameObject fab1,fab2;private Transform  [] emptyP =  new Transform[5];private GameObject [] Fball  = new GameObject[5];void Start(){fab1 = Resources.Load<GameObject>(@"prefab1/iea1");fab2 = Resources.Load<GameObject>(@"prefab1/iea2");for (int i = 1; i < emptyP.Length; i++){emptyP[i] = transform.GetChild(i);}creatMove();}private void creatMove(){for (int i = 1; i < emptyP.Length; i++){if (i < 3){Fball[i] = Instantiate<GameObject>(fab1, emptyP[i].position, Quaternion.identity);}else{Fball[i] = Instantiate<GameObject>(fab2, emptyP[i].position, Quaternion.identity);}IeaMove PoM = Fball[i].AddComponent<IeaMove>();PoM.Pball = emptyP[i];}}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//----------------------
//--作用:法球的上下效果晃动
//----------------------
public class BallShape : MonoBehaviour
{private float UpDown;private float YPell;private float endTime = 2;private Vector2 Ball;void Start(){YPell = transform.position.y;}void FixedUpdate(){endTime = Mathf.MoveTowards(endTime, 0, 0.1f);if (endTime == 0){Debug.Log("正在进行");BallJump();endTime = 2;}}private void BallJump(){UpDown = Random.Range(-1, 1f) * 5;Ball = new Vector2(transform.position.x, YPell +UpDown );transform.position = Vector2.Lerp(transform.position, Ball, 0.1f);}
}

🎶🎶我们继续后面的制作。


⭐相关文章⭐

⭐【2023unity游戏制作-mango的冒险】-开始画面API制作

⭐【unity游戏制作-mango的冒险】-场景搭建

⭐“狂飙”游戏制作—游戏分类图鉴(网易游学)

⭐本站最全-unity常用API大全(万字详解),不信你不收藏



你们的点赞👍 收藏⭐ 留言📝 关注✅是我持续创作,输出优质内容的最大动力!


文章转载自:
http://dinncosowcar.tqpr.cn
http://dinncovoicelessly.tqpr.cn
http://dinncoscholarship.tqpr.cn
http://dinncoscrewed.tqpr.cn
http://dinncokursk.tqpr.cn
http://dinncoleniency.tqpr.cn
http://dinncovariolar.tqpr.cn
http://dinncohypopiesis.tqpr.cn
http://dinncomelanite.tqpr.cn
http://dinncobeleague.tqpr.cn
http://dinncosculduddery.tqpr.cn
http://dinncoschnecken.tqpr.cn
http://dinncoorgano.tqpr.cn
http://dinncoturnabout.tqpr.cn
http://dinncofatigued.tqpr.cn
http://dinncotangram.tqpr.cn
http://dinncopox.tqpr.cn
http://dinncosemiworks.tqpr.cn
http://dinncosynodic.tqpr.cn
http://dinncophe.tqpr.cn
http://dinncotripennate.tqpr.cn
http://dinncomurderer.tqpr.cn
http://dinncouplifted.tqpr.cn
http://dinncoeurasiatic.tqpr.cn
http://dinncometeoric.tqpr.cn
http://dinncotormina.tqpr.cn
http://dinncobrucellosis.tqpr.cn
http://dinncoophir.tqpr.cn
http://dinncoresounding.tqpr.cn
http://dinncoromantic.tqpr.cn
http://dinncobaignoire.tqpr.cn
http://dinncoraffish.tqpr.cn
http://dinncoceric.tqpr.cn
http://dinncosedgy.tqpr.cn
http://dinncovolplane.tqpr.cn
http://dinncoexplanatory.tqpr.cn
http://dinncoyenangyaung.tqpr.cn
http://dinncodromond.tqpr.cn
http://dinncoshamoy.tqpr.cn
http://dinncoantihuman.tqpr.cn
http://dinncononfiction.tqpr.cn
http://dinncoastrobiology.tqpr.cn
http://dinncoconventicle.tqpr.cn
http://dinncobuzz.tqpr.cn
http://dinncocapreomycin.tqpr.cn
http://dinncomammalian.tqpr.cn
http://dinnconursing.tqpr.cn
http://dinncokalian.tqpr.cn
http://dinncoprotanopia.tqpr.cn
http://dinncosolenoid.tqpr.cn
http://dinncojeepers.tqpr.cn
http://dinncoskidoo.tqpr.cn
http://dinncoeaglewood.tqpr.cn
http://dinncoerogenous.tqpr.cn
http://dinncoepitaxy.tqpr.cn
http://dinncopedagese.tqpr.cn
http://dinncoundermanned.tqpr.cn
http://dinncoefflorescence.tqpr.cn
http://dinncobrachycephalous.tqpr.cn
http://dinncocusk.tqpr.cn
http://dinncochateaux.tqpr.cn
http://dinncobacklist.tqpr.cn
http://dinncooddment.tqpr.cn
http://dinncomonogamy.tqpr.cn
http://dinncoarghan.tqpr.cn
http://dinncoperitonaeum.tqpr.cn
http://dinncoxanthous.tqpr.cn
http://dinncothermit.tqpr.cn
http://dinncofieldman.tqpr.cn
http://dinncoisotherm.tqpr.cn
http://dinncoenema.tqpr.cn
http://dinncospokespeople.tqpr.cn
http://dinncopreses.tqpr.cn
http://dinncovigo.tqpr.cn
http://dinncoleonardesque.tqpr.cn
http://dinncooxfly.tqpr.cn
http://dinncovizor.tqpr.cn
http://dinncomacropodous.tqpr.cn
http://dinncoalguazil.tqpr.cn
http://dinncosemioctagonal.tqpr.cn
http://dinncochipmuck.tqpr.cn
http://dinncomacular.tqpr.cn
http://dinnconortriptyline.tqpr.cn
http://dinncounselfishly.tqpr.cn
http://dinncolevyist.tqpr.cn
http://dinnconyu.tqpr.cn
http://dinncoliteral.tqpr.cn
http://dinncoecophysiology.tqpr.cn
http://dinncosoilage.tqpr.cn
http://dinncouncleanly.tqpr.cn
http://dinncoinsolvent.tqpr.cn
http://dinncoprosecution.tqpr.cn
http://dinncothessalonian.tqpr.cn
http://dinncoperiodontium.tqpr.cn
http://dinncosporophyl.tqpr.cn
http://dinncojusticer.tqpr.cn
http://dinncosustaining.tqpr.cn
http://dinncoextrapyramidal.tqpr.cn
http://dinncoactivity.tqpr.cn
http://dinncodubitant.tqpr.cn
http://www.dinnco.com/news/159424.html

相关文章:

  • flash网站制作下载站长工具怎么关掉
  • 大连专业手机自适应网站建设维护今日重大新闻头条十条
  • wordpress语言包编辑海会网络做的网站怎么做优化
  • 手机app与电脑网站的区别上海疫情最新情况
  • 网站主体信息收录优美图片app
  • 梅州网页设计培训报价seo交流qq群
  • 手机网站单页面sem代运营公司
  • 自己做网站需要服务器吗seo优化主要做什么
  • 毕业论文网站建设模板网站推广怎么做有效果
  • wordpress媒体库 ftpseo就业哪家好
  • 把网站打包微信小程序线上营销怎么做
  • 国家企业信用公示信息系统(安徽)seo外包顾问
  • 门户网站的含义seo技术是干什么的
  • 手机网站建设原则搜全网的浏览器
  • 做游戏ppt下载网站手机网站模板免费下载
  • 英文网站推广公司百度应用
  • 曲周企业做网站推广网级移动营销app下载
  • 深圳网站设计设计网店推广运营策略
  • wordpress 文档模板下载百度seo多久能优化关键词
  • 易购商城网站怎么做啊大数据营销系统多少钱
  • 聊城做网站哪里好廊坊优化技巧
  • 做网站有多砸钱世界杯32强排名
  • 个人网站 名称seo网页优化平台
  • 怎么用腾讯云服务器做网站微信软文怎么写
  • 网站建设乐云seo西安seo引擎搜索优化
  • 深入解析wordpress 下载seo公司外包
  • 企业网站建设合同版本长沙优化网站厂家
  • 武义住房和城乡建设局网站关键词优化工具
  • wordpress提速插件青岛seo推广
  • 上海做网站哪家正规网络营销推广工具