unity
kexi111
这个作者很懒,什么都没留下…
展开
-
c#键盘触发事件
if (Input.GetKeyDown(KeyCode.W)) { //Destroy(cube); cube.SetActive(false); ball.SetActive(true); }原创 2021-09-18 15:24:35 · 737 阅读 · 0 评论 -
unity位移动画
using System.Collections;using System.Collections.Generic;using UnityEngine;public class separationAniControl : MonoBehaviour{ public float f_distance; public GameObject rock_a; public GameObject rock_b; float f_rockY; float f_spee原创 2020-12-10 15:19:48 · 858 阅读 · 0 评论 -
unity物体在屏幕上连线
public class communication: MonoBehaviour{ public Transform gamaOBj1; public Transform imsge; public Transform gamaOBj2; Vector3 gamaOBj1ViewportPoint; Vector3 gamaOBj2ViewportPoint; float image_x; float image_y; public原创 2020-10-22 10:34:19 · 612 阅读 · 0 评论 -
unity 物体沿某一坐标轴旋转
obj.transform.Rotate(0, fRotateSpeed * Time.deltaTime, 0, Space.Self);原创 2020-09-11 11:35:47 · 725 阅读 · 0 评论 -
unity获取父物体
var Father = gameObject.transform.parent;原创 2020-09-11 11:25:54 · 14291 阅读 · 0 评论 -
unity 获取另一对象脚本上的数据
float range= objA.GetComponent<A_script>().fRangA;原创 2020-09-11 11:25:01 · 1757 阅读 · 0 评论 -
unity 控制对象显示隐藏
obj.SetActive(true);obj.SetActive(false);原创 2020-09-11 11:21:15 · 452 阅读 · 0 评论 -
复制A并使其成为B的子物体
GameObject obj = Instantiate(objA) as GameObject;obj.transform.parent = objB.transform;原创 2020-09-11 11:19:46 · 118 阅读 · 0 评论 -
unity按名字查找子物体并销毁
foreach (Transform t in csCell.GetComponentsInChildren<Transform>())//检测目标物体所有名字为aaa的子物体 { if (t.name == "aaa") { Destroy(t.gameObject);//销毁名字为BeiDong(...原创 2020-09-11 11:15:40 · 1143 阅读 · 0 评论 -
##unity Cross Section Shader透明问题
##unity Cross Section Shader透明问题Shader "CrossSection/Transparent/Bumped Specular" { Properties { _Color ("Main Color", Color) = (1,1,1,1) _CrossColor("Cross Section Color", Color) = (1,1,1,1) _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5原创 2020-08-14 10:03:19 · 595 阅读 · 1 评论 -
unity c# 改变物体贴图,颜色,透明度,缩放,碰撞检测
unity c# 改变物体贴图,颜色,透明度,缩放,碰撞检测using UnityEngine;using UnityEngine.UI;using System;using Color = UnityEngine.Color;public class Danbscontro : MonoBehaviour{ //Dropdown dropdownLinetype; // Dropdown dropdownLinewidth; public Texture linet原创 2020-08-06 09:02:47 · 1265 阅读 · 0 评论