Création du prefab et script de l'atom + ajout du lock mode

This commit is contained in:
2024-01-19 10:07:10 +01:00
parent 58782722d3
commit f4be67ca29
8 changed files with 507 additions and 46 deletions

View File

@ -37,7 +37,13 @@ public class AtomeFactory : MonoBehaviour{
return AtomeFactory.instance;
}
public AtomeInformation createAtome(string symbol){
public bool hasAtome(String symbol)
{
return AtomeDictionary.ContainsKey(symbol);
}
public AtomeInformation createAtome(string symbol){
if(!AtomeDictionary.ContainsKey(symbol)){
Debug.LogError("Atome does not existe in json");
}

View File

@ -104,6 +104,11 @@ public class MoleculeFactory : MonoBehaviour{
this.atomeFactory = atomeFactory;
}
public AtomeFactory GetAtomFactory()
{
return this.atomeFactory;
}
private GameObject CreateCylinderBetweenPoints(Vector3 start, Vector3 end, float width){
var offset = end - start;
var scale = new Vector3(width, offset.magnitude / 2.0f, width);