"i work at blizzard"

This commit is contained in:
Tim
2025-07-17 22:19:24 +02:00
parent 74eb725db1
commit 828313ae3c
29 changed files with 250 additions and 251 deletions

View File

@@ -5,4 +5,4 @@
public interface IResettable public interface IResettable
{ {
public void ResetThis(); public void ResetThis();
} }

View File

@@ -7,7 +7,7 @@ using UnityEngine.SceneManagement;
public class StateManager : MonoBehaviour public class StateManager : MonoBehaviour
{ {
public List<IResettable> Resettables; public List<IResettable> Resettables;
private void populateResettables() private void populateResettables()
{ {
Resettables ??= new List<IResettable>(); Resettables ??= new List<IResettable>();
@@ -18,7 +18,7 @@ public class StateManager : MonoBehaviour
Resettables.AddRange(goot.GetComponentsInChildren<IResettable>(true)); Resettables.AddRange(goot.GetComponentsInChildren<IResettable>(true));
} }
} }
void Start() void Start()
{ {
populateResettables(); populateResettables();

View File

@@ -9,11 +9,12 @@ public class BaseModel : Model
Quaternion rotation, Vector3 scale, List<Port> ports, List<Color> colors = null) Quaternion rotation, Vector3 scale, List<Port> ports, List<Color> colors = null)
: base(nameHuman, nameId, mesh, material, offset, rotation, scale, ports, colors) : base(nameHuman, nameId, mesh, material, offset, rotation, scale, ports, colors)
{ {
} }
public BaseModel(string nameHuman, string nameId, Mesh mesh, Material material, List<Port> ports, List<Color> colors = null) public BaseModel(string nameHuman, string nameId, Mesh mesh, Material material, List<Port> ports, List<Color> colors = null)
: base(nameHuman, nameId, mesh, material, ports, colors) : base(nameHuman, nameId, mesh, material, ports, colors)
{ {
} }
} }

View File

@@ -13,11 +13,8 @@ public class BaseModelBehaviour : ModelBehaviour
} }
throw new InvalidCastException("model needs to be of type BaseModel"); throw new InvalidCastException("model needs to be of type BaseModel");
} }
set set { Model = value; }
{
Model = value;
}
} }
} }

View File

@@ -6,21 +6,21 @@ using UnityEngine;
public class ChildModel : Model public class ChildModel : Model
{ {
public string ParentPort { get; private set; } public string ParentPort { get; private set; }
public ChildModel(string parentPort, string nameHuman, string nameId, Mesh mesh, Material material, Vector3 offset, public ChildModel(string parentPort, string nameHuman, string nameId, Mesh mesh, Material material, Vector3 offset,
Quaternion rotation, Vector3 scale, List<Port> ports = null, List<Color> colors = null, bool passthrough = false) Quaternion rotation, Vector3 scale, List<Port> ports = null, List<Color> colors = null, bool passthrough = false)
: base(nameHuman, nameId, mesh, material, offset, rotation, scale, ports, colors, passthrough) : base(nameHuman, nameId, mesh, material, offset, rotation, scale, ports, colors, passthrough)
{ {
this.ParentPort = parentPort; this.ParentPort = parentPort;
} }
public ChildModel(string parentPort, string nameHuman, string nameId, Mesh mesh, public ChildModel(string parentPort, string nameHuman, string nameId, Mesh mesh,
Material material, List<Port> ports = null, List<Color> color = null, bool passthrough = false) Material material, List<Port> ports = null, List<Color> color = null, bool passthrough = false)
: base(nameHuman, nameId, mesh, material, ports, color, passthrough) : base(nameHuman, nameId, mesh, material, ports, color, passthrough)
{ {
this.ParentPort = parentPort; this.ParentPort = parentPort;
} }
// For Groups, no Mesh // For Groups, no Mesh
public ChildModel(string parentPort, string nameHuman, string nameId, Material material, Vector3 offset, public ChildModel(string parentPort, string nameHuman, string nameId, Material material, Vector3 offset,
Quaternion rotation, Vector3 scale, List<Port> ports = null, List<Color> colors = null, bool passthrough = false) Quaternion rotation, Vector3 scale, List<Port> ports = null, List<Color> colors = null, bool passthrough = false)
@@ -28,5 +28,5 @@ public class ChildModel : Model
{ {
this.ParentPort = parentPort; this.ParentPort = parentPort;
} }
} }

View File

@@ -4,7 +4,7 @@ using UnityEngine;
public class ChildModelBehaviour : ModelBehaviour public class ChildModelBehaviour : ModelBehaviour
{ {
public ChildModel ChildModel public ChildModel ChildModel
{ {
get get
{ {
if (Model == null) if (Model == null)
@@ -17,10 +17,7 @@ public class ChildModelBehaviour : ModelBehaviour
} }
throw new InvalidCastException("ChildModelBehaviour needs to be of type ChildModel"); throw new InvalidCastException("ChildModelBehaviour needs to be of type ChildModel");
} }
internal set internal set { Model = value; }
{
Model = value;
}
} }
public ModelBehaviour Parent { get; set; } public ModelBehaviour Parent { get; set; }
@@ -31,7 +28,7 @@ public class ChildModelBehaviour : ModelBehaviour
if (parentPort.PortID == ChildModel.ParentPort) if (parentPort.PortID == ChildModel.ParentPort)
{ {
return parentPort; return parentPort;
} }
} }
Debug.LogWarning($"Didn't find port for {name} with PortID {ChildModel.ParentPort}"); Debug.LogWarning($"Didn't find port for {name} with PortID {ChildModel.ParentPort}");
return null; return null;

View File

@@ -7,12 +7,12 @@ public class Model
public string NameId { get; internal set; } // JSON export name, should be unique public string NameId { get; internal set; } // JSON export name, should be unique
public Mesh Mesh { get; internal set; } // obj/fbx public Mesh Mesh { get; internal set; } // obj/fbx
public Material Material { get; internal set; } // skin public Material Material { get; internal set; } // skin
public List<Color> Color { get; set; } // koleur public List<Color> Color { get; set; } // koleur
public readonly bool Passthrough; //whether this passes through color public readonly bool Passthrough; //whether this passes through color
public readonly List<Port> Ports; public readonly List<Port> Ports;
public readonly Vector3 Offset; public readonly Vector3 Offset;
public readonly Quaternion Rotation; public readonly Quaternion Rotation;
public readonly Vector3 Scale; public readonly Vector3 Scale;
@@ -31,6 +31,7 @@ public class Model
this.Color = color; this.Color = color;
this.Passthrough = passthrough; this.Passthrough = passthrough;
} }
public Model(string nameHuman, string nameId, Mesh mesh, Material material, List<Port> ports = null, List<Color> color = null, bool passthrough = false) public Model(string nameHuman, string nameId, Mesh mesh, Material material, List<Port> ports = null, List<Color> color = null, bool passthrough = false)
{ {
this.NameHuman = nameHuman; this.NameHuman = nameHuman;
@@ -54,5 +55,5 @@ public class Model
{ {
return Ports != null && Ports.Count > 0; return Ports != null && Ports.Count > 0;
} }
} }

View File

@@ -11,13 +11,10 @@ public class ModelBehaviour : MonoBehaviour, IResettable
public ModelManager ModelManager; public ModelManager ModelManager;
public Exploder Exploder; public Exploder Exploder;
Model _model; Model _model;
internal Model Model internal Model Model
{ {
get get { return _model; }
{
return _model;
}
set set
{ {
UpdateModel(value); UpdateModel(value);
@@ -27,26 +24,23 @@ public class ModelBehaviour : MonoBehaviour, IResettable
} }
readonly List<GameObject> _children = new List<GameObject>(); readonly List<GameObject> _children = new List<GameObject>();
public readonly Dictionary<int, ChildModel> portDict = new Dictionary<int, ChildModel>(); //for CMS marker public readonly Dictionary<int, ChildModel> portDict = new Dictionary<int, ChildModel>(); //for CMS marker
public MeshFilter meshFilter; public MeshFilter meshFilter;
public MeshRenderer meshRenderer; public MeshRenderer meshRenderer;
public MeshCollider meshCollider; public MeshCollider meshCollider;
public ColliderSurface colliderSurface; public ColliderSurface colliderSurface;
public InteractableUnityEventWrapper interactable; public InteractableUnityEventWrapper interactable;
public RayInteractable rayInteractable; public RayInteractable rayInteractable;
bool lateInited = false; bool lateInited = false;
public PortSelector PortSelector; public PortSelector PortSelector;
public int Index = -1; public int Index = -1;
Color _color = Color.black; Color _color = Color.black;
Color Color Color Color
{ {
get get { return _color; }
{
return _color;
}
set set
{ {
var clonedMaterial = new Material(meshRenderer.material); //clone da sonst alle anderen mit dem mat auch colorchanged werden var clonedMaterial = new Material(meshRenderer.material); //clone da sonst alle anderen mit dem mat auch colorchanged werden
@@ -132,7 +126,7 @@ public class ModelBehaviour : MonoBehaviour, IResettable
transform.localRotation = newModel.Rotation; transform.localRotation = newModel.Rotation;
transform.localScale = newModel.Scale; transform.localScale = newModel.Scale;
transform.localPosition += newModel.Offset; transform.localPosition += newModel.Offset;
//spawn new childPorts //spawn new childPorts
if (newModel.HasPorts()) if (newModel.HasPorts())
{ {
@@ -146,7 +140,7 @@ public class ModelBehaviour : MonoBehaviour, IResettable
Debug.Log($"LateUpdateModel"); Debug.Log($"LateUpdateModel");
Exploder.HandleModelChange(); Exploder.HandleModelChange();
} }
public void UpdateChild(int portNum, string id) //onclick change model public void UpdateChild(int portNum, string id) //onclick change model
{ {
if (portNum >= _children.Count) if (portNum >= _children.Count)
@@ -194,7 +188,7 @@ public class ModelBehaviour : MonoBehaviour, IResettable
Destroy(child); Destroy(child);
continue; continue;
} }
//Debug.Log($"POS {child.transform.gameObject.name} pos {child.transform.localPosition} {child.transform.rotation} {child.transform.localScale}"); //Debug.Log($"POS {child.transform.gameObject.name} pos {child.transform.localPosition} {child.transform.rotation} {child.transform.localScale}");
cmb.Parent = this; cmb.Parent = this;
cmb.ChildModel = childModel; cmb.ChildModel = childModel;
@@ -202,7 +196,7 @@ public class ModelBehaviour : MonoBehaviour, IResettable
portDict[i] = cmb.ChildModel; portDict[i] = cmb.ChildModel;
} }
} }
/// <summary> /// <summary>
/// -> see docs/exampleExport.json /// -> see docs/exampleExport.json
/// this doesn't include leading+trailing { } or commas, just the content /// this doesn't include leading+trailing { } or commas, just the content
@@ -218,7 +212,7 @@ public class ModelBehaviour : MonoBehaviour, IResettable
export += "\"baseModel\": true,"; export += "\"baseModel\": true,";
} }
export += $"\"modelId\": \"{Model.NameId}\""; export += $"\"modelId\": \"{Model.NameId}\"";
if(Model is ChildModel cm) if (Model is ChildModel cm)
{ {
export += $", \"portId\": \"{cm.ParentPort}\""; export += $", \"portId\": \"{cm.ParentPort}\"";
} }
@@ -237,8 +231,8 @@ public class ModelBehaviour : MonoBehaviour, IResettable
{ {
continue; continue;
} }
export += "{ \"i\": " + i +", " + _children[i].GetComponent<ChildModelBehaviour>().ExportJsonBase() + "}"; export += "{ \"i\": " + i + ", " + _children[i].GetComponent<ChildModelBehaviour>().ExportJsonBase() + "}";
if(i != Model.Ports.Count-1) //if not the last if (i != Model.Ports.Count - 1) //if not the last
{ {
export += ","; export += ",";
} }
@@ -256,7 +250,7 @@ public class ModelBehaviour : MonoBehaviour, IResettable
{ {
return "{" + ExportJsonBase() + "}"; return "{" + ExportJsonBase() + "}";
} }
public void UpdateChildColor(int portIndex, Color color) public void UpdateChildColor(int portIndex, Color color)
{ {
if (portIndex < 0 || portIndex >= _children.Count) if (portIndex < 0 || portIndex >= _children.Count)
@@ -266,6 +260,7 @@ public class ModelBehaviour : MonoBehaviour, IResettable
} }
_children[portIndex].GetComponent<ChildModelBehaviour>().Color = color; _children[portIndex].GetComponent<ChildModelBehaviour>().Color = color;
} }
public void ClearChildren() public void ClearChildren()
{ {
Debug.Log($"Removing Children of {name}..."); Debug.Log($"Removing Children of {name}...");
@@ -279,7 +274,7 @@ public class ModelBehaviour : MonoBehaviour, IResettable
_children.Clear(); _children.Clear();
Debug.Log("Removed."); Debug.Log("Removed.");
} }
//model clicked //model clicked
void OnSelect() void OnSelect()
{ {

View File

@@ -3,15 +3,15 @@ using UnityEngine;
public class ModelElement public class ModelElement
{ {
public string Port {get;} public string Port { get; }
public string NameHuman {get;} public string NameHuman { get; }
public string NameId {get;} public string NameId { get; }
public Material Mats {get;} public Material Mats { get; }
public Vector3 Offset {get;} public Vector3 Offset { get; }
public Quaternion Rotation {get;} public Quaternion Rotation { get; }
public Vector3 Scale {get;} public Vector3 Scale { get; }
public List<Port> Ports {get;} public List<Port> Ports { get; }
public List<Color> Colors {get;} public List<Color> Colors { get; }
public ModelElement(string port, string nameHuman, string nameId, Material mats, Vector3 offset, public ModelElement(string port, string nameHuman, string nameId, Material mats, Vector3 offset,
Quaternion rotation, Vector3 scale, List<Port> ports, List<Color> colors) Quaternion rotation, Vector3 scale, List<Port> ports, List<Color> colors)

View File

@@ -24,13 +24,13 @@ public class ModelList
Port.Choosable("Back Frame", PortDef.BIKE_FRAME, "idBikeAttachments", Vector3.zero), Port.Choosable("Back Frame", PortDef.BIKE_FRAME, "idBikeAttachments", Vector3.zero),
Port.Choosable("Frame", PortDef.BIKE_FRAME2, "idBikeFrame", Vector3.zero), Port.Choosable("Frame", PortDef.BIKE_FRAME2, "idBikeFrame", Vector3.zero),
Port.Hidden(PortDef.BIKE_SPROCKET, "idBikeSprocket", new Vector3(0.007933f, 0.444f, -0.1614f), Quaternion.identity, 1f, new Vector3(0.5f, 0f, 0f)), Port.Hidden(PortDef.BIKE_SPROCKET, "idBikeSprocket", new Vector3(0.007933f, 0.444f, -0.1614f), Quaternion.identity, 1f, new Vector3(0.5f, 0f, 0f)),
Port.Hidden( PortDef.BIKE_PEDAL_L, "idBikePedalL", new Vector3(-0.1252177f, 0.5490288f, -0.312027f), Quaternion.identity, 1f, new Vector3(-0.5f, 0f, 0f)), Port.Hidden(PortDef.BIKE_PEDAL_L, "idBikePedalL", new Vector3(-0.1252177f, 0.5490288f, -0.312027f), Quaternion.identity, 1f, new Vector3(-0.5f, 0f, 0f)),
Port.Hidden( PortDef.BIKE_PEDAL_R, "idBikePedalR", new Vector3(0.1410843f, 0.3393247f, -0.01154391f), Quaternion.identity, 1f, new Vector3(0.5f, 0f, 0f)), Port.Hidden(PortDef.BIKE_PEDAL_R, "idBikePedalR", new Vector3(0.1410843f, 0.3393247f, -0.01154391f), Quaternion.identity, 1f, new Vector3(0.5f, 0f, 0f)),
Port.Choosable("Handlebars", PortDef.BIKE_STEER, "idBikeHandlebars", new Vector3(0.002989591f, 1.214713f, 0.4860705f), Quaternion.Euler(-30f, 0f, 0f), 1f, new Vector3(0f, 0.5f, 1f)), Port.Choosable("Handlebars", PortDef.BIKE_STEER, "idBikeHandlebars", new Vector3(0.002989591f, 1.214713f, 0.4860705f), Quaternion.Euler(-30f, 0f, 0f), 1f, new Vector3(0f, 0.5f, 1f)),
Port.Choosable("Back Rim", PortDef.BIKE_RIM, "idBikeRim_Back", new Vector3(-0.01431298f, 0.4673222f, -0.7874681f), Quaternion.identity, 1f, new Vector3(0f, 0f, -0.6f)), Port.Choosable("Back Rim", PortDef.BIKE_RIM, "idBikeRim_Back", new Vector3(-0.01431298f, 0.4673222f, -0.7874681f), Quaternion.identity, 1f, new Vector3(0f, 0f, -0.6f)),
Port.Hidden(PortDef.BIKE_TIRE, "idBikeTire_Back", new Vector3(-0.01431298f, 0.4673222f, -0.7874681f), Quaternion.identity, 1f, new Vector3(0f, 0f, -0.6f)), Port.Hidden(PortDef.BIKE_TIRE, "idBikeTire_Back", new Vector3(-0.01431298f, 0.4673222f, -0.7874681f), Quaternion.identity, 1f, new Vector3(0f, 0f, -0.6f)),
Port.Choosable("Front Rim", PortDef.BIKE_RIM_FRONT, "idBikeRim_Front", new Vector3(0.01984263f, 0.4673225f, 0.9462124f), Quaternion.identity, 1f, new Vector3(0f, 0f, 0.6f)), Port.Choosable("Front Rim", PortDef.BIKE_RIM_FRONT, "idBikeRim_Front", new Vector3(0.01984263f, 0.4673225f, 0.9462124f), Quaternion.identity, 1f, new Vector3(0f, 0f, 0.6f)),
Port.Hidden( PortDef.BIKE_TIRE_FRONT, "idBikeTire_Front", new Vector3(0.01984263f, 0.4673225f, 0.9462124f), Quaternion.identity, 1f, new Vector3(0f, 0f, 0.6f)), Port.Hidden(PortDef.BIKE_TIRE_FRONT, "idBikeTire_Front", new Vector3(0.01984263f, 0.4673225f, 0.9462124f), Quaternion.identity, 1f, new Vector3(0f, 0f, 0.6f)),
} }
), ),
new BaseModel( new BaseModel(
@@ -321,7 +321,7 @@ public class ModelList
* ██████ ██ ██ ██ ███████ * ██████ ██ ██ ██ ███████
*/ */
ModelLoader.LoadChildFromPackedModel(ChildModels, ModelLoader.LoadChildFromPackedModel(ChildModels,
new List<ModelElement> new List<ModelElement>
{ {
new ModelElement(PortDef.BIKE_FRAME, "Back Frame", "idBikeAttachments", Resources.Load<Material>($"Material/AluminiumPolished"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumPolished), new ModelElement(PortDef.BIKE_FRAME, "Back Frame", "idBikeAttachments", Resources.Load<Material>($"Material/AluminiumPolished"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumPolished),
new ModelElement(PortDef.BIKE_FRAME2, "Frame", "idBikeFrame", Resources.Load<Material>($"Material/AluminiumPolished"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumPolished), new ModelElement(PortDef.BIKE_FRAME2, "Frame", "idBikeFrame", Resources.Load<Material>($"Material/AluminiumPolished"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumPolished),
@@ -348,104 +348,104 @@ public class ModelList
ModelLoader.LoadChildFromPackedModel(ChildModels, ModelLoader.LoadChildFromPackedModel(ChildModels,
new List<ModelElement> new List<ModelElement>
{ {
new ModelElement( PortDef.ERL_CABLE_1, "Erlbach Part 1", "idErlbachPart1", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_1, "Erlbach Part 1", "idErlbachPart1", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_2, "Erlbach Part 2", "idErlbachPart2", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_2, "Erlbach Part 2", "idErlbachPart2", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CAP_3, "Erlbach Part 3", "idErlbachPart3", Resources.Load<Material>($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CAP_3, "Erlbach Part 3", "idErlbachPart3", Resources.Load<Material>($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CAP_4, "Erlbach Part 4", "idErlbachPart4", Resources.Load<Material>($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CAP_4, "Erlbach Part 4", "idErlbachPart4", Resources.Load<Material>($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CAP_5, "Erlbach Part 5", "idErlbachPart5", Resources.Load<Material>($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CAP_5, "Erlbach Part 5", "idErlbachPart5", Resources.Load<Material>($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CAP_6, "Erlbach Part 6", "idErlbachPart6", Resources.Load<Material>($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CAP_6, "Erlbach Part 6", "idErlbachPart6", Resources.Load<Material>($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CAP_7, "Erlbach Part 7", "idErlbachPart7", Resources.Load<Material>($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CAP_7, "Erlbach Part 7", "idErlbachPart7", Resources.Load<Material>($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CAP_8, "Erlbach Part 8", "idErlbachPart8", Resources.Load<Material>($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CAP_8, "Erlbach Part 8", "idErlbachPart8", Resources.Load<Material>($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CAP_9, "Erlbach Part 9", "idErlbachPart9", Resources.Load<Material>($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CAP_9, "Erlbach Part 9", "idErlbachPart9", Resources.Load<Material>($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CAP_10, "Erlbach Part 10", "idErlbachPart10", Resources.Load<Material>($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CAP_10, "Erlbach Part 10", "idErlbachPart10", Resources.Load<Material>($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CAP_11, "Erlbach Part 11", "idErlbachPart11", Resources.Load<Material>($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CAP_11, "Erlbach Part 11", "idErlbachPart11", Resources.Load<Material>($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CAP_12, "Erlbach Part 12", "idErlbachPart12", Resources.Load<Material>($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CAP_12, "Erlbach Part 12", "idErlbachPart12", Resources.Load<Material>($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CAP_13, "Erlbach Part 13", "idErlbachPart13", Resources.Load<Material>($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CAP_13, "Erlbach Part 13", "idErlbachPart13", Resources.Load<Material>($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CAP_14, "Erlbach Part 14", "idErlbachPart14", Resources.Load<Material>($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CAP_14, "Erlbach Part 14", "idErlbachPart14", Resources.Load<Material>($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CAP_15, "Erlbach Part 15", "idErlbachPart15", Resources.Load<Material>($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CAP_15, "Erlbach Part 15", "idErlbachPart15", Resources.Load<Material>($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CAP_16, "Erlbach Part 16", "idErlbachPart16", Resources.Load<Material>($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CAP_16, "Erlbach Part 16", "idErlbachPart16", Resources.Load<Material>($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CAP_17, "Erlbach Part 17", "idErlbachPart17", Resources.Load<Material>($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CAP_17, "Erlbach Part 17", "idErlbachPart17", Resources.Load<Material>($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_18, "Erlbach Part 18", "idErlbachPart18", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_18, "Erlbach Part 18", "idErlbachPart18", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_19, "Erlbach Part 19", "idErlbachPart19", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_19, "Erlbach Part 19", "idErlbachPart19", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_20, "Erlbach Part 20", "idErlbachPart20", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_20, "Erlbach Part 20", "idErlbachPart20", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_21, "Erlbach Part 21", "idErlbachPart21", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_21, "Erlbach Part 21", "idErlbachPart21", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_22, "Erlbach Part 22", "idErlbachPart22", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_22, "Erlbach Part 22", "idErlbachPart22", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_23, "Erlbach Part 23", "idErlbachPart23", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_23, "Erlbach Part 23", "idErlbachPart23", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_24, "Erlbach Part 24", "idErlbachPart24", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_24, "Erlbach Part 24", "idErlbachPart24", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_25, "Erlbach Part 25", "idErlbachPart25", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_25, "Erlbach Part 25", "idErlbachPart25", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_26, "Erlbach Part 26", "idErlbachPart26", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_26, "Erlbach Part 26", "idErlbachPart26", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_27, "Erlbach Part 27", "idErlbachPart27", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_27, "Erlbach Part 27", "idErlbachPart27", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_28, "Erlbach Part 28", "idErlbachPart28", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_28, "Erlbach Part 28", "idErlbachPart28", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_29, "Erlbach Part 29", "idErlbachPart29", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_29, "Erlbach Part 29", "idErlbachPart29", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_30, "Erlbach Part 30", "idErlbachPart30", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_30, "Erlbach Part 30", "idErlbachPart30", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_31, "Erlbach Part 31", "idErlbachPart31", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_31, "Erlbach Part 31", "idErlbachPart31", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_32, "Erlbach Part 32", "idErlbachPart32", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_32, "Erlbach Part 32", "idErlbachPart32", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_33, "Erlbach Part 33", "idErlbachPart33", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_33, "Erlbach Part 33", "idErlbachPart33", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_34, "Erlbach Part 34", "idErlbachPart34", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_34, "Erlbach Part 34", "idErlbachPart34", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_35, "Erlbach Part 35", "idErlbachPart35", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_35, "Erlbach Part 35", "idErlbachPart35", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_36, "Erlbach Part 36", "idErlbachPart36", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_36, "Erlbach Part 36", "idErlbachPart36", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_37, "Erlbach Part 37", "idErlbachPart37", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_37, "Erlbach Part 37", "idErlbachPart37", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_38, "Erlbach Part 38", "idErlbachPart38", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_38, "Erlbach Part 38", "idErlbachPart38", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CAP_39, "Erlbach Part 39", "idErlbachPart39", Resources.Load<Material>($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CAP_39, "Erlbach Part 39", "idErlbachPart39", Resources.Load<Material>($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CAP_40, "Erlbach Part 40", "idErlbachPart40", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CAP_40, "Erlbach Part 40", "idErlbachPart40", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_41, "Erlbach Part 41", "idErlbachPart41", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_41, "Erlbach Part 41", "idErlbachPart41", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_42, "Erlbach Part 42", "idErlbachPart42", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_42, "Erlbach Part 42", "idErlbachPart42", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_43, "Erlbach Part 43", "idErlbachPart43", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_43, "Erlbach Part 43", "idErlbachPart43", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_44, "Erlbach Part 44", "idErlbachPart44", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_44, "Erlbach Part 44", "idErlbachPart44", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_45, "Erlbach Part 45", "idErlbachPart45", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_45, "Erlbach Part 45", "idErlbachPart45", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_46, "Erlbach Part 46", "idErlbachPart46", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_46, "Erlbach Part 46", "idErlbachPart46", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_47, "Erlbach Part 47", "idErlbachPart47", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_47, "Erlbach Part 47", "idErlbachPart47", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_48, "Erlbach Part 48", "idErlbachPart48", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_48, "Erlbach Part 48", "idErlbachPart48", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_49, "Erlbach Part 49", "idErlbachPart49", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_49, "Erlbach Part 49", "idErlbachPart49", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_50, "Erlbach Part 50", "idErlbachPart50", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_50, "Erlbach Part 50", "idErlbachPart50", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_51, "Erlbach Part 51", "idErlbachPart51", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_51, "Erlbach Part 51", "idErlbachPart51", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_52, "Erlbach Part 52", "idErlbachPart52", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_52, "Erlbach Part 52", "idErlbachPart52", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_53, "Erlbach Part 53", "idErlbachPart53", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_53, "Erlbach Part 53", "idErlbachPart53", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_54, "Erlbach Part 54", "idErlbachPart54", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_54, "Erlbach Part 54", "idErlbachPart54", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_55, "Erlbach Part 55", "idErlbachPart55", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_55, "Erlbach Part 55", "idErlbachPart55", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_56, "Erlbach Part 56", "idErlbachPart56", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_56, "Erlbach Part 56", "idErlbachPart56", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_57, "Erlbach Part 57", "idErlbachPart57", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_57, "Erlbach Part 57", "idErlbachPart57", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_58, "Erlbach Part 58", "idErlbachPart58", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_58, "Erlbach Part 58", "idErlbachPart58", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_59, "Erlbach Part 59", "idErlbachPart59", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_59, "Erlbach Part 59", "idErlbachPart59", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_60, "Erlbach Part 60", "idErlbachPart60", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_60, "Erlbach Part 60", "idErlbachPart60", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_61, "Erlbach Part 61", "idErlbachPart61", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_61, "Erlbach Part 61", "idErlbachPart61", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_62, "Erlbach Part 62", "idErlbachPart62", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_62, "Erlbach Part 62", "idErlbachPart62", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_63, "Erlbach Part 63", "idErlbachPart63", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_63, "Erlbach Part 63", "idErlbachPart63", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_64, "Erlbach Part 64", "idErlbachPart64", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_64, "Erlbach Part 64", "idErlbachPart64", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_65, "Erlbach Part 65", "idErlbachPart65", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_65, "Erlbach Part 65", "idErlbachPart65", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_66, "Erlbach Part 66", "idErlbachPart66", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_66, "Erlbach Part 66", "idErlbachPart66", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_67, "Erlbach Part 67", "idErlbachPart67", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_67, "Erlbach Part 67", "idErlbachPart67", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_68, "Erlbach Part 68", "idErlbachPart68", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_68, "Erlbach Part 68", "idErlbachPart68", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_69, "Erlbach Part 69", "idErlbachPart69", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_69, "Erlbach Part 69", "idErlbachPart69", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_70, "Erlbach Part 70", "idErlbachPart70", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_70, "Erlbach Part 70", "idErlbachPart70", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_71, "Erlbach Part 71", "idErlbachPart71", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_71, "Erlbach Part 71", "idErlbachPart71", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_72, "Erlbach Part 72", "idErlbachPart72", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_72, "Erlbach Part 72", "idErlbachPart72", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_CABLE_73, "Erlbach Part 73", "idErlbachPart73", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_CABLE_73, "Erlbach Part 73", "idErlbachPart73", Resources.Load<Material>($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_BASEPLATE, "Frame", "idErlbachBody_BasePlate", Resources.Load<Material>($"Material/AluminiumScratched"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_BASEPLATE, "Frame", "idErlbachBody_BasePlate", Resources.Load<Material>($"Material/AluminiumScratched"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_BASEPLATE_FRONT, "Front Axle", "idErlbachPart75", Resources.Load<Material>($"Material/AluminiumScratched"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_BASEPLATE_FRONT, "Front Axle", "idErlbachPart75", Resources.Load<Material>($"Material/AluminiumScratched"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_BATBOX, "Battery Box", "idErlbachBatBox_Big", Resources.Load<Material>($"Material/PVC"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_BATBOX, "Battery Box", "idErlbachBatBox_Big", Resources.Load<Material>($"Material/PVC"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_PLATINE, "Erlbach Part 77", "idErlbachPart77", Resources.Load<Material>($"Material/PVC"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_PLATINE, "Erlbach Part 77", "idErlbachPart77", Resources.Load<Material>($"Material/PVC"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_ROD_78, "Erlbach Part 78", "idErlbachPart78", Resources.Load<Material>($"Material/PVC"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_ROD_78, "Erlbach Part 78", "idErlbachPart78", Resources.Load<Material>($"Material/PVC"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_ROD_79, "Erlbach Part 79", "idErlbachPart79", Resources.Load<Material>($"Material/PVC"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_ROD_79, "Erlbach Part 79", "idErlbachPart79", Resources.Load<Material>($"Material/PVC"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_TIRE_LH, "Tire LH", "erlTire1_LH", Resources.Load<Material>($"Material/CarTire"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_TIRE_LH, "Tire LH", "erlTire1_LH", Resources.Load<Material>($"Material/CarTire"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_RIM_LH, "Standard Rim", "erlRim1_LH", Resources.Load<Material>($"Material/AluminiumScratched"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumScratched ), new ModelElement(PortDef.ERL_RIM_LH, "Standard Rim", "erlRim1_LH", Resources.Load<Material>($"Material/AluminiumScratched"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumScratched),
new ModelElement( PortDef.ERL_TIRE_LV, "Tire LV", "erlTire1_LV", Resources.Load<Material>($"Material/CarTire"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_TIRE_LV, "Tire LV", "erlTire1_LV", Resources.Load<Material>($"Material/CarTire"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_RIM_LV, "Standard Rim", "erlRim1_LV", Resources.Load<Material>($"Material/AluminiumScratched"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumScratched ), new ModelElement(PortDef.ERL_RIM_LV, "Standard Rim", "erlRim1_LV", Resources.Load<Material>($"Material/AluminiumScratched"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumScratched),
new ModelElement( PortDef.ERL_TIRE_RH, "Tire RH", "erlTire1_RH", Resources.Load<Material>($"Material/CarTire"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_TIRE_RH, "Tire RH", "erlTire1_RH", Resources.Load<Material>($"Material/CarTire"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_RIM_RH, "Standard Rim", "erlRim1_RH", Resources.Load<Material>($"Material/AluminiumScratched"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumScratched ), new ModelElement(PortDef.ERL_RIM_RH, "Standard Rim", "erlRim1_RH", Resources.Load<Material>($"Material/AluminiumScratched"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumScratched),
new ModelElement( PortDef.ERL_TIRE_RV, "Tire RV", "erlTire1_RV", Resources.Load<Material>($"Material/CarTire"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_TIRE_RV, "Tire RV", "erlTire1_RV", Resources.Load<Material>($"Material/CarTire"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_RIM_RV, "Standard Rim", "erlRim1_RV", Resources.Load<Material>($"Material/AluminiumScratched"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumScratched ), new ModelElement(PortDef.ERL_RIM_RV, "Standard Rim", "erlRim1_RV", Resources.Load<Material>($"Material/AluminiumScratched"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumScratched),
new ModelElement( PortDef.ERL_BODY, "Body", "idErlbachPart84", Resources.Load<Material>($"Material/AluminiumPolished"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumPolished ), new ModelElement(PortDef.ERL_BODY, "Body", "idErlbachPart84", Resources.Load<Material>($"Material/AluminiumPolished"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumPolished),
new ModelElement( PortDef.ERL_BUMPER_BACK, "Rear Bumper", "idErlbachPart85", Resources.Load<Material>($"Material/AluminiumPolished"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumPolished ), new ModelElement(PortDef.ERL_BUMPER_BACK, "Rear Bumper", "idErlbachPart85", Resources.Load<Material>($"Material/AluminiumPolished"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumPolished),
new ModelElement( PortDef.ERL_DRL_OUTLINE, "Front Bumper", "idErlbachPart86", Resources.Load<Material>($"Material/AluminiumPolished"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumPolished ), new ModelElement(PortDef.ERL_DRL_OUTLINE, "Front Bumper", "idErlbachPart86", Resources.Load<Material>($"Material/AluminiumPolished"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumPolished),
new ModelElement( PortDef.ERL_BADGE, "Number", "idErlbachPart87", Resources.Load<Material>($"Material/AluminiumScratched"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumScratched ), new ModelElement(PortDef.ERL_BADGE, "Number", "idErlbachPart87", Resources.Load<Material>($"Material/AluminiumScratched"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumScratched),
new ModelElement( PortDef.ERL_LP_BASE, "License Plate", "idErlbachPart88", Resources.Load<Material>($"Material/AluminiumPolished"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumPolished ), new ModelElement(PortDef.ERL_LP_BASE, "License Plate", "idErlbachPart88", Resources.Load<Material>($"Material/AluminiumPolished"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumPolished),
new ModelElement( PortDef.ERL_LP_TEXT, "License Plate Content", "idErlbachPart89", Resources.Load<Material>($"Material/PVC"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_LP_TEXT, "License Plate Content", "idErlbachPart89", Resources.Load<Material>($"Material/PVC"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_LP_COUNTRY, "Erlbach Part 90", "idErlbachPart90", Resources.Load<Material>($"Material/PVC"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_LP_COUNTRY, "Erlbach Part 90", "idErlbachPart90", Resources.Load<Material>($"Material/PVC"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_GRILL, "Standard Grill", "erlGrill_1", Resources.Load<Material>($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumBrushed ), new ModelElement(PortDef.ERL_GRILL, "Standard Grill", "erlGrill_1", Resources.Load<Material>($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumBrushed),
new ModelElement( PortDef.ERL_BUMPER_FRONT, "Headlight Cover", "idErlbachPart92", Resources.Load<Material>($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumBrushed ), new ModelElement(PortDef.ERL_BUMPER_FRONT, "Headlight Cover", "idErlbachPart92", Resources.Load<Material>($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumBrushed),
new ModelElement( PortDef.ERL_DRL_PLATE, "Headlight", "idErlbachPart93", Resources.Load<Material>($"Material/MetalMesh"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), new ModelElement(PortDef.ERL_DRL_PLATE, "Headlight", "idErlbachPart93", Resources.Load<Material>($"Material/MetalMesh"), Vector3.zero, Quaternion.identity, Vector3.one, null, null),
new ModelElement( PortDef.ERL_WINDOW, "Fenster", "idErlbachGlas", Resources.Load<Material>($"Material/Glas"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorGlass), new ModelElement(PortDef.ERL_WINDOW, "Fenster", "idErlbachGlas", Resources.Load<Material>($"Material/Glas"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorGlass),
}, },
Resources.LoadAll<Mesh>($"Model/ERLbach/ERLBach_mit_Fenster"), Resources.LoadAll<Mesh>($"Model/ERLbach/ERLBach_mit_Fenster"),
1 //skip basemodel 1 //skip basemodel

View File

@@ -13,7 +13,7 @@ namespace Models
Color.red, Color.red,
Color.yellow, Color.yellow,
}; };
public static List<Color> ColorGlass = new List<Color>() public static List<Color> ColorGlass = new List<Color>()
{ {
Resources.Load<Material>($"Material/Glas").color, Resources.Load<Material>($"Material/Glas").color,
@@ -22,7 +22,7 @@ namespace Models
new Color(0.1f, 0.1f, 0.1f, 0.65f), new Color(0.1f, 0.1f, 0.1f, 0.65f),
new Color(0.05f, 0.05f, 0.05f, 0.80f), new Color(0.05f, 0.05f, 0.05f, 0.80f),
}; };
public static List<Color> ColorAluminiumPolished = new List<Color>() public static List<Color> ColorAluminiumPolished = new List<Color>()
{ {
Color.black, Color.black,
@@ -56,4 +56,4 @@ namespace Models
Color.yellow, Color.yellow,
}; };
} }
} }

View File

@@ -9,9 +9,9 @@ public class ModelManager : MonoBehaviour, IResettable
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
public GameObject baseModelGO; //GameObject of the BaseModel public GameObject baseModelGO; //GameObject of the BaseModel
public BaseModel BaseModel //current baseModel Phenotype public BaseModel BaseModel //current baseModel Phenotype
{ {
get { return baseModelGO.GetComponent<BaseModelBehaviour>().BaseModel; } get { return baseModelGO.GetComponent<BaseModelBehaviour>().BaseModel; }
} }
@@ -19,7 +19,7 @@ public class ModelManager : MonoBehaviour, IResettable
{ {
get { return baseModelGO.GetComponent<BaseModelBehaviour>(); } get { return baseModelGO.GetComponent<BaseModelBehaviour>(); }
} }
public BaseModelSelector baseModelSelector; public BaseModelSelector baseModelSelector;
public GameObject childModelPrefab; public GameObject childModelPrefab;
@@ -30,7 +30,7 @@ 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>();
foreach (var baseModel in ModelList.BaseModels) foreach (var baseModel in ModelList.BaseModels)
{ {
RegisterBaseModel(baseModel); RegisterBaseModel(baseModel);
@@ -56,7 +56,7 @@ public class ModelManager : MonoBehaviour, IResettable
return; return;
} }
_childModelDict[model.NameId] = model; _childModelDict[model.NameId] = model;
//portDict //portDict
if (string.IsNullOrEmpty(model.ParentPort)) if (string.IsNullOrEmpty(model.ParentPort))
{ {
@@ -104,7 +104,7 @@ public class ModelManager : MonoBehaviour, IResettable
{ {
return _childModelDict[id]; return _childModelDict[id];
} }
public void LoadSelectedModel(BaseModel baseModel) public void LoadSelectedModel(BaseModel baseModel)
{ {
Debug.Log($"Model {baseModel.NameHuman} started loading."); Debug.Log($"Model {baseModel.NameHuman} started loading.");
@@ -127,7 +127,7 @@ public class ModelManager : MonoBehaviour, IResettable
public void OpenSelector() public void OpenSelector()
{ {
Debug.Log("Open Selector"); Debug.Log("Open Selector");
baseModelGO.SetActive(false); baseModelGO.SetActive(false);
baseModelSelector.Activate(); baseModelSelector.Activate();
} }

View File

@@ -8,7 +8,7 @@ public class Port
readonly Quaternion _rotation; readonly Quaternion _rotation;
readonly float _scale; readonly float _scale;
readonly string _portName; readonly string _portName;
public readonly string PortID; public readonly string PortID;
public readonly string DefaultId; //the default ChildModel to apply on initialization public readonly string DefaultId; //the default ChildModel to apply on initialization
public bool Chooseable //whether the Port will be rendered in GUI public bool Chooseable //whether the Port will be rendered in GUI

View File

@@ -10,10 +10,10 @@ public class Exploder : MonoBehaviour, IResettable, IPointerDownHandler
public GameObject baseModel; public GameObject baseModel;
public TextMeshProUGUI text; public TextMeshProUGUI text;
public GameObject cms; public GameObject cms;
List<ExploderModel> models = new List<ExploderModel>(); List<ExploderModel> models = new List<ExploderModel>();
static readonly int finalTick = 60 * 2; // 60fps * 2sek, quest3 isn't 60fps but doesn't matter static readonly int finalTick = 60 * 2; // 60fps * 2sek, quest3 isn't 60fps but doesn't matter
public bool explode = false; public bool explode = false;
int tick = finalTick + 1; int tick = finalTick + 1;
@@ -25,7 +25,7 @@ public class Exploder : MonoBehaviour, IResettable, IPointerDownHandler
{ {
Explode(); Explode();
} }
} }
void Update() void Update()
{ {
@@ -57,7 +57,7 @@ public class Exploder : MonoBehaviour, IResettable, IPointerDownHandler
Debug.LogError($"Fixing ModelList Explode after {e}"); //happens when user changes model while animation Debug.LogError($"Fixing ModelList Explode after {e}"); //happens when user changes model while animation
CleanModelList(); CleanModelList();
} }
} }
void PopulateModelList() void PopulateModelList()
@@ -74,6 +74,7 @@ public class Exploder : MonoBehaviour, IResettable, IPointerDownHandler
models.Add(new ExploderModel(port, cmb.ChildModel, cmb)); models.Add(new ExploderModel(port, cmb.ChildModel, cmb));
} }
} }
void UpdateModelList() void UpdateModelList()
{ {
List<ExploderModel> modelss = new List<ExploderModel>(); List<ExploderModel> modelss = new List<ExploderModel>();

View File

@@ -26,4 +26,4 @@ public class ExploderModel
initPos = tf.localPosition; initPos = tf.localPosition;
goalPos = tf.localPosition + port.ExplodeDirection; goalPos = tf.localPosition + port.ExplodeDirection;
} }
} }

View File

@@ -9,7 +9,7 @@ public class Rotator : MonoBehaviour
public GameObject baseModel; public GameObject baseModel;
public Slider rotationSlider; public Slider rotationSlider;
public float joystickSpeed = 50f; public float joystickSpeed = 50f;
public void LoadBaseModelConfig(BaseModel model) public void LoadBaseModelConfig(BaseModel model)
{ {
SetMinMaxRotation(model.Rotation); SetMinMaxRotation(model.Rotation);
@@ -27,8 +27,8 @@ public class Rotator : MonoBehaviour
{ {
Vector2 joystickInput1 = OVRInput.Get(OVRInput.Axis2D.PrimaryThumbstick); Vector2 joystickInput1 = OVRInput.Get(OVRInput.Axis2D.PrimaryThumbstick);
Vector2 joystickInput2 = OVRInput.Get(OVRInput.Axis2D.SecondaryThumbstick); Vector2 joystickInput2 = OVRInput.Get(OVRInput.Axis2D.SecondaryThumbstick);
float joystickInput = joystickInput2.x + joystickInput1.x; float joystickInput = joystickInput2.x + joystickInput1.x;
if (Mathf.Abs(joystickInput) > 0.1f) if (Mathf.Abs(joystickInput) > 0.1f)
{ {
@@ -65,4 +65,4 @@ public class Rotator : MonoBehaviour
rotationSlider.maxValue = euler.y + 360f; rotationSlider.maxValue = euler.y + 360f;
rotationSlider.value = rotationSlider.minValue; //reset rotationSlider.value = rotationSlider.minValue; //reset
} }
} }

View File

@@ -4,7 +4,7 @@ using UnityEngine.UI;
namespace UI namespace UI
{ {
public class ARToggleButton: MonoBehaviour, IPointerDownHandler public class ARToggleButton : MonoBehaviour, IPointerDownHandler
{ {
public OVRPassthroughLayer passthroughLayer; public OVRPassthroughLayer passthroughLayer;
private bool pressed = false; //efix variable da button 2 mal pressed wird ?? private bool pressed = false; //efix variable da button 2 mal pressed wird ??
@@ -20,13 +20,14 @@ namespace UI
lastClickTime = Time.time; lastClickTime = Time.time;
TogglePassthrough(); TogglePassthrough();
} }
void Start() void Start()
{ {
gameObject.GetComponent<Button>().onClick.AddListener(TogglePassthrough); gameObject.GetComponent<Button>().onClick.AddListener(TogglePassthrough);
passthroughLayer.enabled = false; passthroughLayer.enabled = false;
} }
public void TogglePassthrough() public void TogglePassthrough()
{ {
Debug.Log($"TogglePassthrough pr {pressed}"); Debug.Log($"TogglePassthrough pr {pressed}");
@@ -50,4 +51,4 @@ namespace UI
pressed = false; pressed = false;
} }
} }
} }

View File

@@ -13,14 +13,14 @@ public class BaseModelSelector : MonoBehaviour
public GameObject uiButtonsCanvas; public GameObject uiButtonsCanvas;
public GameObject cmsCanvas; public GameObject cmsCanvas;
public Rotator rotator; public Rotator rotator;
void Start() void Start()
{ {
buttonPrefab.SetActive(false); buttonPrefab.SetActive(false);
uiButtonsCanvas.SetActive(false); uiButtonsCanvas.SetActive(false);
CreateModelButtons(); CreateModelButtons();
} }
void CreateModelButtons() void CreateModelButtons()
{ {
float startY = 0f; // Start position on Y axis float startY = 0f; // Start position on Y axis
@@ -36,24 +36,24 @@ public class BaseModelSelector : MonoBehaviour
} }
} }
void OnModelButtonClicked(BaseModel model) void OnModelButtonClicked(BaseModel model)
{ {
Debug.Log($"Selected model: {model.NameHuman}"); Debug.Log($"Selected model: {model.NameHuman}");
if (modelManager == null) if (modelManager == null)
{ {
Debug.LogError("ModelManager is not assigned!"); Debug.LogError("ModelManager is not assigned!");
return; return;
} }
modelManager.LoadSelectedModel(model); modelManager.LoadSelectedModel(model);
if (rotator == null) if (rotator == null)
{ {
Debug.LogWarning("Setting BaseModel for SliderHandler impossible; Handler: " + rotator); Debug.LogWarning("Setting BaseModel for SliderHandler impossible; Handler: " + rotator);
} }
rotator.LoadBaseModelConfig(model); rotator.LoadBaseModelConfig(model);
if (portSelector == null) if (portSelector == null)
{ {
Debug.LogError("PortSelector is null!"); Debug.LogError("PortSelector is null!");
@@ -74,15 +74,15 @@ public class BaseModelSelector : MonoBehaviour
return; return;
} }
gameObject.SetActive(false); gameObject.SetActive(false);
if (cmsCanvas == null) if (cmsCanvas == null)
{ {
Debug.LogError("CMS Canvas is null!"); Debug.LogError("CMS Canvas is null!");
} }
cmsCanvas.SetActive(true); cmsCanvas.SetActive(true);
} }
public void Activate() public void Activate()
{ {
gameObject.SetActive(true); gameObject.SetActive(true);
} }

View File

@@ -15,25 +15,19 @@ public class ChildModelSelector : MonoBehaviour, IResettable
public GameObject cmpPrefab; //childModelPickerPrefab (the actual button) public GameObject cmpPrefab; //childModelPickerPrefab (the actual button)
public GameObject daddy; public GameObject daddy;
public ColorSelector colorSelector; public ColorSelector colorSelector;
private string portId { set; get; } private string portId { set; get; }
public string PortID public string PortID
{ {
set set { portId = value; }
{ get { return portId; }
portId = value;
}
get
{
return portId;
}
} }
public int PortIndex { set; get; } public int PortIndex { set; get; }
public void AssignButtons() public void AssignButtons()
{ {
ResetThis(); ResetThis();
var childModels = modelManager.GetChildModelsForPort(PortID); var childModels = modelManager.GetChildModelsForPort(PortID);
foreach (var childModel in childModels) foreach (var childModel in childModels)
{ {
@@ -49,13 +43,13 @@ public class ChildModelSelector : MonoBehaviour, IResettable
} }
ChildModelSelectorButton cmsb = go.GetComponent<ChildModelSelectorButton>(); ChildModelSelectorButton cmsb = go.GetComponent<ChildModelSelectorButton>();
cmsb.AssignModel = () => AssignModel(childModel); cmsb.AssignModel = () => AssignModel(childModel);
cmsb.RemoveOtherMarkers = RemoveOtherMarkers; cmsb.RemoveOtherMarkers = RemoveOtherMarkers;
cmsb.Model = childModel; cmsb.Model = childModel;
if (modelManager.BaseModelBehaviour.portDict[PortIndex].NameId == childModel.NameId) if (modelManager.BaseModelBehaviour.portDict[PortIndex].NameId == childModel.NameId)
{ {
cmsb.marker.SetActive(true); cmsb.marker.SetActive(true);
} }
Models.Add(go); Models.Add(go);
Buttons.Add(cmsb); Buttons.Add(cmsb);
} }
@@ -72,7 +66,7 @@ public class ChildModelSelector : MonoBehaviour, IResettable
public void AssignModel(ChildModel model) public void AssignModel(ChildModel model)
{ {
modelManager.BaseModelBehaviour.UpdateChild(PortIndex, model.NameId); modelManager.BaseModelBehaviour.UpdateChild(PortIndex, model.NameId);
colorSelector.GenerateButtons(model, PortIndex); colorSelector.GenerateButtons(model, PortIndex);
} }
@@ -92,4 +86,3 @@ public class ChildModelSelector : MonoBehaviour, IResettable
Buttons.Clear(); Buttons.Clear();
} }
} }

View File

@@ -9,17 +9,17 @@ public class ChildModelSelectorButton : MonoBehaviour
public Action RemoveOtherMarkers; public Action RemoveOtherMarkers;
public Action AssignModel; public Action AssignModel;
public ChildModel Model { set; get; } public ChildModel Model { set; get; }
void Start() void Start()
{ {
this.GetOrAddComponent<Button>().onClick.AddListener(OnClick); this.GetOrAddComponent<Button>().onClick.AddListener(OnClick);
} }
public void OnClick() public void OnClick()
{ {
RemoveOtherMarkers(); RemoveOtherMarkers();
AssignModel(); AssignModel();
marker.SetActive(true); marker.SetActive(true);
} }
} }

View File

@@ -9,20 +9,20 @@ public class ColorSelector : MonoBehaviour, IResettable
List<GameObject> buttons = new List<GameObject>(); List<GameObject> buttons = new List<GameObject>();
GameObject Parent GameObject Parent
{ {
get { return gameObject.transform.parent.gameObject; } get { return gameObject.transform.parent.gameObject; }
} }
public void GenerateButtons(ChildModel model, int portIndex) public void GenerateButtons(ChildModel model, int portIndex)
{ {
ResetThis(); ResetThis();
if (!model.HasColor()) if (!model.HasColor())
{ {
Debug.Log($"{model} has no Colors defined, skipping"); Debug.Log($"{model} has no Colors defined, skipping");
Parent.SetActive(false); //hide menu, since there isn't anything to select Parent.SetActive(false); //hide menu, since there isn't anything to select
return; return;
} }
Parent.SetActive(true); Parent.SetActive(true);
int i = 0; int i = 0;
foreach (var color in model.Color) foreach (var color in model.Color)
@@ -31,7 +31,7 @@ public class ColorSelector : MonoBehaviour, IResettable
GameObject go = Spawn.GO(prefab, transform, off, "ColorButton_" + color); GameObject go = Spawn.GO(prefab, transform, off, "ColorButton_" + color);
go.GetComponent<UnityEngine.UI.Image>().color = color; go.GetComponent<UnityEngine.UI.Image>().color = color;
go.GetOrAddComponent<ColorSelectorButton>().PortIndex = portIndex; go.GetOrAddComponent<ColorSelectorButton>().PortIndex = portIndex;
go.SetActive(true); go.SetActive(true);
buttons.Add(go); buttons.Add(go);
i++; i++;
} }

View File

@@ -6,7 +6,7 @@ public class ColorSelectorButton : MonoBehaviour
{ {
public ModelManager modelManager; public ModelManager modelManager;
public int PortIndex { private get; set; } public int PortIndex { private get; set; }
void Start() void Start()
{ {
this.GetOrAddComponent<Button>().onClick.AddListener(OnClick); this.GetOrAddComponent<Button>().onClick.AddListener(OnClick);
@@ -16,7 +16,7 @@ public class ColorSelectorButton : MonoBehaviour
{ {
var image = GetComponent<Image>(); var image = GetComponent<Image>();
if (image == null) if (image == null)
{ {
Debug.LogWarning("ColorSelectorButton is missing an Image, can't set Color"); Debug.LogWarning("ColorSelectorButton is missing an Image, can't set Color");
return; return;
} }

View File

@@ -6,17 +6,17 @@ public class PortSelector : MonoBehaviour, IResettable
public ModelManager modelManager; public ModelManager modelManager;
public GameObject prefab; public GameObject prefab;
public Vector3 offset = new Vector3(0,48,0); public Vector3 offset = new Vector3(0, 48, 0);
public List<GameObject> portGOs = new List<GameObject>(); public List<GameObject> portGOs = new List<GameObject>();
public List<PortSelectorButton> listPSB = new List<PortSelectorButton>(); public List<PortSelectorButton> listPSB = new List<PortSelectorButton>();
public Dictionary<int, PortSelectorButton> mapPSB = new Dictionary<int, PortSelectorButton>(); public Dictionary<int, PortSelectorButton> mapPSB = new Dictionary<int, PortSelectorButton>();
//Gets called from BaseModelSelector //Gets called from BaseModelSelector
public void GenerateButtons() public void GenerateButtons()
{ {
ResetThis(); ResetThis();
int i = 0; int i = 0;
int index = 0; int index = 0;
foreach (Port port in modelManager.BaseModel.Ports) foreach (Port port in modelManager.BaseModel.Ports)
@@ -30,7 +30,7 @@ public class PortSelector : MonoBehaviour, IResettable
Vector3 off = i * offset; Vector3 off = i * offset;
Debug.Log($"Adding Port {port.PortName} : {port.PortID} to Selection with {off.x}, {off.y}, {off.z}"); Debug.Log($"Adding Port {port.PortName} : {port.PortID} to Selection with {off.x}, {off.y}, {off.z}");
var go = Spawn.GO(prefab, transform, off, port.PortID + i); var go = Spawn.GO(prefab, transform, off, port.PortID + i);
portGOs.Add(go); portGOs.Add(go);
go.SetActive(true); go.SetActive(true);
var text = go.GetComponentInChildren<TMPro.TextMeshProUGUI>(); var text = go.GetComponentInChildren<TMPro.TextMeshProUGUI>();
if (text == null) if (text == null)
@@ -49,7 +49,7 @@ public class PortSelector : MonoBehaviour, IResettable
i++; i++;
} }
} }
private void RemoveOtherMarkers() private void RemoveOtherMarkers()
{ {
foreach (var psb in listPSB) foreach (var psb in listPSB)

View File

@@ -11,16 +11,17 @@ public class PortSelectorButton : MonoBehaviour
public ColorSelector ColorSelector; public ColorSelector ColorSelector;
public string PortID { get; set; } public string PortID { get; set; }
public int PortIndex { set; get; } public int PortIndex { set; get; }
void Start() void Start()
{ {
this.GetOrAddComponent<Button>().onClick.AddListener(OnClick); this.GetOrAddComponent<Button>().onClick.AddListener(OnClick);
} }
public void OnClick() public void OnClick()
{ {
Debug.Log($"Changing Port to {this}"); Debug.Log($"Changing Port to {this}");
ColorSelector.ResetThis(); ColorSelector.ResetThis();
cms.PortID = PortID; cms.PortID = PortID;
cms.PortIndex = PortIndex; cms.PortIndex = PortIndex;
cms.AssignButtons(); // rebuilds GUI cms.AssignButtons(); // rebuilds GUI
cms.gameObject.SetActive(true); cms.gameObject.SetActive(true);

View File

@@ -5,7 +5,7 @@ using UnityEngine.UI;
public class ReturnButtonBehaviour : MonoBehaviour public class ReturnButtonBehaviour : MonoBehaviour
{ {
public StateManager StateManager; public StateManager StateManager;
void Start() void Start()
{ {
GetComponent<Button>().onClick.AddListener(OnClick); GetComponent<Button>().onClick.AddListener(OnClick);
@@ -16,5 +16,5 @@ public class ReturnButtonBehaviour : MonoBehaviour
Debug.Log("Return to Menu clicked"); Debug.Log("Return to Menu clicked");
StateManager.ResetAll(); StateManager.ResetAll();
} }
} }

View File

@@ -1,5 +1,6 @@
using UnityEngine; using UnityEngine;
public class Marker : MonoBehaviour public class Marker : MonoBehaviour
{ {
//this script doesn't do anything else than allow for getcomponentsinchildren to find a targeted feature //this script doesn't do anything else than allow for getcomponentsinchildren to find a targeted feature
} }

View File

@@ -105,5 +105,5 @@ public static class MathUtil
} }
return (num2 + 360f) % 360f; return (num2 + 360f) % 360f;
} }
} }

View File

@@ -33,10 +33,10 @@ public class ModelLoader
int i = 0; int i = 0;
for (int meshIndex = 0; meshIndex < toMesh - fromMesh; meshIndex++) for (int meshIndex = 0; meshIndex < toMesh - fromMesh; meshIndex++)
{ {
Debug.Log($"Mesh {fromMesh} to {toMesh} :: {toMesh-fromMesh} with index {meshIndex}"); Debug.Log($"Mesh {fromMesh} to {toMesh} :: {toMesh - fromMesh} with index {meshIndex}");
Mesh mesh = meshes[fromMesh + meshIndex]; Mesh mesh = meshes[fromMesh + meshIndex];
bool getSubMesh = useSubmeshes && mesh.subMeshCount > 1; bool getSubMesh = useSubmeshes && mesh.subMeshCount > 1;
List<Mesh> subMeshes = getSubMesh ? GetSubmeshes(mesh) : new List<Mesh>{mesh}; List<Mesh> subMeshes = getSubMesh ? GetSubmeshes(mesh) : new List<Mesh> { mesh };
if (getSubMesh) if (getSubMesh)
{ {
Debug.Log($"{i}. {subMeshes.Count} SubMeshes Found {nameId[i]}:{nameHuman[i]}"); Debug.Log($"{i}. {subMeshes.Count} SubMeshes Found {nameId[i]}:{nameHuman[i]}");
@@ -52,16 +52,16 @@ public class ModelLoader
Debug.Log($"SubMesh {subMeshIndex}"); Debug.Log($"SubMesh {subMeshIndex}");
Debug.Log($"{i}. {nameId[i]}:{nameHuman[i]} with {(ports[i] == null ? "null" : ports[i].Count)} ports"); Debug.Log($"{i}. {nameId[i]}:{nameHuman[i]} with {(ports[i] == null ? "null" : ports[i].Count)} ports");
appendList.Add(new ChildModel( appendList.Add(new ChildModel(
port[i], port[i],
nameHuman[i], nameHuman[i],
nameId[i], nameId[i],
subMeshes[subMeshIndex], subMeshes[subMeshIndex],
mats[i], mats[i],
offset[i], offset[i],
rotation[i], rotation[i],
scale[i], scale[i],
ports[i], ports[i],
colors?[i] colors?[i]
)); ));
i++; i++;
} }
@@ -69,8 +69,8 @@ public class ModelLoader
} }
public static void LoadChildFromPackedModel( public static void LoadChildFromPackedModel(
List<ChildModel> appendList, List<ChildModel> appendList,
List<ModelElement> list, List<ModelElement> list,
Mesh[] meshes, Mesh[] meshes,
int fromMesh = 0, int fromMesh = 0,
int toMesh = -1, int toMesh = -1,
@@ -85,7 +85,7 @@ public class ModelLoader
List<Vector3> scale = new List<Vector3>(); List<Vector3> scale = new List<Vector3>();
List<List<Port>> ports = new List<List<Port>>(); List<List<Port>> ports = new List<List<Port>>();
List<List<Color>> colors = new List<List<Color>>(); List<List<Color>> colors = new List<List<Color>>();
foreach (var modelElement in list) foreach (var modelElement in list)
{ {
port.Add(modelElement.Port); port.Add(modelElement.Port);
@@ -98,9 +98,20 @@ public class ModelLoader
ports.Add(modelElement.Ports); ports.Add(modelElement.Ports);
colors.Add(modelElement.Colors); colors.Add(modelElement.Colors);
} }
LoadChildModelsFromPackedModel(appendList, port.ToArray(), nameHuman.ToArray(), nameId.ToArray(), LoadChildModelsFromPackedModel(appendList,
meshes, mats.ToArray(), offset.ToArray(), rotation.ToArray(), port.ToArray(),
scale.ToArray(), ports.ToArray(), colors.ToArray(), fromMesh, toMesh, useSubmeshes); nameHuman.ToArray(),
nameId.ToArray(),
meshes,
mats.ToArray(),
offset.ToArray(),
rotation.ToArray(),
scale.ToArray(),
ports.ToArray(),
colors.ToArray(),
fromMesh,
toMesh,
useSubmeshes);
} }
static List<Mesh> GetSubmeshes(Mesh mesh) static List<Mesh> GetSubmeshes(Mesh mesh)

View File

@@ -5,19 +5,19 @@ public class Spawn
public static GameObject GO(Object prefab, Transform parent, Vector3 position, string name = null) public static GameObject GO(Object prefab, Transform parent, Vector3 position, string name = null)
{ {
GameObject gameObject = (GameObject)Object.Instantiate(prefab, parent); GameObject gameObject = (GameObject)Object.Instantiate(prefab, parent);
//gameObject.transform.localScale = new Vector3(1f, 1f, 1f); //gameObject.transform.localScale = new Vector3(1f, 1f, 1f);
if (position != null) //dont listen to lies kids if (position != null) //dont listen to lies kids
{ {
gameObject.transform.localPosition = position; gameObject.transform.localPosition = position;
} }
if (name != null) if (name != null)
{ {
gameObject.name = name; gameObject.name = name;
} }
return gameObject; return gameObject;
} }
} }