diff --git a/vr-configurator/Assets/Scripts/Managing/IResettable.cs b/vr-configurator/Assets/Scripts/Managing/IResettable.cs index a3ee6dd..5d9a8cd 100644 --- a/vr-configurator/Assets/Scripts/Managing/IResettable.cs +++ b/vr-configurator/Assets/Scripts/Managing/IResettable.cs @@ -5,4 +5,4 @@ public interface IResettable { public void ResetThis(); -} \ No newline at end of file +} diff --git a/vr-configurator/Assets/Scripts/Managing/StateManager.cs b/vr-configurator/Assets/Scripts/Managing/StateManager.cs index 669e927..cbe0aa8 100644 --- a/vr-configurator/Assets/Scripts/Managing/StateManager.cs +++ b/vr-configurator/Assets/Scripts/Managing/StateManager.cs @@ -7,7 +7,7 @@ using UnityEngine.SceneManagement; public class StateManager : MonoBehaviour { public List Resettables; - + private void populateResettables() { Resettables ??= new List(); @@ -18,7 +18,7 @@ public class StateManager : MonoBehaviour Resettables.AddRange(goot.GetComponentsInChildren(true)); } } - + void Start() { populateResettables(); diff --git a/vr-configurator/Assets/Scripts/Models/BaseModel.cs b/vr-configurator/Assets/Scripts/Models/BaseModel.cs index 347059a..4c72ab1 100644 --- a/vr-configurator/Assets/Scripts/Models/BaseModel.cs +++ b/vr-configurator/Assets/Scripts/Models/BaseModel.cs @@ -9,11 +9,12 @@ public class BaseModel : Model Quaternion rotation, Vector3 scale, List ports, List colors = null) : base(nameHuman, nameId, mesh, material, offset, rotation, scale, ports, colors) { - + } + public BaseModel(string nameHuman, string nameId, Mesh mesh, Material material, List ports, List colors = null) : base(nameHuman, nameId, mesh, material, ports, colors) { - + } } diff --git a/vr-configurator/Assets/Scripts/Models/BaseModelBehaviour.cs b/vr-configurator/Assets/Scripts/Models/BaseModelBehaviour.cs index 6c6f0c8..5e4d2b4 100644 --- a/vr-configurator/Assets/Scripts/Models/BaseModelBehaviour.cs +++ b/vr-configurator/Assets/Scripts/Models/BaseModelBehaviour.cs @@ -13,11 +13,8 @@ public class BaseModelBehaviour : ModelBehaviour } throw new InvalidCastException("model needs to be of type BaseModel"); } - set - { - Model = value; - } - + set { Model = value; } + } - + } diff --git a/vr-configurator/Assets/Scripts/Models/ChildModel.cs b/vr-configurator/Assets/Scripts/Models/ChildModel.cs index 9e6433c..195b829 100644 --- a/vr-configurator/Assets/Scripts/Models/ChildModel.cs +++ b/vr-configurator/Assets/Scripts/Models/ChildModel.cs @@ -6,21 +6,21 @@ using UnityEngine; public class ChildModel : Model { public string ParentPort { get; private set; } - + public ChildModel(string parentPort, string nameHuman, string nameId, Mesh mesh, Material material, Vector3 offset, Quaternion rotation, Vector3 scale, List ports = null, List colors = null, bool passthrough = false) : base(nameHuman, nameId, mesh, material, offset, rotation, scale, ports, colors, passthrough) { this.ParentPort = parentPort; } - + public ChildModel(string parentPort, string nameHuman, string nameId, Mesh mesh, Material material, List ports = null, List color = null, bool passthrough = false) : base(nameHuman, nameId, mesh, material, ports, color, passthrough) { this.ParentPort = parentPort; } - + // For Groups, no Mesh public ChildModel(string parentPort, string nameHuman, string nameId, Material material, Vector3 offset, Quaternion rotation, Vector3 scale, List ports = null, List colors = null, bool passthrough = false) @@ -28,5 +28,5 @@ public class ChildModel : Model { this.ParentPort = parentPort; } - + } diff --git a/vr-configurator/Assets/Scripts/Models/ChildModelBehaviour.cs b/vr-configurator/Assets/Scripts/Models/ChildModelBehaviour.cs index e2fbd22..a507c41 100644 --- a/vr-configurator/Assets/Scripts/Models/ChildModelBehaviour.cs +++ b/vr-configurator/Assets/Scripts/Models/ChildModelBehaviour.cs @@ -4,7 +4,7 @@ using UnityEngine; public class ChildModelBehaviour : ModelBehaviour { public ChildModel ChildModel - { + { get { if (Model == null) @@ -17,10 +17,7 @@ public class ChildModelBehaviour : ModelBehaviour } throw new InvalidCastException("ChildModelBehaviour needs to be of type ChildModel"); } - internal set - { - Model = value; - } + internal set { Model = value; } } public ModelBehaviour Parent { get; set; } @@ -31,7 +28,7 @@ public class ChildModelBehaviour : ModelBehaviour if (parentPort.PortID == ChildModel.ParentPort) { return parentPort; - } + } } Debug.LogWarning($"Didn't find port for {name} with PortID {ChildModel.ParentPort}"); return null; diff --git a/vr-configurator/Assets/Scripts/Models/Model.cs b/vr-configurator/Assets/Scripts/Models/Model.cs index e167ca2..520906b 100644 --- a/vr-configurator/Assets/Scripts/Models/Model.cs +++ b/vr-configurator/Assets/Scripts/Models/Model.cs @@ -7,12 +7,12 @@ public class Model public string NameId { get; internal set; } // JSON export name, should be unique public Mesh Mesh { get; internal set; } // obj/fbx public Material Material { get; internal set; } // skin - + public List Color { get; set; } // koleur public readonly bool Passthrough; //whether this passes through color - + public readonly List Ports; - + public readonly Vector3 Offset; public readonly Quaternion Rotation; public readonly Vector3 Scale; @@ -31,6 +31,7 @@ public class Model this.Color = color; this.Passthrough = passthrough; } + public Model(string nameHuman, string nameId, Mesh mesh, Material material, List ports = null, List color = null, bool passthrough = false) { this.NameHuman = nameHuman; @@ -54,5 +55,5 @@ public class Model { return Ports != null && Ports.Count > 0; } - + } diff --git a/vr-configurator/Assets/Scripts/Models/ModelBehaviour.cs b/vr-configurator/Assets/Scripts/Models/ModelBehaviour.cs index 25c2da6..e387aa0 100644 --- a/vr-configurator/Assets/Scripts/Models/ModelBehaviour.cs +++ b/vr-configurator/Assets/Scripts/Models/ModelBehaviour.cs @@ -11,13 +11,10 @@ public class ModelBehaviour : MonoBehaviour, IResettable public ModelManager ModelManager; public Exploder Exploder; Model _model; - + internal Model Model { - get - { - return _model; - } + get { return _model; } set { UpdateModel(value); @@ -27,26 +24,23 @@ public class ModelBehaviour : MonoBehaviour, IResettable } readonly List _children = new List(); public readonly Dictionary portDict = new Dictionary(); //for CMS marker - + public MeshFilter meshFilter; public MeshRenderer meshRenderer; public MeshCollider meshCollider; public ColliderSurface colliderSurface; public InteractableUnityEventWrapper interactable; public RayInteractable rayInteractable; - + bool lateInited = false; public PortSelector PortSelector; public int Index = -1; - + Color _color = Color.black; Color Color { - get - { - return _color; - } + get { return _color; } set { 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.localScale = newModel.Scale; transform.localPosition += newModel.Offset; - + //spawn new childPorts if (newModel.HasPorts()) { @@ -146,7 +140,7 @@ public class ModelBehaviour : MonoBehaviour, IResettable Debug.Log($"LateUpdateModel"); Exploder.HandleModelChange(); } - + public void UpdateChild(int portNum, string id) //onclick change model { if (portNum >= _children.Count) @@ -194,7 +188,7 @@ public class ModelBehaviour : MonoBehaviour, IResettable Destroy(child); continue; } - + //Debug.Log($"POS {child.transform.gameObject.name} pos {child.transform.localPosition} {child.transform.rotation} {child.transform.localScale}"); cmb.Parent = this; cmb.ChildModel = childModel; @@ -202,7 +196,7 @@ public class ModelBehaviour : MonoBehaviour, IResettable portDict[i] = cmb.ChildModel; } } - + /// /// -> see docs/exampleExport.json /// this doesn't include leading+trailing { } or commas, just the content @@ -218,7 +212,7 @@ public class ModelBehaviour : MonoBehaviour, IResettable export += "\"baseModel\": true,"; } export += $"\"modelId\": \"{Model.NameId}\""; - if(Model is ChildModel cm) + if (Model is ChildModel cm) { export += $", \"portId\": \"{cm.ParentPort}\""; } @@ -237,8 +231,8 @@ public class ModelBehaviour : MonoBehaviour, IResettable { continue; } - export += "{ \"i\": " + i +", " + _children[i].GetComponent().ExportJsonBase() + "}"; - if(i != Model.Ports.Count-1) //if not the last + export += "{ \"i\": " + i + ", " + _children[i].GetComponent().ExportJsonBase() + "}"; + if (i != Model.Ports.Count - 1) //if not the last { export += ","; } @@ -256,7 +250,7 @@ public class ModelBehaviour : MonoBehaviour, IResettable { return "{" + ExportJsonBase() + "}"; } - + public void UpdateChildColor(int portIndex, Color color) { if (portIndex < 0 || portIndex >= _children.Count) @@ -266,6 +260,7 @@ public class ModelBehaviour : MonoBehaviour, IResettable } _children[portIndex].GetComponent().Color = color; } + public void ClearChildren() { Debug.Log($"Removing Children of {name}..."); @@ -279,7 +274,7 @@ public class ModelBehaviour : MonoBehaviour, IResettable _children.Clear(); Debug.Log("Removed."); } - + //model clicked void OnSelect() { diff --git a/vr-configurator/Assets/Scripts/Models/ModelElement.cs b/vr-configurator/Assets/Scripts/Models/ModelElement.cs index 7d344dc..569cac7 100644 --- a/vr-configurator/Assets/Scripts/Models/ModelElement.cs +++ b/vr-configurator/Assets/Scripts/Models/ModelElement.cs @@ -3,15 +3,15 @@ using UnityEngine; public class ModelElement { - public string Port {get;} - public string NameHuman {get;} - public string NameId {get;} - public Material Mats {get;} - public Vector3 Offset {get;} - public Quaternion Rotation {get;} - public Vector3 Scale {get;} - public List Ports {get;} - public List Colors {get;} + public string Port { get; } + public string NameHuman { get; } + public string NameId { get; } + public Material Mats { get; } + public Vector3 Offset { get; } + public Quaternion Rotation { get; } + public Vector3 Scale { get; } + public List Ports { get; } + public List Colors { get; } public ModelElement(string port, string nameHuman, string nameId, Material mats, Vector3 offset, Quaternion rotation, Vector3 scale, List ports, List colors) diff --git a/vr-configurator/Assets/Scripts/Models/ModelList.cs b/vr-configurator/Assets/Scripts/Models/ModelList.cs index 8697137..8b00e9b 100644 --- a/vr-configurator/Assets/Scripts/Models/ModelList.cs +++ b/vr-configurator/Assets/Scripts/Models/ModelList.cs @@ -24,13 +24,13 @@ public class ModelList Port.Choosable("Back Frame", PortDef.BIKE_FRAME, "idBikeAttachments", 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_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_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.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.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.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( @@ -321,7 +321,7 @@ public class ModelList * ██████ ██ ██ ██ ███████ */ ModelLoader.LoadChildFromPackedModel(ChildModels, - new List + new List { new ModelElement(PortDef.BIKE_FRAME, "Back Frame", "idBikeAttachments", Resources.Load($"Material/AluminiumPolished"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumPolished), new ModelElement(PortDef.BIKE_FRAME2, "Frame", "idBikeFrame", Resources.Load($"Material/AluminiumPolished"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumPolished), @@ -348,104 +348,104 @@ public class ModelList ModelLoader.LoadChildFromPackedModel(ChildModels, new List { - new ModelElement( PortDef.ERL_CABLE_1, "Erlbach Part 1", "idErlbachPart1", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_2, "Erlbach Part 2", "idErlbachPart2", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CAP_3, "Erlbach Part 3", "idErlbachPart3", Resources.Load($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CAP_4, "Erlbach Part 4", "idErlbachPart4", Resources.Load($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CAP_5, "Erlbach Part 5", "idErlbachPart5", Resources.Load($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CAP_6, "Erlbach Part 6", "idErlbachPart6", Resources.Load($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CAP_7, "Erlbach Part 7", "idErlbachPart7", Resources.Load($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CAP_8, "Erlbach Part 8", "idErlbachPart8", Resources.Load($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CAP_9, "Erlbach Part 9", "idErlbachPart9", Resources.Load($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CAP_10, "Erlbach Part 10", "idErlbachPart10", Resources.Load($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CAP_11, "Erlbach Part 11", "idErlbachPart11", Resources.Load($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CAP_12, "Erlbach Part 12", "idErlbachPart12", Resources.Load($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CAP_13, "Erlbach Part 13", "idErlbachPart13", Resources.Load($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CAP_14, "Erlbach Part 14", "idErlbachPart14", Resources.Load($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CAP_15, "Erlbach Part 15", "idErlbachPart15", Resources.Load($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CAP_16, "Erlbach Part 16", "idErlbachPart16", Resources.Load($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CAP_17, "Erlbach Part 17", "idErlbachPart17", Resources.Load($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_18, "Erlbach Part 18", "idErlbachPart18", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_19, "Erlbach Part 19", "idErlbachPart19", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_20, "Erlbach Part 20", "idErlbachPart20", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_21, "Erlbach Part 21", "idErlbachPart21", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_22, "Erlbach Part 22", "idErlbachPart22", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_23, "Erlbach Part 23", "idErlbachPart23", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_24, "Erlbach Part 24", "idErlbachPart24", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_25, "Erlbach Part 25", "idErlbachPart25", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_26, "Erlbach Part 26", "idErlbachPart26", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_27, "Erlbach Part 27", "idErlbachPart27", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_28, "Erlbach Part 28", "idErlbachPart28", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_29, "Erlbach Part 29", "idErlbachPart29", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_30, "Erlbach Part 30", "idErlbachPart30", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_31, "Erlbach Part 31", "idErlbachPart31", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_32, "Erlbach Part 32", "idErlbachPart32", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_33, "Erlbach Part 33", "idErlbachPart33", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_34, "Erlbach Part 34", "idErlbachPart34", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_35, "Erlbach Part 35", "idErlbachPart35", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_36, "Erlbach Part 36", "idErlbachPart36", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_37, "Erlbach Part 37", "idErlbachPart37", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_38, "Erlbach Part 38", "idErlbachPart38", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CAP_39, "Erlbach Part 39", "idErlbachPart39", Resources.Load($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CAP_40, "Erlbach Part 40", "idErlbachPart40", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_41, "Erlbach Part 41", "idErlbachPart41", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_42, "Erlbach Part 42", "idErlbachPart42", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_43, "Erlbach Part 43", "idErlbachPart43", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_44, "Erlbach Part 44", "idErlbachPart44", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_45, "Erlbach Part 45", "idErlbachPart45", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_46, "Erlbach Part 46", "idErlbachPart46", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_47, "Erlbach Part 47", "idErlbachPart47", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_48, "Erlbach Part 48", "idErlbachPart48", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_49, "Erlbach Part 49", "idErlbachPart49", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_50, "Erlbach Part 50", "idErlbachPart50", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_51, "Erlbach Part 51", "idErlbachPart51", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_52, "Erlbach Part 52", "idErlbachPart52", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_53, "Erlbach Part 53", "idErlbachPart53", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_54, "Erlbach Part 54", "idErlbachPart54", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_55, "Erlbach Part 55", "idErlbachPart55", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_56, "Erlbach Part 56", "idErlbachPart56", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_57, "Erlbach Part 57", "idErlbachPart57", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_58, "Erlbach Part 58", "idErlbachPart58", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_59, "Erlbach Part 59", "idErlbachPart59", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_60, "Erlbach Part 60", "idErlbachPart60", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_61, "Erlbach Part 61", "idErlbachPart61", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_62, "Erlbach Part 62", "idErlbachPart62", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_63, "Erlbach Part 63", "idErlbachPart63", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_64, "Erlbach Part 64", "idErlbachPart64", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_65, "Erlbach Part 65", "idErlbachPart65", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_66, "Erlbach Part 66", "idErlbachPart66", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_67, "Erlbach Part 67", "idErlbachPart67", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_68, "Erlbach Part 68", "idErlbachPart68", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_69, "Erlbach Part 69", "idErlbachPart69", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_70, "Erlbach Part 70", "idErlbachPart70", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_71, "Erlbach Part 71", "idErlbachPart71", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_72, "Erlbach Part 72", "idErlbachPart72", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_CABLE_73, "Erlbach Part 73", "idErlbachPart73", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_BASEPLATE, "Frame", "idErlbachBody_BasePlate", Resources.Load($"Material/AluminiumScratched"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_BASEPLATE_FRONT, "Front Axle", "idErlbachPart75", Resources.Load($"Material/AluminiumScratched"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_BATBOX, "Battery Box", "idErlbachBatBox_Big", Resources.Load($"Material/PVC"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_PLATINE, "Erlbach Part 77", "idErlbachPart77", Resources.Load($"Material/PVC"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_ROD_78, "Erlbach Part 78", "idErlbachPart78", Resources.Load($"Material/PVC"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_ROD_79, "Erlbach Part 79", "idErlbachPart79", Resources.Load($"Material/PVC"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_TIRE_LH, "Tire LH", "erlTire1_LH", Resources.Load($"Material/CarTire"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_RIM_LH, "Standard Rim", "erlRim1_LH", Resources.Load($"Material/AluminiumScratched"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumScratched ), - new ModelElement( PortDef.ERL_TIRE_LV, "Tire LV", "erlTire1_LV", Resources.Load($"Material/CarTire"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_RIM_LV, "Standard Rim", "erlRim1_LV", Resources.Load($"Material/AluminiumScratched"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumScratched ), - new ModelElement( PortDef.ERL_TIRE_RH, "Tire RH", "erlTire1_RH", Resources.Load($"Material/CarTire"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_RIM_RH, "Standard Rim", "erlRim1_RH", Resources.Load($"Material/AluminiumScratched"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumScratched ), - new ModelElement( PortDef.ERL_TIRE_RV, "Tire RV", "erlTire1_RV", Resources.Load($"Material/CarTire"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_RIM_RV, "Standard Rim", "erlRim1_RV", Resources.Load($"Material/AluminiumScratched"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumScratched ), - new ModelElement( PortDef.ERL_BODY, "Body", "idErlbachPart84", Resources.Load($"Material/AluminiumPolished"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumPolished ), - new ModelElement( PortDef.ERL_BUMPER_BACK, "Rear Bumper", "idErlbachPart85", Resources.Load($"Material/AluminiumPolished"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumPolished ), - new ModelElement( PortDef.ERL_DRL_OUTLINE, "Front Bumper", "idErlbachPart86", Resources.Load($"Material/AluminiumPolished"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumPolished ), - new ModelElement( PortDef.ERL_BADGE, "Number", "idErlbachPart87", Resources.Load($"Material/AluminiumScratched"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumScratched ), - new ModelElement( PortDef.ERL_LP_BASE, "License Plate", "idErlbachPart88", Resources.Load($"Material/AluminiumPolished"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumPolished ), - new ModelElement( PortDef.ERL_LP_TEXT, "License Plate Content", "idErlbachPart89", Resources.Load($"Material/PVC"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_LP_COUNTRY, "Erlbach Part 90", "idErlbachPart90", Resources.Load($"Material/PVC"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_GRILL, "Standard Grill", "erlGrill_1", Resources.Load($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumBrushed ), - new ModelElement( PortDef.ERL_BUMPER_FRONT, "Headlight Cover", "idErlbachPart92", Resources.Load($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumBrushed ), - new ModelElement( PortDef.ERL_DRL_PLATE, "Headlight", "idErlbachPart93", Resources.Load($"Material/MetalMesh"), Vector3.zero, Quaternion.identity, Vector3.one, null, null ), - new ModelElement( PortDef.ERL_WINDOW, "Fenster", "idErlbachGlas", Resources.Load($"Material/Glas"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorGlass), + new ModelElement(PortDef.ERL_CABLE_1, "Erlbach Part 1", "idErlbachPart1", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_2, "Erlbach Part 2", "idErlbachPart2", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CAP_3, "Erlbach Part 3", "idErlbachPart3", Resources.Load($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CAP_4, "Erlbach Part 4", "idErlbachPart4", Resources.Load($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CAP_5, "Erlbach Part 5", "idErlbachPart5", Resources.Load($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CAP_6, "Erlbach Part 6", "idErlbachPart6", Resources.Load($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CAP_7, "Erlbach Part 7", "idErlbachPart7", Resources.Load($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CAP_8, "Erlbach Part 8", "idErlbachPart8", Resources.Load($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CAP_9, "Erlbach Part 9", "idErlbachPart9", Resources.Load($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CAP_10, "Erlbach Part 10", "idErlbachPart10", Resources.Load($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CAP_11, "Erlbach Part 11", "idErlbachPart11", Resources.Load($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CAP_12, "Erlbach Part 12", "idErlbachPart12", Resources.Load($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CAP_13, "Erlbach Part 13", "idErlbachPart13", Resources.Load($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CAP_14, "Erlbach Part 14", "idErlbachPart14", Resources.Load($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CAP_15, "Erlbach Part 15", "idErlbachPart15", Resources.Load($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CAP_16, "Erlbach Part 16", "idErlbachPart16", Resources.Load($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CAP_17, "Erlbach Part 17", "idErlbachPart17", Resources.Load($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_18, "Erlbach Part 18", "idErlbachPart18", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_19, "Erlbach Part 19", "idErlbachPart19", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_20, "Erlbach Part 20", "idErlbachPart20", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_21, "Erlbach Part 21", "idErlbachPart21", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_22, "Erlbach Part 22", "idErlbachPart22", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_23, "Erlbach Part 23", "idErlbachPart23", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_24, "Erlbach Part 24", "idErlbachPart24", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_25, "Erlbach Part 25", "idErlbachPart25", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_26, "Erlbach Part 26", "idErlbachPart26", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_27, "Erlbach Part 27", "idErlbachPart27", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_28, "Erlbach Part 28", "idErlbachPart28", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_29, "Erlbach Part 29", "idErlbachPart29", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_30, "Erlbach Part 30", "idErlbachPart30", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_31, "Erlbach Part 31", "idErlbachPart31", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_32, "Erlbach Part 32", "idErlbachPart32", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_33, "Erlbach Part 33", "idErlbachPart33", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_34, "Erlbach Part 34", "idErlbachPart34", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_35, "Erlbach Part 35", "idErlbachPart35", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_36, "Erlbach Part 36", "idErlbachPart36", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_37, "Erlbach Part 37", "idErlbachPart37", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_38, "Erlbach Part 38", "idErlbachPart38", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CAP_39, "Erlbach Part 39", "idErlbachPart39", Resources.Load($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CAP_40, "Erlbach Part 40", "idErlbachPart40", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_41, "Erlbach Part 41", "idErlbachPart41", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_42, "Erlbach Part 42", "idErlbachPart42", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_43, "Erlbach Part 43", "idErlbachPart43", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_44, "Erlbach Part 44", "idErlbachPart44", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_45, "Erlbach Part 45", "idErlbachPart45", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_46, "Erlbach Part 46", "idErlbachPart46", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_47, "Erlbach Part 47", "idErlbachPart47", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_48, "Erlbach Part 48", "idErlbachPart48", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_49, "Erlbach Part 49", "idErlbachPart49", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_50, "Erlbach Part 50", "idErlbachPart50", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_51, "Erlbach Part 51", "idErlbachPart51", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_52, "Erlbach Part 52", "idErlbachPart52", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_53, "Erlbach Part 53", "idErlbachPart53", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_54, "Erlbach Part 54", "idErlbachPart54", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_55, "Erlbach Part 55", "idErlbachPart55", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_56, "Erlbach Part 56", "idErlbachPart56", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_57, "Erlbach Part 57", "idErlbachPart57", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_58, "Erlbach Part 58", "idErlbachPart58", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_59, "Erlbach Part 59", "idErlbachPart59", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_60, "Erlbach Part 60", "idErlbachPart60", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_61, "Erlbach Part 61", "idErlbachPart61", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_62, "Erlbach Part 62", "idErlbachPart62", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_63, "Erlbach Part 63", "idErlbachPart63", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_64, "Erlbach Part 64", "idErlbachPart64", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_65, "Erlbach Part 65", "idErlbachPart65", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_66, "Erlbach Part 66", "idErlbachPart66", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_67, "Erlbach Part 67", "idErlbachPart67", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_68, "Erlbach Part 68", "idErlbachPart68", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_69, "Erlbach Part 69", "idErlbachPart69", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_70, "Erlbach Part 70", "idErlbachPart70", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_71, "Erlbach Part 71", "idErlbachPart71", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_72, "Erlbach Part 72", "idErlbachPart72", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_CABLE_73, "Erlbach Part 73", "idErlbachPart73", Resources.Load($"Material/PlasticCable"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_BASEPLATE, "Frame", "idErlbachBody_BasePlate", Resources.Load($"Material/AluminiumScratched"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_BASEPLATE_FRONT, "Front Axle", "idErlbachPart75", Resources.Load($"Material/AluminiumScratched"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_BATBOX, "Battery Box", "idErlbachBatBox_Big", Resources.Load($"Material/PVC"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_PLATINE, "Erlbach Part 77", "idErlbachPart77", Resources.Load($"Material/PVC"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_ROD_78, "Erlbach Part 78", "idErlbachPart78", Resources.Load($"Material/PVC"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_ROD_79, "Erlbach Part 79", "idErlbachPart79", Resources.Load($"Material/PVC"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_TIRE_LH, "Tire LH", "erlTire1_LH", Resources.Load($"Material/CarTire"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_RIM_LH, "Standard Rim", "erlRim1_LH", Resources.Load($"Material/AluminiumScratched"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumScratched), + new ModelElement(PortDef.ERL_TIRE_LV, "Tire LV", "erlTire1_LV", Resources.Load($"Material/CarTire"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_RIM_LV, "Standard Rim", "erlRim1_LV", Resources.Load($"Material/AluminiumScratched"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumScratched), + new ModelElement(PortDef.ERL_TIRE_RH, "Tire RH", "erlTire1_RH", Resources.Load($"Material/CarTire"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_RIM_RH, "Standard Rim", "erlRim1_RH", Resources.Load($"Material/AluminiumScratched"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumScratched), + new ModelElement(PortDef.ERL_TIRE_RV, "Tire RV", "erlTire1_RV", Resources.Load($"Material/CarTire"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_RIM_RV, "Standard Rim", "erlRim1_RV", Resources.Load($"Material/AluminiumScratched"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumScratched), + new ModelElement(PortDef.ERL_BODY, "Body", "idErlbachPart84", Resources.Load($"Material/AluminiumPolished"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumPolished), + new ModelElement(PortDef.ERL_BUMPER_BACK, "Rear Bumper", "idErlbachPart85", Resources.Load($"Material/AluminiumPolished"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumPolished), + new ModelElement(PortDef.ERL_DRL_OUTLINE, "Front Bumper", "idErlbachPart86", Resources.Load($"Material/AluminiumPolished"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumPolished), + new ModelElement(PortDef.ERL_BADGE, "Number", "idErlbachPart87", Resources.Load($"Material/AluminiumScratched"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumScratched), + new ModelElement(PortDef.ERL_LP_BASE, "License Plate", "idErlbachPart88", Resources.Load($"Material/AluminiumPolished"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumPolished), + new ModelElement(PortDef.ERL_LP_TEXT, "License Plate Content", "idErlbachPart89", Resources.Load($"Material/PVC"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_LP_COUNTRY, "Erlbach Part 90", "idErlbachPart90", Resources.Load($"Material/PVC"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_GRILL, "Standard Grill", "erlGrill_1", Resources.Load($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumBrushed), + new ModelElement(PortDef.ERL_BUMPER_FRONT, "Headlight Cover", "idErlbachPart92", Resources.Load($"Material/AluminiumBrushed"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorAluminiumBrushed), + new ModelElement(PortDef.ERL_DRL_PLATE, "Headlight", "idErlbachPart93", Resources.Load($"Material/MetalMesh"), Vector3.zero, Quaternion.identity, Vector3.one, null, null), + new ModelElement(PortDef.ERL_WINDOW, "Fenster", "idErlbachGlas", Resources.Load($"Material/Glas"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorGlass), }, Resources.LoadAll($"Model/ERLbach/ERLBach_mit_Fenster"), 1 //skip basemodel diff --git a/vr-configurator/Assets/Scripts/Models/ModelListColors.cs b/vr-configurator/Assets/Scripts/Models/ModelListColors.cs index ece3eb8..80d46e6 100644 --- a/vr-configurator/Assets/Scripts/Models/ModelListColors.cs +++ b/vr-configurator/Assets/Scripts/Models/ModelListColors.cs @@ -13,7 +13,7 @@ namespace Models Color.red, Color.yellow, }; - + public static List ColorGlass = new List() { Resources.Load($"Material/Glas").color, @@ -22,7 +22,7 @@ namespace Models new Color(0.1f, 0.1f, 0.1f, 0.65f), new Color(0.05f, 0.05f, 0.05f, 0.80f), }; - + public static List ColorAluminiumPolished = new List() { Color.black, @@ -56,4 +56,4 @@ namespace Models Color.yellow, }; } -} \ No newline at end of file +} diff --git a/vr-configurator/Assets/Scripts/Models/ModelManager.cs b/vr-configurator/Assets/Scripts/Models/ModelManager.cs index 5e86b50..442f28c 100644 --- a/vr-configurator/Assets/Scripts/Models/ModelManager.cs +++ b/vr-configurator/Assets/Scripts/Models/ModelManager.cs @@ -9,9 +9,9 @@ public class ModelManager : MonoBehaviour, IResettable Dictionary _childModelDict; //childModels by their ID public List BaseModelList; //available BaseModels - + public GameObject baseModelGO; //GameObject of the BaseModel - public BaseModel BaseModel //current baseModel Phenotype + public BaseModel BaseModel //current baseModel Phenotype { get { return baseModelGO.GetComponent().BaseModel; } } @@ -19,7 +19,7 @@ public class ModelManager : MonoBehaviour, IResettable { get { return baseModelGO.GetComponent(); } } - + public BaseModelSelector baseModelSelector; public GameObject childModelPrefab; @@ -30,7 +30,7 @@ public class ModelManager : MonoBehaviour, IResettable _portDict = new Dictionary>(); _childModelDict = new Dictionary(); BaseModelList = new List(); - + foreach (var baseModel in ModelList.BaseModels) { RegisterBaseModel(baseModel); @@ -56,7 +56,7 @@ public class ModelManager : MonoBehaviour, IResettable return; } _childModelDict[model.NameId] = model; - + //portDict if (string.IsNullOrEmpty(model.ParentPort)) { @@ -104,7 +104,7 @@ public class ModelManager : MonoBehaviour, IResettable { return _childModelDict[id]; } - + public void LoadSelectedModel(BaseModel baseModel) { Debug.Log($"Model {baseModel.NameHuman} started loading."); @@ -127,7 +127,7 @@ public class ModelManager : MonoBehaviour, IResettable public void OpenSelector() { Debug.Log("Open Selector"); - + baseModelGO.SetActive(false); baseModelSelector.Activate(); } diff --git a/vr-configurator/Assets/Scripts/Models/Port.cs b/vr-configurator/Assets/Scripts/Models/Port.cs index 988852d..156ef2e 100644 --- a/vr-configurator/Assets/Scripts/Models/Port.cs +++ b/vr-configurator/Assets/Scripts/Models/Port.cs @@ -8,7 +8,7 @@ public class Port readonly Quaternion _rotation; readonly float _scale; readonly string _portName; - + public readonly string PortID; public readonly string DefaultId; //the default ChildModel to apply on initialization public bool Chooseable //whether the Port will be rendered in GUI diff --git a/vr-configurator/Assets/Scripts/Transform/Exploder.cs b/vr-configurator/Assets/Scripts/Transform/Exploder.cs index 63502af..ea23bb5 100644 --- a/vr-configurator/Assets/Scripts/Transform/Exploder.cs +++ b/vr-configurator/Assets/Scripts/Transform/Exploder.cs @@ -10,10 +10,10 @@ public class Exploder : MonoBehaviour, IResettable, IPointerDownHandler public GameObject baseModel; public TextMeshProUGUI text; public GameObject cms; - - + + List models = new List(); - + static readonly int finalTick = 60 * 2; // 60fps * 2sek, quest3 isn't 60fps but doesn't matter public bool explode = false; int tick = finalTick + 1; @@ -25,7 +25,7 @@ public class Exploder : MonoBehaviour, IResettable, IPointerDownHandler { Explode(); } - } + } 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 CleanModelList(); } - + } void PopulateModelList() @@ -74,6 +74,7 @@ public class Exploder : MonoBehaviour, IResettable, IPointerDownHandler models.Add(new ExploderModel(port, cmb.ChildModel, cmb)); } } + void UpdateModelList() { List modelss = new List(); diff --git a/vr-configurator/Assets/Scripts/Transform/ExploderModel.cs b/vr-configurator/Assets/Scripts/Transform/ExploderModel.cs index 6b294ff..22cde73 100644 --- a/vr-configurator/Assets/Scripts/Transform/ExploderModel.cs +++ b/vr-configurator/Assets/Scripts/Transform/ExploderModel.cs @@ -26,4 +26,4 @@ public class ExploderModel initPos = tf.localPosition; goalPos = tf.localPosition + port.ExplodeDirection; } -} \ No newline at end of file +} diff --git a/vr-configurator/Assets/Scripts/Transform/Rotator.cs b/vr-configurator/Assets/Scripts/Transform/Rotator.cs index 6c0ad77..f29b29e 100644 --- a/vr-configurator/Assets/Scripts/Transform/Rotator.cs +++ b/vr-configurator/Assets/Scripts/Transform/Rotator.cs @@ -9,7 +9,7 @@ public class Rotator : MonoBehaviour public GameObject baseModel; public Slider rotationSlider; public float joystickSpeed = 50f; - + public void LoadBaseModelConfig(BaseModel model) { SetMinMaxRotation(model.Rotation); @@ -27,8 +27,8 @@ public class Rotator : MonoBehaviour { Vector2 joystickInput1 = OVRInput.Get(OVRInput.Axis2D.PrimaryThumbstick); 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) { @@ -65,4 +65,4 @@ public class Rotator : MonoBehaviour rotationSlider.maxValue = euler.y + 360f; rotationSlider.value = rotationSlider.minValue; //reset } -} \ No newline at end of file +} diff --git a/vr-configurator/Assets/Scripts/UI/ARToggleButton.cs b/vr-configurator/Assets/Scripts/UI/ARToggleButton.cs index d672f8d..ca6d8ed 100644 --- a/vr-configurator/Assets/Scripts/UI/ARToggleButton.cs +++ b/vr-configurator/Assets/Scripts/UI/ARToggleButton.cs @@ -4,7 +4,7 @@ using UnityEngine.UI; namespace UI { - public class ARToggleButton: MonoBehaviour, IPointerDownHandler + public class ARToggleButton : MonoBehaviour, IPointerDownHandler { public OVRPassthroughLayer passthroughLayer; private bool pressed = false; //efix variable da button 2 mal pressed wird ?? @@ -20,13 +20,14 @@ namespace UI lastClickTime = Time.time; TogglePassthrough(); - } + } + void Start() { gameObject.GetComponent