feat: liaison entre les molécules et couleur #9
@ -8,11 +8,13 @@ public class MoleculeFactory : MonoBehaviour{
|
|||||||
|
|
||||||
public TextAsset jsonFile;
|
public TextAsset jsonFile;
|
||||||
|
|
||||||
|
//public AtomeFactory atomeFactory = AtomeFactory.getInstrance(this.jsonFile);
|
||||||
|
|
||||||
private static MoleculeFactory instance;
|
private static MoleculeFactory instance;
|
||||||
|
|
||||||
private Molecules moleculesInJson;
|
private Molecules moleculesInJson;
|
||||||
|
|
||||||
private Dictionary<string, Molecule> moleculesDictionary;
|
private Dictionary<string, Molecule> moleculesDictionary;
|
||||||
|
|
||||||
public MoleculeFactory(TextAsset jsonFile){
|
public MoleculeFactory(TextAsset jsonFile){
|
||||||
MoleculeFactory.instance = this;
|
MoleculeFactory.instance = this;
|
||||||
@ -49,8 +51,10 @@ public class MoleculeFactory : MonoBehaviour{
|
|||||||
sphere.transform.parent = sortie.transform;
|
sphere.transform.parent = sortie.transform;
|
||||||
sphere.name = atom.element;
|
sphere.name = atom.element;
|
||||||
sphere.transform.localPosition = new Vector3(atom.geometry[0], atom.geometry[1], atom.geometry[2]);
|
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);
|
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;
|
sphere.GetComponent<Renderer>().material.color = myColor;
|
||||||
}
|
}
|
||||||
foreach (Bond bond in molecule.bonds){
|
foreach (Bond bond in molecule.bonds){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user