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; }
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); } } } }
public EventoIniciarCombatePokemonSalvaje(PokemonEnLaZona pokemonEnLaZona) { PokemonEnLaZona = pokemonEnLaZona; }