Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        public Instaitiate GetObject(string type)
        {
            Instaitiate instObject = _factory.GetObjects(type);

            return(instObject);
        }