Wall 그리기 기능 리팩토링
This commit is contained in:
@@ -2973,72 +2973,6 @@ RectTransform:
|
|||||||
m_AnchoredPosition: {x: 0, y: 0}
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
m_SizeDelta: {x: 4, y: 20}
|
m_SizeDelta: {x: 4, y: 20}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!1001 &812349387
|
|
||||||
PrefabInstance:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Modification:
|
|
||||||
serializedVersion: 3
|
|
||||||
m_TransformParent: {fileID: 1093055756}
|
|
||||||
m_Modifications:
|
|
||||||
- target: {fileID: 3963811325703941763, guid: a906cd4ab09260143b9d87e622d9e458, type: 3}
|
|
||||||
propertyPath: m_Name
|
|
||||||
value: WallBuilder
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 3963811325703941763, guid: a906cd4ab09260143b9d87e622d9e458, type: 3}
|
|
||||||
propertyPath: m_IsActive
|
|
||||||
value: 1
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 7756644939596186566, guid: a906cd4ab09260143b9d87e622d9e458, type: 3}
|
|
||||||
propertyPath: m_LocalPosition.x
|
|
||||||
value: 1.3484559
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 7756644939596186566, guid: a906cd4ab09260143b9d87e622d9e458, type: 3}
|
|
||||||
propertyPath: m_LocalPosition.y
|
|
||||||
value: 3.002852
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 7756644939596186566, guid: a906cd4ab09260143b9d87e622d9e458, type: 3}
|
|
||||||
propertyPath: m_LocalPosition.z
|
|
||||||
value: -2.1850286
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 7756644939596186566, guid: a906cd4ab09260143b9d87e622d9e458, type: 3}
|
|
||||||
propertyPath: m_LocalRotation.w
|
|
||||||
value: 1
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 7756644939596186566, guid: a906cd4ab09260143b9d87e622d9e458, type: 3}
|
|
||||||
propertyPath: m_LocalRotation.x
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 7756644939596186566, guid: a906cd4ab09260143b9d87e622d9e458, type: 3}
|
|
||||||
propertyPath: m_LocalRotation.y
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 7756644939596186566, guid: a906cd4ab09260143b9d87e622d9e458, type: 3}
|
|
||||||
propertyPath: m_LocalRotation.z
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 7756644939596186566, guid: a906cd4ab09260143b9d87e622d9e458, type: 3}
|
|
||||||
propertyPath: m_LocalEulerAnglesHint.x
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 7756644939596186566, guid: a906cd4ab09260143b9d87e622d9e458, type: 3}
|
|
||||||
propertyPath: m_LocalEulerAnglesHint.y
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 7756644939596186566, guid: a906cd4ab09260143b9d87e622d9e458, type: 3}
|
|
||||||
propertyPath: m_LocalEulerAnglesHint.z
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
m_RemovedComponents: []
|
|
||||||
m_RemovedGameObjects: []
|
|
||||||
m_AddedGameObjects: []
|
|
||||||
m_AddedComponents: []
|
|
||||||
m_SourcePrefab: {fileID: 100100000, guid: a906cd4ab09260143b9d87e622d9e458, type: 3}
|
|
||||||
--- !u!4 &812349388 stripped
|
|
||||||
Transform:
|
|
||||||
m_CorrespondingSourceObject: {fileID: 7756644939596186566, guid: a906cd4ab09260143b9d87e622d9e458, type: 3}
|
|
||||||
m_PrefabInstance: {fileID: 812349387}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
--- !u!1 &827571245
|
--- !u!1 &827571245
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -4244,7 +4178,6 @@ Transform:
|
|||||||
- {fileID: 1149817090}
|
- {fileID: 1149817090}
|
||||||
- {fileID: 636283413}
|
- {fileID: 636283413}
|
||||||
- {fileID: 2021424132}
|
- {fileID: 2021424132}
|
||||||
- {fileID: 812349388}
|
|
||||||
- {fileID: 538683123}
|
- {fileID: 538683123}
|
||||||
- {fileID: 617235297}
|
- {fileID: 617235297}
|
||||||
- {fileID: 749092880}
|
- {fileID: 749092880}
|
||||||
|
|||||||
@@ -12,5 +12,23 @@ namespace XED
|
|||||||
Select,
|
Select,
|
||||||
Setting
|
Setting
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum VirtualPoint
|
||||||
|
{
|
||||||
|
LeftTop,
|
||||||
|
LeftBottom,
|
||||||
|
RightTop,
|
||||||
|
RightBottom,
|
||||||
|
LeftCenter,
|
||||||
|
RightCenter,
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum BuilderState
|
||||||
|
{
|
||||||
|
None,
|
||||||
|
PointModfiy,
|
||||||
|
PointRemove,
|
||||||
|
Drawing
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ using TriLibCore.Dae.Schema;
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using XRLib;
|
using XRLib;
|
||||||
|
|
||||||
namespace XED
|
namespace XED.Manage
|
||||||
{
|
{
|
||||||
public class MeshCreator : MonoBehaviour,ISingle
|
public class MeshCreator : Manager
|
||||||
{
|
{
|
||||||
Vector3[] vertices;
|
Vector3[] vertices;
|
||||||
int[] triangles;
|
int[] triangles;
|
||||||
@@ -15,6 +15,11 @@ namespace XED
|
|||||||
private MeshFilter meshfilter;
|
private MeshFilter meshfilter;
|
||||||
//private Vector3 offset = Vector3.zero;
|
//private Vector3 offset = Vector3.zero;
|
||||||
|
|
||||||
|
public override void Init()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public void MeshDeformer<T>(HashSet<T> type)
|
public void MeshDeformer<T>(HashSet<T> type)
|
||||||
{
|
{
|
||||||
if(type is HashSet<Floor>)
|
if(type is HashSet<Floor>)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ using System.Linq;
|
|||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using XRLib;
|
using XRLib;
|
||||||
using static XED.WallBuilder;
|
using static XED.Enums;
|
||||||
using Color = UnityEngine.Color;
|
using Color = UnityEngine.Color;
|
||||||
|
|
||||||
namespace XED
|
namespace XED
|
||||||
|
|||||||
@@ -9,28 +9,13 @@ using XRLib;
|
|||||||
using XED.Interfaces;
|
using XED.Interfaces;
|
||||||
using XED.Manage;
|
using XED.Manage;
|
||||||
using XED.RuntimeGizmo;
|
using XED.RuntimeGizmo;
|
||||||
|
using Object = UnityEngine.Object;
|
||||||
|
using static XED.Enums;
|
||||||
|
|
||||||
namespace XED
|
namespace XED.Manage
|
||||||
{
|
{
|
||||||
public class WallBuilder : MonoBehaviour, ISingle, IInputHandler, IModeController
|
public class WallBuilder : Manager, IInputHandler, IModeController
|
||||||
{
|
{
|
||||||
public enum VirtualPoint
|
|
||||||
{
|
|
||||||
LeftTop,
|
|
||||||
LeftBottom,
|
|
||||||
RightTop,
|
|
||||||
RightBottom,
|
|
||||||
LeftCenter,
|
|
||||||
RightCenter,
|
|
||||||
}
|
|
||||||
public enum BuilderState
|
|
||||||
{
|
|
||||||
None,
|
|
||||||
PointModfiy,
|
|
||||||
PointRemove,
|
|
||||||
Drawing
|
|
||||||
}
|
|
||||||
|
|
||||||
public float thickness;
|
public float thickness;
|
||||||
private GameObject renderParent;
|
private GameObject renderParent;
|
||||||
private Material lineMat;
|
private Material lineMat;
|
||||||
@@ -81,7 +66,8 @@ namespace XED
|
|||||||
wallLines.Add(wallLine);
|
wallLines.Add(wallLine);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public override void AfterAwake()
|
|
||||||
|
public override void Init()
|
||||||
{
|
{
|
||||||
renderParent = new GameObject("LineRenderParent");
|
renderParent = new GameObject("LineRenderParent");
|
||||||
lineMat = Resources.Load<Material>("Materials/Mat_LineRender");
|
lineMat = Resources.Load<Material>("Materials/Mat_LineRender");
|
||||||
@@ -90,7 +76,7 @@ namespace XED
|
|||||||
prf_Wall = Resources.Load<Wall>("Prefabs/PRF_Wall");
|
prf_Wall = Resources.Load<Wall>("Prefabs/PRF_Wall");
|
||||||
prf_WallGroup = Resources.Load<WallGroup>("Prefabs/PRF_WallGroup");
|
prf_WallGroup = Resources.Load<WallGroup>("Prefabs/PRF_WallGroup");
|
||||||
|
|
||||||
meshCreator = FindSingle<MeshCreator>();
|
meshCreator = ManagerHub.instance.Get<MeshCreator>();
|
||||||
handler = GetInputHandler();
|
handler = GetInputHandler();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,14 +132,14 @@ namespace XED
|
|||||||
{
|
{
|
||||||
//ToDo..연결된 포인트가 없는 Point찾아서 제거
|
//ToDo..연결된 포인트가 없는 Point찾아서 제거
|
||||||
DisconnectLine(removeWalls[i]);
|
DisconnectLine(removeWalls[i]);
|
||||||
Destroy(removeWalls[i].gameObject);
|
Object.Destroy(removeWalls[i].gameObject);
|
||||||
}
|
}
|
||||||
Remove(lp);
|
Remove(lp);
|
||||||
}
|
}
|
||||||
|
|
||||||
public LinePoint CreateLinePoint(Vector3 pos)
|
public LinePoint CreateLinePoint(Vector3 pos)
|
||||||
{
|
{
|
||||||
var result = Instantiate(prf_LinePoint);
|
var result = Object.Instantiate(prf_LinePoint);
|
||||||
result.transform.SetParent(renderParent.transform);
|
result.transform.SetParent(renderParent.transform);
|
||||||
result.name = cc++.ToString();
|
result.name = cc++.ToString();
|
||||||
result.transform.position = pos;
|
result.transform.position = pos;
|
||||||
@@ -175,7 +161,7 @@ namespace XED
|
|||||||
|
|
||||||
private Wall CreateWall(LinePoint lcp, LinePoint rcp)
|
private Wall CreateWall(LinePoint lcp, LinePoint rcp)
|
||||||
{
|
{
|
||||||
var result = Instantiate(prf_Wall);
|
var result = Object.Instantiate(prf_Wall);
|
||||||
result.Generate(lcp, rcp, lineMat, thickness);
|
result.Generate(lcp, rcp, lineMat, thickness);
|
||||||
result.name = "WallLine" + index++;
|
result.name = "WallLine" + index++;
|
||||||
walls.Add(result);
|
walls.Add(result);
|
||||||
@@ -339,7 +325,7 @@ namespace XED
|
|||||||
{
|
{
|
||||||
linePoints.Remove(lp);
|
linePoints.Remove(lp);
|
||||||
pointToWall.Remove(lp);
|
pointToWall.Remove(lp);
|
||||||
Destroy(lp.gameObject);
|
Object.Destroy(lp.gameObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BuildWall(Vector3 endPos)
|
void BuildWall(Vector3 endPos)
|
||||||
@@ -426,7 +412,7 @@ namespace XED
|
|||||||
pointToWall.Remove(rcp);
|
pointToWall.Remove(rcp);
|
||||||
}
|
}
|
||||||
wall.Deselect();
|
wall.Deselect();
|
||||||
Destroy(wall.gameObject);
|
Object.Destroy(wall.gameObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
Wall BuildContinuesWall(Vector3 p)
|
Wall BuildContinuesWall(Vector3 p)
|
||||||
@@ -684,7 +670,7 @@ namespace XED
|
|||||||
|
|
||||||
private WallGroup CreateWallGroup()
|
private WallGroup CreateWallGroup()
|
||||||
{
|
{
|
||||||
var group = Instantiate(prf_WallGroup);
|
var group = Object.Instantiate(prf_WallGroup);
|
||||||
|
|
||||||
groupTable.Add(group, new());
|
groupTable.Add(group, new());
|
||||||
wallgroups.Add(group);
|
wallgroups.Add(group);
|
||||||
@@ -1026,7 +1012,7 @@ namespace XED
|
|||||||
linePoints.Remove(handlePoint);
|
linePoints.Remove(handlePoint);
|
||||||
pointToWall.Remove(handlePoint);
|
pointToWall.Remove(handlePoint);
|
||||||
handlePoint.Release();
|
handlePoint.Release();
|
||||||
Destroy(handlePoint.gameObject);
|
Object.Destroy(handlePoint.gameObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pilePoint != null)
|
if (pilePoint != null)
|
||||||
@@ -1044,7 +1030,7 @@ namespace XED
|
|||||||
{
|
{
|
||||||
walls.Remove(tempWall);
|
walls.Remove(tempWall);
|
||||||
tempWall.Release();
|
tempWall.Release();
|
||||||
Destroy(tempWall.gameObject);
|
Object.Destroy(tempWall.gameObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
tempWall = null;
|
tempWall = null;
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ namespace XED.Manage
|
|||||||
Join(new NodeGizmoController());
|
Join(new NodeGizmoController());
|
||||||
Join(new AGVNodeLinkManager());
|
Join(new AGVNodeLinkManager());
|
||||||
Join(new AGVManager());
|
Join(new AGVManager());
|
||||||
|
Join(new WallBuilder());
|
||||||
|
Join(new MeshCreator());
|
||||||
|
|
||||||
foreach(var m in managers)
|
foreach(var m in managers)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
using XRLib.UI;
|
using XRLib.UI;
|
||||||
using static XED.WallBuilder;
|
using static XED.Enums;
|
||||||
|
|
||||||
namespace XED.UI
|
namespace XED.UI
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user