feat: liaison entre les molécules et couleur #9

Merged
Nicolas merged 6 commits from feat/molecule/bons into develop 2024-01-18 13:47:24 +00:00
Showing only changes of commit 824a8fdbc6 - Show all commits

View File

@ -8,11 +8,13 @@ public class MoleculeFactory : MonoBehaviour{
public TextAsset jsonFile;
//public AtomeFactory atomeFactory = AtomeFactory.getInstrance(this.jsonFile);
private static MoleculeFactory instance;
private Molecules moleculesInJson;
private Dictionary<string, Molecule> moleculesDictionary;
private Dictionary<string, Molecule> moleculesDictionary;
public MoleculeFactory(TextAsset jsonFile){
MoleculeFactory.instance = this;
@ -49,8 +51,10 @@ public class MoleculeFactory : MonoBehaviour{
sphere.transform.parent = sortie.transform;
sphere.name = atom.element;
sphere.transform.localPosition = new Vector3(atom.geometry[0], atom.geometry[1], atom.geometry[2]);
//AtomeInformation att = Atomfactory.createAtome(atom.element);
Color myColor = new Color(0, 0, 1, 1);
ColorUtility.TryParseHtmlString("#0AC742", out myColor);
//TODO géré atom factory
//ColorUtility.TryParseHtmlString(att.representation.color, out myColor);
sphere.GetComponent<Renderer>().material.color = myColor;
}
foreach (Bond bond in molecule.bonds){