![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
U3D
weixin_39562523
这个作者很懒,什么都没留下…
展开
-
修改物体材质状态及颜色
foreach (Transform child in GetComponentsInChildren<Transform>(true)) { if (child.gameObject.GetComponent<Renderer>() != null) { if (child.gameObject.GetComponent<Renderer>().materials != n.原创 2022-03-18 15:50:51 · 308 阅读 · 0 评论 -
进入退出
原创 2020-05-26 12:40:06 · 177 阅读 · 0 评论 -
改变材质,改变材质颜色,改变材质透明状态
两个代码,1。材质原代码,放入项目。2.调用方法,挂在物体上01:::using System.Collections;using System.Collections.Generic;using UnityEngine;public class MaterialModify : MonoBehaviour{ public enum RenderingMode...原创 2020-03-18 09:23:05 · 516 阅读 · 0 评论 -
物体出现在目标物体的某个方向
this.gameObject.transform.LookAt(VR_Camera.transform); this.gameObject.transform.position = VR_Camera.transform.position + VR_Camera.transform.forward * L; this.gameObject.tran...原创 2019-04-04 16:04:00 · 121 阅读 · 0 评论 -
物体旋转到指定角度
public float Speed; Quaternion targetAngels; public GameObject gam; // Use this for initialization void Start () { targetAngels = Quaternion.Euler(90, 0, 0); } ...原创 2019-04-04 14:42:26 · 860 阅读 · 0 评论 -
等待时间脚本
using System.Collections;using System.Collections.Generic;using UnityEngine;public class CeLiangYi : MonoBehaviour { public GameObject CeLiangYi_Button; //测量仪开关 public ModelXianShi xianShi; ...原创 2018-04-27 15:29:02 · 360 阅读 · 0 评论 -
给预制动画添加事件
这个不要原创 2018-04-27 18:01:01 · 200 阅读 · 1 评论 -
两点间生成直线
using System.Collections;using System.Collections.Generic;using UnityEngine;public class LiangDianJianDeLianXian : MonoBehaviour { public GameObject WuTi01; public GameObject WuTi02;...原创 2018-09-12 18:29:25 · 1243 阅读 · 1 评论 -
手柄震动
using System;using System.Collections;using System.Collections.Generic;using UnityEngine;/// <summary>/// 手柄控制器脚本/// </summary>/// public enum HandleControllerShakeType{ Defu...原创 2018-11-30 16:19:23 · 885 阅读 · 1 评论 -
协程
private void Update() { if (i == true) { i = false; //等待三秒跳转铝包带 StartCoroutine(WaitEvent(3.0f)); // 括号中的数字就是等待的时间,按秒算 } ...原创 2018-12-21 10:37:59 · 107 阅读 · 0 评论 -
随机
随机方法名就是Random.Range()原创 2018-12-22 14:59:31 · 111 阅读 · 0 评论 -
vrtk攀爬
头盔添加物体添加原创 2019-01-24 09:49:40 · 531 阅读 · 0 评论 -
判断物体自身位置是否发生变化,是,手柄震动
using System.Collections;using System.Collections.Generic;using UnityEngine;public class YiDongZhenDong : MonoBehaviour { public Transform Trans_Move; //判...原创 2019-01-09 17:41:43 · 983 阅读 · 0 评论 -
材质球图片的运动
using System.Collections;using System.Collections.Generic;using UnityEngine;public class PaTiJianTou : MonoBehaviour { [Range(0f, 1f)] public float speed_x = 0; [Range(0f, 1f)] ...原创 2019-02-15 14:07:47 · 178 阅读 · 0 评论 -
给物体添加摄像机
1 创建一个新的摄像机挂在物体上2.创建一个RenderTexture 挂在摄像机上3.创建一个UI RAW Image图片,将RenderTexture贴图放上去完成原创 2019-02-19 17:25:02 · 166 阅读 · 1 评论 -
移动震动
using System.Collections;using System.Collections.Generic;using UnityEngine;public class YiDongZhenDong : MonoBehaviour { public Transform Trans_Move; //判断的物...原创 2019-03-06 09:34:34 · 145 阅读 · 0 评论 -
物体朝向某一个点移动
在update里面运行float step = speed * Time.deltaTime; //物体朝向木一个点移动 gameObject.transform.localPosition = Vector3.MoveTowards(gameObject.transform.localPosition, new Vector3(149....原创 2019-03-06 09:42:01 · 1048 阅读 · 0 评论