Esempio n. 1
0
    private void OnEnable()
    {
        vinculador = (VinculadorResources)Resources.Load("VinculadorResources");
        zona       = (PokemonEnLaZona)target;
        if (zona.pokemons == null)
        {
            zona.pokemons = new System.Collections.Generic.List <PokemonSalvaje>();
        }
        reorderableList = new ReorderableList(serializedObject, serializedObject.FindProperty("pokemons"), true, true, true, true);
        reorderableList.elementHeight = EditorGUIUtility.singleLineHeight + (18 * 7);

        // Add listeners to draw events
        reorderableList.drawHeaderCallback  += DrawHeader;
        reorderableList.drawElementCallback += DrawElement;

        reorderableList.onAddCallback    += AddItem;
        reorderableList.onRemoveCallback += RemoveItem;
    }
Esempio n. 2
0
    private void ComprobarCombatesAleatorios()
    {
        Collider2D hit = Physics2D.OverlapBox(Posicion, Ajustes.Instancia.TamanioAreaColisiones, 0, Ajustes.Instancia.layerHierba);

        if (hit != null)
        {
            pasosHastaElProximoCombate--;
            if (pasosHastaElProximoCombate <= 0)
            {
                PokemonEnLaZona zonaHierba = hit.transform.parent.GetComponent <PokemonEnLaZona>();
                if (zonaHierba != null)
                {
                    ControladorEventos.Instancia.LanzarEvento(new EventoIniciarCombatePokemonSalvaje(zonaHierba));
                    pasosHastaElProximoCombate = UnityEngine.Random.Range(Ajustes.Instancia.pasosMinimosHastaElProximoCombate, Ajustes.Instancia.pasosMaximosHastaElProximoCombate);
                }
            }
        }
    }
Esempio n. 3
0
 public EventoIniciarCombatePokemonSalvaje(PokemonEnLaZona pokemonEnLaZona)
 {
     PokemonEnLaZona = pokemonEnLaZona;
 }