Skip to content

Commit

Permalink
disable all unnecessary components (#1367)
Browse files Browse the repository at this point in the history
  • Loading branch information
stilnat authored Dec 1, 2023
1 parent a829872 commit 1996aa3
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Coimbra;
using SS3D.Data;
using SS3D.Data.Enums;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;

Expand Down Expand Up @@ -28,6 +29,12 @@ public class ConstructionHologram
/// all tile objects. If it's not, it will choose another available direction.</param>
public ConstructionHologram(GameObject ghostObject, Vector3 targetPosition, Direction dir)
{

List<MonoBehaviour> components = ghostObject.GetComponentsInChildren<MonoBehaviour>()
.Where(x => x is not ICustomGhostRotation).ToList();

components.ForEach(x => x.enabled = false);

_hologram = ghostObject;
_position = targetPosition;
_direction = dir;
Expand Down

0 comments on commit 1996aa3

Please sign in to comment.