Example #1
0
 // Start is called before the first frame update
 void Start()
 {
     CanvasTienda = GameObject.Find("TiendaC").GetComponent <Canvas>();
     Dialogo      = new NPC_Dialogo();
     Dialogo.Inicializacion();
     Dialogos.Mensaje = "Dime que quieres conseguir";
 }
Example #2
0
    // Start is called before the first frame update
    void Start()
    {
        animatorNpc = GetComponent <Animator>();

        PosicionActual = ((RangoDeMovimiento * RangoDeMovimiento) / 2);

        pos = transform.position;


        BoxColiderRadios = new BoxCollider2D[4];

        Transform[] auxobj = GetComponentsInChildren <Transform>();

        animatorNpc.SetInteger("face", Face);

        //otorga valores box Collider.
        foreach (Transform obj in auxobj)
        {
            if (obj.name == "arriba")
            {
                BoxColiderRadios[0] = obj.GetComponent <BoxCollider2D>();
            }
            else if (obj.name == "derecha")
            {
                BoxColiderRadios[1] = obj.GetComponent <BoxCollider2D>();
            }
            else if (obj.name == "abajo")
            {
                BoxColiderRadios[2] = obj.GetComponent <BoxCollider2D>();
            }
            else if (obj.name == "Isquierda")
            {
                BoxColiderRadios[3] = obj.GetComponent <BoxCollider2D>();
            }
        }

        npc_Dialogo = GetComponent <NPC_Dialogo>();

        npc_Brauler = GetComponent <NpcBrauler>();

        DesactivaRadioBoxCollider();


        //ajuste de face al iniciar
        Face = ((int)direcciones[0]) + 1;
        animatorNpc.SetInteger("face", Face);
    }
Example #3
0
    // Start is called before the first frame update
    void Start()
    {
        Dialogo = new NPC_Dialogo();
        Dialogo.Inicializacion();

        Dialogos = new LineasDeDialogo[5];

        Dialogos[0].Mensaje = "Bienvenido al centro medico";
        Dialogos[1].Mensaje = "Deseas que atendamos a Tus criaturas";
        Dialogos[2].Mensaje = "Dame tus Crewild, en un momento iniciamos el proceso";
        Dialogos[3].Mensaje = "Pues volver cuando quieras";

        LibreriaS = FindObjectOfType <libreriaDeScrips>();

        AnimationRecupera = GetComponent <Animation>();



        SpriteRenderer[] AuxRender = GetComponentsInChildren <SpriteRenderer>();
        int auxCounter             = 0;

        foreach (SpriteRenderer SPR in AuxRender)
        {
            if (SPR.name == "capsula" ||
                SPR.name == "capsula (1)" ||
                SPR.name == "capsula (2)" ||
                SPR.name == "capsula (3)" ||
                SPR.name == "capsula (4)" ||
                SPR.name == "capsula (5)"
                )
            {
                SpriteRender[auxCounter]         = SPR;
                SpriteRender[auxCounter].enabled = false;
                auxCounter++;
            }
        }

        NombreAnimacion = "Recuperacion";
    }