"i work at blizzard"
This commit is contained in:
@@ -5,4 +5,4 @@
|
||||
public interface IResettable
|
||||
{
|
||||
public void ResetThis();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ using UnityEngine.SceneManagement;
|
||||
public class StateManager : MonoBehaviour
|
||||
{
|
||||
public List<IResettable> Resettables;
|
||||
|
||||
|
||||
private void populateResettables()
|
||||
{
|
||||
Resettables ??= new List<IResettable>();
|
||||
@@ -18,7 +18,7 @@ public class StateManager : MonoBehaviour
|
||||
Resettables.AddRange(goot.GetComponentsInChildren<IResettable>(true));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Start()
|
||||
{
|
||||
populateResettables();
|
||||
|
||||
@@ -9,11 +9,12 @@ public class BaseModel : Model
|
||||
Quaternion rotation, Vector3 scale, List<Port> ports, List<Color> colors = null)
|
||||
: 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)
|
||||
: base(nameHuman, nameId, mesh, material, ports, colors)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,11 +13,8 @@ public class BaseModelBehaviour : ModelBehaviour
|
||||
}
|
||||
throw new InvalidCastException("model needs to be of type BaseModel");
|
||||
}
|
||||
set
|
||||
{
|
||||
Model = value;
|
||||
}
|
||||
|
||||
set { Model = value; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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<Port> ports = null, List<Color> 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<Port> ports = null, List<Color> 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<Port> ports = null, List<Color> colors = null, bool passthrough = false)
|
||||
@@ -28,5 +28,5 @@ public class ChildModel : Model
|
||||
{
|
||||
this.ParentPort = parentPort;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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> Color { get; set; } // koleur
|
||||
public readonly bool Passthrough; //whether this passes through color
|
||||
|
||||
|
||||
public readonly List<Port> 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<Port> ports = null, List<Color> color = null, bool passthrough = false)
|
||||
{
|
||||
this.NameHuman = nameHuman;
|
||||
@@ -54,5 +55,5 @@ public class Model
|
||||
{
|
||||
return Ports != null && Ports.Count > 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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<GameObject> _children = new List<GameObject>();
|
||||
public readonly Dictionary<int, ChildModel> portDict = new Dictionary<int, ChildModel>(); //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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// -> 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<ChildModelBehaviour>().ExportJsonBase() + "}";
|
||||
if(i != Model.Ports.Count-1) //if not the last
|
||||
export += "{ \"i\": " + i + ", " + _children[i].GetComponent<ChildModelBehaviour>().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<ChildModelBehaviour>().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()
|
||||
{
|
||||
|
||||
@@ -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<Port> Ports {get;}
|
||||
public List<Color> 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<Port> Ports { get; }
|
||||
public List<Color> Colors { get; }
|
||||
|
||||
public ModelElement(string port, string nameHuman, string nameId, Material mats, Vector3 offset,
|
||||
Quaternion rotation, Vector3 scale, List<Port> ports, List<Color> colors)
|
||||
|
||||
@@ -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<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_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,
|
||||
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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_WINDOW, "Fenster", "idErlbachGlas", Resources.Load<Material>($"Material/Glas"), Vector3.zero, Quaternion.identity, Vector3.one, null, ModelListColors.ColorGlass),
|
||||
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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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),
|
||||
},
|
||||
Resources.LoadAll<Mesh>($"Model/ERLbach/ERLBach_mit_Fenster"),
|
||||
1 //skip basemodel
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Models
|
||||
Color.red,
|
||||
Color.yellow,
|
||||
};
|
||||
|
||||
|
||||
public static List<Color> ColorGlass = new List<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.05f, 0.05f, 0.05f, 0.80f),
|
||||
};
|
||||
|
||||
|
||||
public static List<Color> ColorAluminiumPolished = new List<Color>()
|
||||
{
|
||||
Color.black,
|
||||
@@ -56,4 +56,4 @@ namespace Models
|
||||
Color.yellow,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,9 +9,9 @@ public class ModelManager : MonoBehaviour, IResettable
|
||||
Dictionary<string, ChildModel> _childModelDict; //childModels by their ID
|
||||
|
||||
public List<BaseModel> 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<BaseModelBehaviour>().BaseModel; }
|
||||
}
|
||||
@@ -19,7 +19,7 @@ public class ModelManager : MonoBehaviour, IResettable
|
||||
{
|
||||
get { return baseModelGO.GetComponent<BaseModelBehaviour>(); }
|
||||
}
|
||||
|
||||
|
||||
public BaseModelSelector baseModelSelector;
|
||||
public GameObject childModelPrefab;
|
||||
|
||||
@@ -30,7 +30,7 @@ public class ModelManager : MonoBehaviour, IResettable
|
||||
_portDict = new Dictionary<string, HashSet<ChildModel>>();
|
||||
_childModelDict = new Dictionary<string, ChildModel>();
|
||||
BaseModelList = new List<BaseModel>();
|
||||
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -10,10 +10,10 @@ public class Exploder : MonoBehaviour, IResettable, IPointerDownHandler
|
||||
public GameObject baseModel;
|
||||
public TextMeshProUGUI text;
|
||||
public GameObject cms;
|
||||
|
||||
|
||||
|
||||
|
||||
List<ExploderModel> models = new List<ExploderModel>();
|
||||
|
||||
|
||||
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<ExploderModel> modelss = new List<ExploderModel>();
|
||||
|
||||
@@ -26,4 +26,4 @@ public class ExploderModel
|
||||
initPos = tf.localPosition;
|
||||
goalPos = tf.localPosition + port.ExplodeDirection;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<Button>().onClick.AddListener(TogglePassthrough);
|
||||
passthroughLayer.enabled = false;
|
||||
}
|
||||
|
||||
|
||||
public void TogglePassthrough()
|
||||
{
|
||||
Debug.Log($"TogglePassthrough pr {pressed}");
|
||||
@@ -50,4 +51,4 @@ namespace UI
|
||||
pressed = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,14 +13,14 @@ public class BaseModelSelector : MonoBehaviour
|
||||
public GameObject uiButtonsCanvas;
|
||||
public GameObject cmsCanvas;
|
||||
public Rotator rotator;
|
||||
|
||||
|
||||
void Start()
|
||||
{
|
||||
buttonPrefab.SetActive(false);
|
||||
uiButtonsCanvas.SetActive(false);
|
||||
CreateModelButtons();
|
||||
}
|
||||
|
||||
|
||||
void CreateModelButtons()
|
||||
{
|
||||
float startY = 0f; // Start position on Y axis
|
||||
@@ -36,24 +36,24 @@ public class BaseModelSelector : MonoBehaviour
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void OnModelButtonClicked(BaseModel model)
|
||||
{
|
||||
Debug.Log($"Selected model: {model.NameHuman}");
|
||||
|
||||
|
||||
if (modelManager == null)
|
||||
{
|
||||
Debug.LogError("ModelManager is not assigned!");
|
||||
return;
|
||||
}
|
||||
modelManager.LoadSelectedModel(model);
|
||||
|
||||
|
||||
if (rotator == null)
|
||||
{
|
||||
Debug.LogWarning("Setting BaseModel for SliderHandler impossible; Handler: " + rotator);
|
||||
}
|
||||
rotator.LoadBaseModelConfig(model);
|
||||
|
||||
|
||||
if (portSelector == null)
|
||||
{
|
||||
Debug.LogError("PortSelector is null!");
|
||||
@@ -74,15 +74,15 @@ public class BaseModelSelector : MonoBehaviour
|
||||
return;
|
||||
}
|
||||
gameObject.SetActive(false);
|
||||
|
||||
|
||||
if (cmsCanvas == null)
|
||||
{
|
||||
Debug.LogError("CMS Canvas is null!");
|
||||
}
|
||||
cmsCanvas.SetActive(true);
|
||||
}
|
||||
|
||||
public void Activate()
|
||||
|
||||
public void Activate()
|
||||
{
|
||||
gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
@@ -15,25 +15,19 @@ public class ChildModelSelector : MonoBehaviour, IResettable
|
||||
public GameObject cmpPrefab; //childModelPickerPrefab (the actual button)
|
||||
public GameObject daddy;
|
||||
public ColorSelector colorSelector;
|
||||
|
||||
|
||||
private string portId { set; get; }
|
||||
public string PortID
|
||||
{
|
||||
set
|
||||
{
|
||||
portId = value;
|
||||
}
|
||||
get
|
||||
{
|
||||
return portId;
|
||||
}
|
||||
set { portId = value; }
|
||||
get { return portId; }
|
||||
}
|
||||
public int PortIndex { set; get; }
|
||||
|
||||
|
||||
public void AssignButtons()
|
||||
{
|
||||
ResetThis();
|
||||
|
||||
|
||||
var childModels = modelManager.GetChildModelsForPort(PortID);
|
||||
foreach (var childModel in childModels)
|
||||
{
|
||||
@@ -49,13 +43,13 @@ public class ChildModelSelector : MonoBehaviour, IResettable
|
||||
}
|
||||
ChildModelSelectorButton cmsb = go.GetComponent<ChildModelSelectorButton>();
|
||||
cmsb.AssignModel = () => AssignModel(childModel);
|
||||
cmsb.RemoveOtherMarkers = RemoveOtherMarkers;
|
||||
cmsb.RemoveOtherMarkers = RemoveOtherMarkers;
|
||||
cmsb.Model = childModel;
|
||||
if (modelManager.BaseModelBehaviour.portDict[PortIndex].NameId == childModel.NameId)
|
||||
{
|
||||
cmsb.marker.SetActive(true);
|
||||
}
|
||||
|
||||
|
||||
Models.Add(go);
|
||||
Buttons.Add(cmsb);
|
||||
}
|
||||
@@ -72,7 +66,7 @@ public class ChildModelSelector : MonoBehaviour, IResettable
|
||||
public void AssignModel(ChildModel model)
|
||||
{
|
||||
modelManager.BaseModelBehaviour.UpdateChild(PortIndex, model.NameId);
|
||||
|
||||
|
||||
colorSelector.GenerateButtons(model, PortIndex);
|
||||
}
|
||||
|
||||
@@ -92,4 +86,3 @@ public class ChildModelSelector : MonoBehaviour, IResettable
|
||||
Buttons.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,17 +9,17 @@ public class ChildModelSelectorButton : MonoBehaviour
|
||||
public Action RemoveOtherMarkers;
|
||||
public Action AssignModel;
|
||||
public ChildModel Model { set; get; }
|
||||
|
||||
|
||||
|
||||
|
||||
void Start()
|
||||
{
|
||||
this.GetOrAddComponent<Button>().onClick.AddListener(OnClick);
|
||||
}
|
||||
|
||||
|
||||
public void OnClick()
|
||||
{
|
||||
RemoveOtherMarkers();
|
||||
AssignModel();
|
||||
marker.SetActive(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,20 +9,20 @@ public class ColorSelector : MonoBehaviour, IResettable
|
||||
List<GameObject> buttons = new List<GameObject>();
|
||||
GameObject Parent
|
||||
{
|
||||
get { return gameObject.transform.parent.gameObject; }
|
||||
get { return gameObject.transform.parent.gameObject; }
|
||||
}
|
||||
|
||||
|
||||
public void GenerateButtons(ChildModel model, int portIndex)
|
||||
{
|
||||
ResetThis();
|
||||
|
||||
|
||||
if (!model.HasColor())
|
||||
{
|
||||
Debug.Log($"{model} has no Colors defined, skipping");
|
||||
Parent.SetActive(false); //hide menu, since there isn't anything to select
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Parent.SetActive(true);
|
||||
int i = 0;
|
||||
foreach (var color in model.Color)
|
||||
@@ -31,7 +31,7 @@ public class ColorSelector : MonoBehaviour, IResettable
|
||||
GameObject go = Spawn.GO(prefab, transform, off, "ColorButton_" + color);
|
||||
go.GetComponent<UnityEngine.UI.Image>().color = color;
|
||||
go.GetOrAddComponent<ColorSelectorButton>().PortIndex = portIndex;
|
||||
go.SetActive(true);
|
||||
go.SetActive(true);
|
||||
buttons.Add(go);
|
||||
i++;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ public class ColorSelectorButton : MonoBehaviour
|
||||
{
|
||||
public ModelManager modelManager;
|
||||
public int PortIndex { private get; set; }
|
||||
|
||||
|
||||
void Start()
|
||||
{
|
||||
this.GetOrAddComponent<Button>().onClick.AddListener(OnClick);
|
||||
@@ -16,7 +16,7 @@ public class ColorSelectorButton : MonoBehaviour
|
||||
{
|
||||
var image = GetComponent<Image>();
|
||||
if (image == null)
|
||||
{
|
||||
{
|
||||
Debug.LogWarning("ColorSelectorButton is missing an Image, can't set Color");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -6,17 +6,17 @@ public class PortSelector : MonoBehaviour, IResettable
|
||||
public ModelManager modelManager;
|
||||
|
||||
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<PortSelectorButton> listPSB = new List<PortSelectorButton>();
|
||||
public Dictionary<int, PortSelectorButton> mapPSB = new Dictionary<int, PortSelectorButton>();
|
||||
|
||||
|
||||
//Gets called from BaseModelSelector
|
||||
public void GenerateButtons()
|
||||
{
|
||||
ResetThis();
|
||||
|
||||
|
||||
int i = 0;
|
||||
int index = 0;
|
||||
foreach (Port port in modelManager.BaseModel.Ports)
|
||||
@@ -30,7 +30,7 @@ public class PortSelector : MonoBehaviour, IResettable
|
||||
Vector3 off = i * offset;
|
||||
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);
|
||||
portGOs.Add(go);
|
||||
portGOs.Add(go);
|
||||
go.SetActive(true);
|
||||
var text = go.GetComponentInChildren<TMPro.TextMeshProUGUI>();
|
||||
if (text == null)
|
||||
@@ -49,7 +49,7 @@ public class PortSelector : MonoBehaviour, IResettable
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void RemoveOtherMarkers()
|
||||
{
|
||||
foreach (var psb in listPSB)
|
||||
|
||||
@@ -11,16 +11,17 @@ public class PortSelectorButton : MonoBehaviour
|
||||
public ColorSelector ColorSelector;
|
||||
public string PortID { get; set; }
|
||||
public int PortIndex { set; get; }
|
||||
|
||||
|
||||
void Start()
|
||||
{
|
||||
this.GetOrAddComponent<Button>().onClick.AddListener(OnClick);
|
||||
}
|
||||
|
||||
public void OnClick()
|
||||
{
|
||||
Debug.Log($"Changing Port to {this}");
|
||||
ColorSelector.ResetThis();
|
||||
cms.PortID = PortID;
|
||||
cms.PortID = PortID;
|
||||
cms.PortIndex = PortIndex;
|
||||
cms.AssignButtons(); // rebuilds GUI
|
||||
cms.gameObject.SetActive(true);
|
||||
|
||||
@@ -5,7 +5,7 @@ using UnityEngine.UI;
|
||||
public class ReturnButtonBehaviour : MonoBehaviour
|
||||
{
|
||||
public StateManager StateManager;
|
||||
|
||||
|
||||
void Start()
|
||||
{
|
||||
GetComponent<Button>().onClick.AddListener(OnClick);
|
||||
@@ -16,5 +16,5 @@ public class ReturnButtonBehaviour : MonoBehaviour
|
||||
Debug.Log("Return to Menu clicked");
|
||||
StateManager.ResetAll();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class Marker : MonoBehaviour
|
||||
{
|
||||
//this script doesn't do anything else than allow for getcomponentsinchildren to find a targeted feature
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,5 +105,5 @@ public static class MathUtil
|
||||
}
|
||||
return (num2 + 360f) % 360f;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -33,10 +33,10 @@ public class ModelLoader
|
||||
int i = 0;
|
||||
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];
|
||||
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)
|
||||
{
|
||||
Debug.Log($"{i}. {subMeshes.Count} SubMeshes Found {nameId[i]}:{nameHuman[i]}");
|
||||
@@ -52,16 +52,16 @@ public class ModelLoader
|
||||
Debug.Log($"SubMesh {subMeshIndex}");
|
||||
Debug.Log($"{i}. {nameId[i]}:{nameHuman[i]} with {(ports[i] == null ? "null" : ports[i].Count)} ports");
|
||||
appendList.Add(new ChildModel(
|
||||
port[i],
|
||||
nameHuman[i],
|
||||
nameId[i],
|
||||
subMeshes[subMeshIndex],
|
||||
mats[i],
|
||||
offset[i],
|
||||
rotation[i],
|
||||
scale[i],
|
||||
ports[i],
|
||||
colors?[i]
|
||||
port[i],
|
||||
nameHuman[i],
|
||||
nameId[i],
|
||||
subMeshes[subMeshIndex],
|
||||
mats[i],
|
||||
offset[i],
|
||||
rotation[i],
|
||||
scale[i],
|
||||
ports[i],
|
||||
colors?[i]
|
||||
));
|
||||
i++;
|
||||
}
|
||||
@@ -69,8 +69,8 @@ public class ModelLoader
|
||||
}
|
||||
|
||||
public static void LoadChildFromPackedModel(
|
||||
List<ChildModel> appendList,
|
||||
List<ModelElement> list,
|
||||
List<ChildModel> appendList,
|
||||
List<ModelElement> list,
|
||||
Mesh[] meshes,
|
||||
int fromMesh = 0,
|
||||
int toMesh = -1,
|
||||
@@ -85,7 +85,7 @@ public class ModelLoader
|
||||
List<Vector3> scale = new List<Vector3>();
|
||||
List<List<Port>> ports = new List<List<Port>>();
|
||||
List<List<Color>> colors = new List<List<Color>>();
|
||||
|
||||
|
||||
foreach (var modelElement in list)
|
||||
{
|
||||
port.Add(modelElement.Port);
|
||||
@@ -98,9 +98,20 @@ public class ModelLoader
|
||||
ports.Add(modelElement.Ports);
|
||||
colors.Add(modelElement.Colors);
|
||||
}
|
||||
LoadChildModelsFromPackedModel(appendList, port.ToArray(), nameHuman.ToArray(), nameId.ToArray(),
|
||||
meshes, mats.ToArray(), offset.ToArray(), rotation.ToArray(),
|
||||
scale.ToArray(), ports.ToArray(), colors.ToArray(), fromMesh, toMesh, useSubmeshes);
|
||||
LoadChildModelsFromPackedModel(appendList,
|
||||
port.ToArray(),
|
||||
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)
|
||||
|
||||
@@ -5,19 +5,19 @@ public class Spawn
|
||||
public static GameObject GO(Object prefab, Transform parent, Vector3 position, string name = null)
|
||||
{
|
||||
GameObject gameObject = (GameObject)Object.Instantiate(prefab, parent);
|
||||
|
||||
|
||||
//gameObject.transform.localScale = new Vector3(1f, 1f, 1f);
|
||||
|
||||
|
||||
if (position != null) //dont listen to lies kids
|
||||
{
|
||||
gameObject.transform.localPosition = position;
|
||||
}
|
||||
|
||||
|
||||
if (name != null)
|
||||
{
|
||||
gameObject.name = name;
|
||||
}
|
||||
|
||||
|
||||
return gameObject;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user