ajout de l'atom factory
This commit is contained in:
@ -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);
|
||||
|
@ -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.)
|
||||
}
|
||||
|
||||
|
@ -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.)
|
||||
}
|
||||
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7d15c31ec91cb674fac22415c1ceff75
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user