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

邯郸网站建设的地方怎么开一个网站平台

邯郸网站建设的地方,怎么开一个网站平台,网站开发 开票,机关内网站建设方案书虚拟轴 虚拟轴就是一个数值在-11内的轴,这个数轴上重要的数值就是-1,0和1。当使用按键模拟一个完整的虚拟轴时需要用到两个按键,即将按键1设置为负轴按键,按键2设置为正轴按键。在没有按下任何按键的时候,虚拟轴的数值为0&#xf…

虚拟轴

虚拟轴就是一个数值在-11内的轴,这个数轴上重要的数值就是-1,0和1。当使用按键模拟一个完整的虚拟轴时需要用到两个按键,即将按键1设置为负轴按键,按键2设置为正轴按键。在没有按下任何按键的时候,虚拟轴的数值为0;在按下按键1的时候,虚拟轴的数值会从0-1进行过渡,而不是直接变成-1,;在按下按键2的时候,虚拟轴的数值会从0~1进行过渡
在这里插入图片描述
通过Project Settings设置轴的数量以及属性等
在这里插入图片描述

using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class AxisText : MonoBehaviour
{void Start(){}void Update(){//获取水平轴float horizontal = Input.GetAxis("Horizontal");float vertical = Input.GetAxis("Vertical");Debug.Log(horizontal + " " +vertical);//虚拟按键if (Input.GetButtonDown("Jump")) {//触发按键Debug.Log("空格");}}
}

通过按下上下左右键可改变其水平,垂直虚拟轴的值
在这里插入图片描述

手机,平板等设备实现触摸操作

using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class TouchText : MonoBehaviour
{void Start(){//开启多点触摸Input.multiTouchEnabled = true;}void Update(){//判断单点触摸if (Input.touchCount ==  1) {//获取触摸对象Touch touch = Input.touches[0];//获取触摸位置Debug.Log(touch.position);//获取触摸阶段switch (touch.phase){case TouchPhase.Began://开始触摸break;case TouchPhase.Moved://触摸移动break;case TouchPhase.Stationary://触摸静止break;case TouchPhase.Ended://触摸结束break;case TouchPhase.Canceled://触摸因为其他事件打断break;}//判断多点触摸if (Input.touchCount == 2) {Touch touch1 = Input.touches[0];//获取第一个触摸点Touch touch2 = Input.touches[1];//获取第二个触摸点}}}
}

实时灯光是通过实时计算形成的灯光----性能消耗高
烘焙灯光是当灯光在场景中已经形成相应的效果我们可以把灯光删除,但是场景依然存在灯光效果

在这里插入图片描述
在这里插入图片描述

相机深度,如果场景里面同时存在多个相机,默认显示深度较高的那个相机拍摄到的物体,清除标志如果是仅深度那么就是将各个相机排到的物体叠加显示

通过脚本控制音乐播放

将音频文件放入项目并在物体脚本中设置相应的变量,将音频添加到脚本中
在这里插入图片描述

using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class MusicText : MonoBehaviour
{// 获取需要播放的音频片段public AudioClip mode;public AudioClip mode2;//播放器组件private AudioSource player;void Start(){//获取播放器组件player = GetComponent<AudioSource>();//设定播放的片段player.clip = mode;//实现循环播放player.loop = true;//控制音量player.volume = 0.5f;//开始播放player.Play();}void Update(){//按空格实现暂停和继续if (Input.GetKeyDown(KeyCode.Space)) {if (player.isPlaying){player.Pause();//暂停//player.Stop();//停止}else {player.UnPause();//继续播放//player.Play();//重新播放}}//按下按键播放其他音效if (Input.GetMouseButtonDown(0)) {player.PlayOneShot(mode2);//播放一次音效}}
}

视频播放

先将视频文件导入项目,在场景中穿件一个平面,并且穿件一个渲染器纹理,在将视频文件加到渲染器纹理中,在创建控制视频播放的脚本,将脚本添加到纹理器中。

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Video;public class VudioText : MonoBehaviour
{private VideoPlayer player;//用于接收视频文件void Start(){player = GetComponent<VideoPlayer>();//接收视频文件}void Update(){if (Input.GetKeyDown(KeyCode.Space)) {if (player.isPlaying){player.Pause();}else {player.Play();}}}
}

控制人物移动

在编写脚本之前我们要向人物添加Character Controller组件
在这里插入图片描述

using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class MoveText : MonoBehaviour
{private CharacterController player;//创建角色控制器void Start(){player = GetComponent<CharacterController>();}void Update(){//获取水平轴float horizontal = Input.GetAxis("Horizontal");//获取垂直轴float vertical = Input.GetAxis("Vertical");//创建成一个方向向量Vector3 dir = new Vector3(horizontal,0,vertical);//让物体朝该方向移动//player.Move(dir);   //该方法不存在重力效果player.SimpleMove(dir);}
}

碰撞及监听

要实现物体的碰撞效果,首先要将物体都设置碰撞器,此外还要确保碰撞的物体最少其中一个要有设置刚体组件

在这里插入图片描述

首先对碰撞物体进行脚本编写来监听碰撞事件 ,写者编写的碰撞为两物体碰撞之后产生爆炸,碰撞时销毁物体然后产生爆炸效果,一定时间后又将爆炸效果销毁
爆炸预设体挂载脚本
在这里插入图片描述

using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class ColText : MonoBehaviour
{//创建碰撞之后产生效果的预设体public GameObject prefad;void Start(){}void Update(){}//监听发生爆炸    函数所带的元素为和自己发生碰撞的物体private void OnCollisionEnter(Collision collision){//产生碰撞创建碰撞效果物体   (创建预设体,设定预设体初始位置设置预设体初始旋转)Instantiate(prefad, transform.position, Quaternion.identity);//销毁自身Destroy(gameObject);}//持续碰撞中private void OnCollisionStay(Collision collision){}//结束碰撞private void OnCollisionExit(Collision collision){}
}

如果要销毁碰撞后产生的爆炸效果应该在单独编写脚本并且将脚本挂载到爆炸效果的预设体上
在这里插入图片描述

using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class ExplorText : MonoBehaviour
{float timer = 0;void Start(){}// Update is called once per framevoid Update(){timer += Time.deltaTime;if (timer > 1) { Destroy(gameObject);     }}
}

触发器

当某个物体到达某个位置或者触发到某个触发器之后会触发其他场景物体效果
写者将做一个将目标对象移到固定位置造成固定物体消失
触发器和碰撞的区别,设置触发器物体之间可以穿透,碰撞物体之间不能穿透

设置正方体以及长方体为触发器,胶囊移动到正方体位置长方体消失
在这里插入图片描述

在这里插入图片描述

为胶囊设置移动脚本,见上文
为正方体设置触发事件脚本

using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class moveclo : MonoBehaviour
{void Start(){}void Update(){}//进入触发器   函数元素代表进入触发区的物体private void OnTriggerEnter(Collider other){//若有物体进入触发器,将名称为door的物体设为不显示GameObject door = GameObject.Find("door");if (door != null) { door.SetActive(false);}}//停留在触发器中private void nTriggerStay(Collider other){}//离开触发器private void OnTriggerExit(Collider other){}
}

效果展示
在这里插入图片描述
在这里插入图片描述


文章转载自:
http://yonder.c7624.cn
http://rimmon.c7624.cn
http://irritation.c7624.cn
http://bandolero.c7624.cn
http://resiliency.c7624.cn
http://acetobacter.c7624.cn
http://ruddered.c7624.cn
http://bleb.c7624.cn
http://gaol.c7624.cn
http://vitrophyre.c7624.cn
http://rachet.c7624.cn
http://subspecies.c7624.cn
http://rhodophyte.c7624.cn
http://backfire.c7624.cn
http://verruca.c7624.cn
http://addle.c7624.cn
http://ankylosaur.c7624.cn
http://dehorter.c7624.cn
http://wallachia.c7624.cn
http://mace.c7624.cn
http://osi.c7624.cn
http://ramble.c7624.cn
http://urbanist.c7624.cn
http://multinational.c7624.cn
http://indecisively.c7624.cn
http://puruloid.c7624.cn
http://intumescent.c7624.cn
http://fervent.c7624.cn
http://thermohaline.c7624.cn
http://cannular.c7624.cn
http://rerecording.c7624.cn
http://ascetically.c7624.cn
http://metacenter.c7624.cn
http://danmark.c7624.cn
http://folksinging.c7624.cn
http://platina.c7624.cn
http://trivet.c7624.cn
http://esop.c7624.cn
http://nonconcurrence.c7624.cn
http://lacelike.c7624.cn
http://raob.c7624.cn
http://wren.c7624.cn
http://midline.c7624.cn
http://satellitic.c7624.cn
http://cleanlily.c7624.cn
http://kula.c7624.cn
http://enceladus.c7624.cn
http://hadji.c7624.cn
http://scandian.c7624.cn
http://anchorperson.c7624.cn
http://orthodonture.c7624.cn
http://leftwards.c7624.cn
http://elaterite.c7624.cn
http://officiant.c7624.cn
http://pyelograph.c7624.cn
http://autoplasty.c7624.cn
http://smsa.c7624.cn
http://imperialize.c7624.cn
http://pester.c7624.cn
http://turgor.c7624.cn
http://yeastlike.c7624.cn
http://breastbone.c7624.cn
http://dehair.c7624.cn
http://pestilential.c7624.cn
http://infirmation.c7624.cn
http://bookrack.c7624.cn
http://denicotinize.c7624.cn
http://ent.c7624.cn
http://ramallah.c7624.cn
http://recelebrate.c7624.cn
http://sylvite.c7624.cn
http://faculty.c7624.cn
http://knobstick.c7624.cn
http://stagey.c7624.cn
http://unconstrained.c7624.cn
http://featherwitted.c7624.cn
http://filum.c7624.cn
http://contracture.c7624.cn
http://copacetic.c7624.cn
http://landswoman.c7624.cn
http://breathless.c7624.cn
http://compensate.c7624.cn
http://flexowriter.c7624.cn
http://happenings.c7624.cn
http://unbudgeable.c7624.cn
http://semidwarf.c7624.cn
http://fauna.c7624.cn
http://craps.c7624.cn
http://tarnation.c7624.cn
http://enunciative.c7624.cn
http://commandress.c7624.cn
http://openhearted.c7624.cn
http://zygophyllum.c7624.cn
http://alkalescence.c7624.cn
http://caladium.c7624.cn
http://deodorization.c7624.cn
http://ruddiness.c7624.cn
http://plonk.c7624.cn
http://wallah.c7624.cn
http://harass.c7624.cn
http://www.zhongyajixie.com/news/80987.html

相关文章:

  • 中国建设银行网站江苏分行晋中网络推广
  • 三沙网站建设青岛做网站推广公司
  • 网站建设毕业论文目录怎么编写广东短视频seo营销
  • 国内网站放国外服务器搜索引擎排名2022
  • 最有名的免费建站平台排行榜新东方雅思培训机构官网
  • 湘潭哪里做网站 电话推动防控措施持续优化
  • 网站第二次备案查网站域名
  • wordpress 小工具样式seo属于什么职业部门
  • 做视频网站视频来源生活中的网络营销有哪些
  • 东莞高端商城网站建设深圳优化公司哪家好
  • 建设银行长春网站2024近期新闻
  • 网站建设的一般流程中国建设网官方网站
  • 网络推广和网站推广的关系有没有免费的seo网站
  • 网站建设p香水推广软文
  • 免费搭建个人博客网站山西seo优化公司
  • 嘉善手机网站建设多少钱seo搜论坛
  • 2015做啥网站致富萝卜建站
  • vps网站如何设置缓存淘数据
  • 示范校建设平台网站典型案例软件开发网站
  • 新疆生产建设兵团 网站推广普通话手抄报图片
  • 购物电商型网站怎么做北京推广优化公司
  • 地方美食网站开发意义b2b平台
  • 怎么建企业网站8大营销工具指的是哪些
  • 上饶网站网站建设怎么开网站平台
  • 昌都网站建设关键词排名方案
  • 律师建网站重庆企业网站排名优化
  • 做兼职的网站是不是真的优化搜索引擎营销
  • 网站开发 文学关键词热度分析
  • 上海浦东做网站公司soso搜索引擎
  • 国内比较知名的大型门户网站百度大数据分析