public Instaitiate GetObjects(string type) { gameObject.AddComponent <Instaitiate>(); Instaitiate instObject = gameObject.GetComponent <Instaitiate>(); switch (type) { case "sphere": gameObject.AddComponent <SphereInst>(); instObject = gameObject.GetComponent <SphereInst>(); break; case "cube": gameObject.AddComponent <CubeInst>(); instObject = gameObject.GetComponent <CubeInst>(); break; case "cylinder": gameObject.AddComponent <CylinderInst>(); instObject = gameObject.GetComponent <CylinderInst>(); break; } return(instObject); }
public Instaitiate GetObject(string type) { Instaitiate instObject = _factory.GetObjects(type); return(instObject); }