Пример #1
0
    private void DibujarPropulsor()
    {
        GameObject propulsorObject = GameObject.CreatePrimitive(PrimitiveType.Cube);

        propulsorObject.AddComponent <Cone>();
        propulsor            = propulsorObject.GetComponent <Cone>();
        propulsor.Altura     = AlturaPropulsor + 10;
        propulsor.Radio      = RadioPropulsor;
        propulsor.PosInicial = new Vector3(posInicial.x, posInicial.y, posInicial.z);
        propulsor.DibujarCono();
        propulsor.GetComponent <MeshRenderer>().material.color = colorPropulsor;
        propulsorObject.transform.parent = cohete.transform;
        propulsorObject.name             = "Propulsor";

        GameObject fueginho = GameObject.CreatePrimitive(PrimitiveType.Cube);

        fueginho.AddComponent <Cone>();
        fuego            = fueginho.GetComponent <Cone>();
        fuego.Altura     = AlturaPropulsor + 10;
        fuego.Radio      = RadioPropulsor - 2;
        fuego.PosInicial = new Vector3(posInicial.x, posInicial.y - 20, posInicial.z);
        fuego.DibujarCono();
        fuego.GetComponent <MeshRenderer>().material.color = new Color(1, 0.647f, 0);
        fueginho.transform.parent = cohete.transform;
        fueginho.transform.Rotate(new Vector3(-180, 0, 0));
        fueginho.AddComponent <AnimacionFuego>();
        fueginho.name = "Fuego";
    }
Пример #2
0
    private void DibujarPropulsor()
    {
        GameObject propulsorObject = GameObject.CreatePrimitive(PrimitiveType.Cube);

        propulsorObject.AddComponent <Cone>();
        propulsor            = propulsorObject.GetComponent <Cone>();
        propulsor.Altura     = AlturaPropulsor + 10;
        propulsor.Radio      = RadioPropulsor;
        propulsor.PosInicial = new Vector3(posInicial.x, posInicial.y, posInicial.z);
        propulsor.DibujarCono();
        propulsor.GetComponent <MeshRenderer>().material.color = colorPropulsor;
        propulsorObject.transform.parent = cohete.transform;
        propulsorObject.name             = "Propulsor";
    }
Пример #3
0
    private void DibujarPunta()
    {
        GameObject coneObject = GameObject.CreatePrimitive(PrimitiveType.Cube);

        coneObject.AddComponent <Cone>();
        cone            = coneObject.GetComponent <Cone>();
        cone.Altura     = AlturaPunta;
        cone.Radio      = RadioCohete;
        cone.PosInicial = new Vector3(posInicial.x, posInicial.y + AlturaCuerpo + AlturaPropulsor, posInicial.z);
        cone.DibujarCono();
        cone.GetComponent <MeshRenderer>().material.color = colorPunta;
        coneObject.transform.parent = cohete.transform;
        coneObject.name             = "Punta";
    }
Пример #4
0
    private void DibujarArbolCono()
    {
        GameObject coneObject = GameObject.CreatePrimitive(PrimitiveType.Cube);

        coneObject.AddComponent <Cone>();
        Cone cone = coneObject.GetComponent <Cone>();

        cone.Altura     = Random.Range(minAlturaCono, maxAlturaCono);
        cone.Radio      = Random.Range(minRadioCono, maxRadioCono + 1);
        cone.PosInicial = new Vector3(posInicial.x, posInicial.y + altura, posInicial.z);
        cone.DibujarCono();
        cone.GetComponent <MeshRenderer>().material.color = coloresHoja[Random.Range(0, coloresHoja.Length)];
        coneObject.transform.parent = arbol.transform;
        coneObject.name             = "Copa";
    }