在学的时候被我妹妹打扰,呜呜呜!
在学的时候被我妹妹打扰,呜呜呜!
下不了
using UnityEngine;
public class MapTexture : MonoBehaviour
{
void Start()
{
var mf = GetComponent<MeshFilter>();
var mesh = new Mesh();
if (mf != null)
mesh = mf.mesh;
if (mesh == null || mesh.uv.Length != 24)
{
Debug.Log("Attach To Cube");
return;
}
var uvs = mesh.uv;
//back
uvs[0] = new Vector2(0.0f, 0.0f);
uvs[1] = new Vector2(0.333f, 0.0f);
uvs[2] = new Vector2(0.0f, 0.333f);
uvs[3] = new Vector2(0.333f, 0.333f);
//top
uvs[8] = new Vector2(0.334f, 0.0f);
uvs[9] = new Vector2(0.666f, 0.0f);
uvs[4] = new Vector2(0.334f, 0.333f);
uvs[5] = new Vector2(0.666f, 0.333f);
//front
uvs[10] = new Vector2(0.667f, 0.0f);
uvs[11] = new Vector2(1.0f, 0.0f);
uvs[6] = new Vector2(0.667f, 0.333f);
uvs[7] = new Vector2(1.0f, 0.333f);
//bottom
uvs[12] = new Vector2(0.0f, 0.334f);
uvs[15] = new Vector2(0.333f, 0.334f);
uvs[13] = new Vector2(0.0f, 0.666f);
uvs[14] = new Vector2(0.333f, 0.666f);
//left
uvs[16] = new Vector2(0.334f, 0.334f);
uvs[19] = new Vector2(0.666f, 0.334f);
uvs[17] = new Vector2(0.334f, 0.666f);
uvs[18] = new Vector2(0.666f, 0.666f);
//right
uvs[20] = new Vector2(0.667f, 0.334f);
uvs[23] = new Vector2(1.0f, 0.334f);
uvs[21] = new Vector2(0.667f, 0.666f);
uvs[22] = new Vector2(1.0f, 0.666f);
mesh.uv = uvs;
}
}
mjkn
按住 Ctrl 移动,就会一个单位一个单位的移动了。
人体快乐rjtiojsdohfioeshohsidhf圣诞节覅与哎哟哎呀规格图故意给提供蛋糕噶啥我卡号是健康
project--ctrl+N创建场景文件夹
ctrl+D复制方块
按住ctrl拖动方块,ctrl+d以单位移动
unity
Ctrl+D 复制物体
按住 Ctrl 拖动物体,为一个单位拖动
uvs[0] = Vector2(0.0, 0.0);
uvs[1] = Vector2(0.333, 0.0);
uvs[2] = Vector2(0.0, 0.333);
uvs[3] = Vector2(0.333, 0.333);
uvs[8] = Vector2(0.334, 0.0);
uvs[9] = Vector2(0.666, 0.0);
uvs[4] = Vector2(0.334, 0.333);
uvs[5] = Vector2(0.666, 0.333);
uvs[10] = Vector2(0.667, 0.0);
uvs[11] = Vector2(1.0, 0.0);
uvs[6] = Vector2(0.667, 0.333);
uvs[7] = Vector2(1.0, 0.333);
uvs[12] = Vector2(0.0, 0.334);
uvs[14] = Vector2(0.333, 0.334);
uvs[15] = Vector2(0.0, 0.666);
uvs[13] = Vector2(0.333, 0.666);
uvs[16] = Vector2(0.334, 0.334);
uvs[19] = Vector2(0.666, 0.334);
uvs[17] = Vector2(0.334, 0.666);
uvs[18] = Vector2(0.666, 0.666);
uvs[23] = Vector2(0.667, 0.334);
uvs[20] = Vector2(1.00, 0.334);
uvs[22] = Vector2(0.667, 0.666);
uvs[21] = Vector2(1.0, 0.666);
dwsdwdwqe
公众号回复 125 要源代码图片
1.cube贴图
2.平行光移动
3.物体点击删除
4.cube操作
1231231321
6323
会不会是输入法问题
按着Ctrl移动是按照单位移动
prefabs?
引入角色 standard assets
在移动时,要记住输入法保持英文状态