2024-01-12 16:28:35 +01:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class MoleculeFactoryTester: MonoBehaviour {
|
|
|
|
|
2024-01-18 14:24:40 +01:00
|
|
|
public TextAsset moleculeJson;
|
|
|
|
public TextAsset atomJson;
|
2024-01-12 16:28:35 +01:00
|
|
|
|
|
|
|
void Start(){
|
2024-01-18 14:24:40 +01:00
|
|
|
MoleculeFactory factory = MoleculeFactory.getInstrance(this.moleculeJson);
|
|
|
|
AtomeFactory atomeFactory = AtomeFactory.getInstrance(this.atomJson);
|
|
|
|
factory.setAtomFactory(atomeFactory);
|
|
|
|
GameObject mol = factory.createMolecule("O2");
|
2024-01-12 16:28:35 +01:00
|
|
|
GameObject mol2 = factory.createMolecule("H2O");
|
2024-01-18 14:24:40 +01:00
|
|
|
mol.transform.position = new Vector3(0,1,0);
|
|
|
|
GameObject mol3 = factory.createMolecule("C4H10");
|
|
|
|
mol3.transform.position = new Vector3(0,5,0);
|
2024-01-12 16:28:35 +01:00
|
|
|
//GameObject bon = GameOject.CreatePrimitive(PrimitiveType.)
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|