remove slop
This commit is contained in:
@@ -26,12 +26,10 @@ public class ChildModelBehaviour : ModelBehaviour
|
|||||||
|
|
||||||
public Port GetParentPort()
|
public Port GetParentPort()
|
||||||
{
|
{
|
||||||
Debug.Log($"Searching port for {name} with PortID {ChildModel.ParentPort} with parent {Parent}");
|
|
||||||
foreach (Port parentPort in Parent.Model.Ports)
|
foreach (Port parentPort in Parent.Model.Ports)
|
||||||
{
|
{
|
||||||
if (parentPort.PortID == ChildModel.ParentPort)
|
if (parentPort.PortID == ChildModel.ParentPort)
|
||||||
{
|
{
|
||||||
Debug.Log($"Found port for {name} with PortID {parentPort.PortID} {parentPort.PortName} for {ChildModel.ParentPort}");
|
|
||||||
return parentPort;
|
return parentPort;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ using UnityEngine.Serialization;
|
|||||||
|
|
||||||
public class ModelManager : MonoBehaviour, IResettable
|
public class ModelManager : MonoBehaviour, IResettable
|
||||||
{
|
{
|
||||||
private Dictionary<string, HashSet<ChildModel>> _portDict; //port mapped on
|
Dictionary<string, HashSet<ChildModel>> _portDict; //port mapped on
|
||||||
private Dictionary<string, ChildModel> _childModelDict; //childModels by their ID
|
Dictionary<string, ChildModel> _childModelDict; //childModels by their ID
|
||||||
|
|
||||||
public List<BaseModel> BaseModelList; //available BaseModels
|
public List<BaseModel> BaseModelList; //available BaseModels
|
||||||
|
|
||||||
@@ -19,6 +19,7 @@ public class ModelManager : MonoBehaviour, IResettable
|
|||||||
{
|
{
|
||||||
get { return baseModelGO.GetComponent<BaseModelBehaviour>(); }
|
get { return baseModelGO.GetComponent<BaseModelBehaviour>(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public BaseModelSelector baseModelSelector;
|
public BaseModelSelector baseModelSelector;
|
||||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||||
void Start()
|
void Start()
|
||||||
@@ -27,7 +28,6 @@ public class ModelManager : MonoBehaviour, IResettable
|
|||||||
_portDict = new Dictionary<string, HashSet<ChildModel>>();
|
_portDict = new Dictionary<string, HashSet<ChildModel>>();
|
||||||
_childModelDict = new Dictionary<string, ChildModel>();
|
_childModelDict = new Dictionary<string, ChildModel>();
|
||||||
BaseModelList = new List<BaseModel>();
|
BaseModelList = new List<BaseModel>();
|
||||||
//baseModelSelector = FindFirstObjectByType<BaseModelSelector>();
|
|
||||||
|
|
||||||
foreach (var baseModel in ModelList.BaseModels)
|
foreach (var baseModel in ModelList.BaseModels)
|
||||||
{
|
{
|
||||||
@@ -40,35 +40,8 @@ public class ModelManager : MonoBehaviour, IResettable
|
|||||||
}
|
}
|
||||||
if (baseModelGO == null) //set in the editor
|
if (baseModelGO == null) //set in the editor
|
||||||
{
|
{
|
||||||
//TODO: send into model selection
|
|
||||||
Debug.LogError("baseModel is null, fix the configuration");
|
Debug.LogError("baseModel is null, fix the configuration");
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
var originalGlasMat = Resources.Load<Material>("Material/Glas");
|
|
||||||
if (originalGlasMat != null)
|
|
||||||
{
|
|
||||||
var glasMatInstance = new Material(originalGlasMat); // Kopie erzeugen
|
|
||||||
var urpLit = Shader.Find("URP/UI/Prerendered");
|
|
||||||
if (urpLit != null)
|
|
||||||
{
|
|
||||||
glasMatInstance.shader = urpLit;
|
|
||||||
glasMatInstance.SetFloat("_Smoothness", 0.9f);
|
|
||||||
glasMatInstance.SetFloat("_Metallic", 0.0f);
|
|
||||||
glasMatInstance.SetFloat("_Surface", 1);
|
|
||||||
glasMatInstance.SetFloat("_Blend", 0);
|
|
||||||
glasMatInstance.SetColor("_BaseColor", new Color(0.2f, 0.2f, 0.2f, 0.45f));
|
|
||||||
}
|
|
||||||
var fensterGO = GameObject.Find("portErlbachWindow"); // Name des Fenster-Objekts
|
|
||||||
if (fensterGO != null)
|
|
||||||
{
|
|
||||||
var renderer = fensterGO.GetComponent<Renderer>();
|
|
||||||
if (renderer != null)
|
|
||||||
{
|
|
||||||
renderer.material = glasMatInstance;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RegisterChildModel(ChildModel model)
|
void RegisterChildModel(ChildModel model)
|
||||||
|
|||||||
@@ -67,7 +67,6 @@ public class ExplodeModel : MonoBehaviour, IResettable, IPointerDownHandler
|
|||||||
initialPos.Add(child.localPosition);
|
initialPos.Add(child.localPosition);
|
||||||
goalPos.Add(child.localPosition + port.ExplodeDirection);
|
goalPos.Add(child.localPosition + port.ExplodeDirection);
|
||||||
transforms.Add(child);
|
transforms.Add(child);
|
||||||
Debug.LogWarning($"moving: {cmb.name} - {port.PortID} InitPos: {child.localPosition} -> goal {child.localPosition + port.ExplodeDirection}");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
text.text = explode ? "Explode" : "Unexplode";
|
text.text = explode ? "Explode" : "Unexplode";
|
||||||
|
|||||||
Reference in New Issue
Block a user