ajout de l'atom factory

This commit is contained in:
2024-02-02 15:29:49 +01:00
parent 9c5f5b15fb
commit a642cc0a38
19 changed files with 406 additions and 87 deletions

View File

@ -36,6 +36,11 @@ public class AtomeFactory : MonoBehaviour{
}
return AtomeFactory.instance;
}
public bool hasAtome(String symbol)
{
return AtomeDictionary.ContainsKey(symbol);
}
public AtomeInformation createAtome(string symbol){
if(!AtomeDictionary.ContainsKey(symbol)){
@ -76,7 +81,7 @@ public class AtomeFactory : MonoBehaviour{
GameObject orbitCircle = new GameObject("Orbit Circle");
LineRenderer lineRenderer = orbitCircle.AddComponent<LineRenderer>();
lineRenderer.useWorldSpace = false;
lineRenderer.widthMultiplier = 0.05f; // Ajustez l'épaisseur de la ligne si nécessaire.
lineRenderer.widthMultiplier = 0.03f; // Ajustez l'épaisseur de la ligne si nécessaire.
lineRenderer.positionCount = 100 + 1;
//Add Color
Color myColor = new Color(0, 0, 1, 1);

View File

@ -11,14 +11,14 @@ class MoleculeFactoryTester: MonoBehaviour {
public TextAsset atomJson;
void Start(){
MoleculeFactory factory = MoleculeFactory.getInstrance(this.moleculeJson);
/*MoleculeFactory factory = MoleculeFactory.getInstrance(this.moleculeJson);
AtomeFactory atomeFactory = AtomeFactory.getInstrance(this.atomJson);
factory.setAtomFactory(atomeFactory);
GameObject mol = factory.createMolecule("O2");
GameObject mol2 = factory.createMolecule("H2O");
mol.transform.position = new Vector3(0,1,0);
GameObject mol3 = factory.createMolecule("C4H10");
mol3.transform.position = new Vector3(0,5,0);
mol3.transform.position = new Vector3(0,5,0);*/
//GameObject bon = GameOject.CreatePrimitive(PrimitiveType.)
}

View File

@ -1,19 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
class MoleculeFactoryTester: MonoBehaviour {
public TextAsset moleculeJson;
public TextAsset atomJson;
void Start(){
MoleculeFactory factory = MoleculeFactory.getInstrance(this.moleculeJson);
AtomeFactory atomeFactory = AtomeFactory.getInstrance(this.atomJson);
GameObject mol = atomeFactory.createAnimatedAtome("Na");
//mol.transform.position = new Vector3(0,1,0);
//GameObject bon = GameOject.CreatePrimitive(PrimitiveType.)
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 7d15c31ec91cb674fac22415c1ceff75
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: