데이터파이프라인 타워 부분 개선
This commit is contained in:
@@ -2,6 +2,7 @@ using Unity.Netcode;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AI;
|
||||
using Northbound;
|
||||
|
||||
namespace Northbound.Editor
|
||||
{
|
||||
@@ -147,9 +148,35 @@ namespace Northbound.Editor
|
||||
|
||||
private static void SetupTowerComponents(GameObject go)
|
||||
{
|
||||
Transform t = go.transform;
|
||||
t.localPosition = Vector3.zero;
|
||||
t.localRotation = Quaternion.identity;
|
||||
t.localScale = Vector3.one;
|
||||
|
||||
if (go.GetComponent<NetworkObject>() == null)
|
||||
go.AddComponent<NetworkObject>();
|
||||
|
||||
if (go.GetComponent<Building>() == null)
|
||||
go.AddComponent<Building>();
|
||||
|
||||
if (go.GetComponent<TowerDataComponent>() == null)
|
||||
go.AddComponent<TowerDataComponent>();
|
||||
|
||||
if (go.GetComponent<BoxCollider>() == null)
|
||||
{
|
||||
BoxCollider collider = go.AddComponent<BoxCollider>();
|
||||
collider.size = new Vector3(1f, 2f, 1f);
|
||||
collider.center = new Vector3(0f, 1f, 0f);
|
||||
}
|
||||
|
||||
if (go.GetComponent<NavMeshObstacle>() == null)
|
||||
{
|
||||
NavMeshObstacle obstacle = go.AddComponent<NavMeshObstacle>();
|
||||
obstacle.shape = NavMeshObstacleShape.Box;
|
||||
obstacle.size = new Vector3(1f, 1f, 1f);
|
||||
obstacle.center = new Vector3(0f, 0.5f, 0f);
|
||||
}
|
||||
|
||||
int defaultLayer = LayerMask.NameToLayer("Default");
|
||||
if (defaultLayer >= 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user