资源简介
u3d圈里流行了一种地形转换器,用于所有被3D开发工具(Maya,EarthSculpto,3DS Max,Blender等)创建的几何体。
代码片段和文件信息
//Update SC
using UnityEngine;
using UnityEditor;
using System.Collections;
[CustomEditor(typeof(T4MObjSC))]
[CanEditMultipleobjects]
public class T4MExtendsSC : Editor {
int layerMask = 1073741824;
bool ToggleF = false;
Texture2D[] UndoObj;
static Color[] terrainBay2;
Gameobject PlantObj;
Gameobject PlantObjPreview;
Gameobject currentObjPreview;
float rotationCorrect;
T4MPlantObjSC[] T4MPlantObjGet;
int CheckPlacement;
int State;
int oldState;
float RandomDistance;
Vector3 RandomRotation;
bool oldRandomRot;
int plantmodval;
float oldSize;
Renderer[] T4MPlantRenderer;
string OldActivStat = ““;
Collider[] T4MPreviewColl;
Renderer[] LodObj;
static ArrayList onPlayModeInstanceFolder= new ArrayList();
static ArrayList onPlayModeInstanceGroup= new ArrayList();
static ArrayList onPlayModeInstancePos= new ArrayList();
static ArrayList onPlayModeInstanceRot= new ArrayList();
static ArrayList onPlayModeInstanceSize= new ArrayList();
static ArrayList onPlayModeDestroyed= new ArrayList();
static bool Play;
void OnSceneGUI () {
if (T4MSC.T4MPreview && T4MSC.T4MMenuToolbar == 3)
Painter();
else if (T4MSC.T4MMenuToolbar == 4)
Planting ();
else State = 3;
if (oldState != State || !PlantObjPreview && T4MSC.T4MMenuToolbar == 4 ||T4MSC.T4MobjectPlant[T4MSC.T4MPlantSel] == null && T4MSC.T4MMenuToolbar == 4){
MeshRenderer[] prev = Gameobject.FindobjectsOfType(typeof(MeshRenderer)) as MeshRenderer[];
foreach(MeshRenderer go in prev)
{
if(go.hideFlags == HideFlags.HideInHierarchy || go.name == “previewT4M“)
{
go.hideFlags=0;
DestroyImmediate (go.gameobject);
}
}
oldState = State;
}
}
void Painter (){
if (State != 1)
State = 1;
Event e = Event.current;
if (e.type == EventType.KeyDown && e.keyCode==KeyCode.T){
if (T4MSC.T4MActived != “Activated“)
T4MSC.T4MActived = “Activated“;
else T4MSC.T4MActived = “Deactivated“;
}
if (T4MSC.T4MPreview && T4MSC.T4MActived == “Activated“ && T4MSC.T4MPreview.enabled == false || T4MSC.T4MPreview.enabled == false){
if(
T4MSC.PaintPrev != T4MSC.PaintHandle.Follow_Normal_Circle &&
T4MSC.PaintPrev != T4MSC.PaintHandle.Follow_Normal_WireCircle &&
T4MSC.PaintPrev != T4MSC.PaintHandle.Hide_preview
){
T4MSC.T4MPreview.enabled = true;
}
}else if (T4MSC.T4MPreview && T4MSC.T4MActived == “Deactivated“ && T4MSC.T4MPreview.enabled == true || T4MSC.T4MPreview.enabled == true){
if (T4MSC.PaintPrev != T4MSC.PaintHandle.Classic){
T4MSC.T4MPreview.enabled = false;
}
}
if (T4MSC.T4MActived == “Activated“){
HandleUtility.AddDefaultControl (0);
RaycastHit raycastHit = new RaycastHit();
Ray terrain = HandleUtility.GUIPointToWorldRay (e.mousePosition);
if (e.type == EventType.KeyDown && e.keyCode==KeyCode.KeypadPlus){
T4MSC.brushSize += 1;
}else if (e.type == EventType.KeyDow
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 25631 2018-03-29 12:21 T4M\Editor\T4MExtendsSC.cs
..A..H. 231 2018-03-28 12:43 T4M\Editor\T4MExtendsSC.cs.me
文件 197719 2018-03-28 12:43 T4M\Editor\T4MSC.cs
..A..H. 231 2018-03-28 12:43 T4M\Editor\T4MSC.cs.me
..A..H. 200 2018-03-28 12:43 T4M\Editor.me
文件 211 2018-03-28 12:43 T4M\sc
..A..H. 231 2018-03-28 12:43 T4M\sc
文件 3074 2018-03-28 12:43 T4M\sc
..A..H. 231 2018-03-28 12:43 T4M\sc
文件 10587 2018-03-28 12:43 T4M\sc
..A..H. 231 2018-03-28 12:43 T4M\sc
文件 111 2018-03-28 12:43 T4M\sc
..A..H. 231 2018-03-28 12:43 T4M\sc
文件 115 2018-03-28 12:43 T4M\sc
..A..H. 231 2018-03-28 12:43 T4M\sc
..A..H. 200 2018-03-28 12:43 T4M\sc
文件 1246 2018-03-28 12:43 T4M\Tutorial\sc
..A..H. 231 2018-03-28 12:43 T4M\Tutorial\sc
文件 777 2018-03-28 12:43 T4M\Tutorial\sc
..A..H. 231 2018-03-28 12:43 T4M\Tutorial\sc
文件 665 2018-03-28 12:43 T4M\Tutorial\sc
..A..H. 231 2018-03-28 12:43 T4M\Tutorial\sc
..A..H. 200 2018-03-28 12:43 T4M\Tutorial\sc
..A..H. 200 2018-03-28 12:43 T4M\Tutorial.me
目录 0 2018-03-28 12:43 T4M\Tutorial\sc
目录 0 2018-03-29 12:21 T4M\Editor
目录 0 2018-03-28 12:43 T4M\sc
目录 0 2018-03-28 12:43 T4M\Tutorial
目录 0 2018-03-28 12:43 T4M
----------- --------- ---------- ----- ----
............此处省略2个文件信息
评论
共有 条评论