Ejemplo n.º 1
0
 public static Mapa GetInstancia()
 {
     if (instancia == null)
     {
         instancia = GameObject.FindObjectOfType <Mapa>();
     }
     return(instancia);
 }
Ejemplo n.º 2
0
        public override void Revivir()
        {
            MapaSpawn spawn = Mapa.GetInstancia().GetSpawn();

            if (spawn != null)
            {
                SetPosicion(spawn.GetPosicion());
            }
            base.Revivir();
        }
Ejemplo n.º 3
0
 protected virtual void Start()
 {
     for (int i = 0; i < modulos.Count; i++)
     {
         modulos[i].Start();
     }
     mapa = Mapa.GetInstancia();
     if (eventos != null)
     {
         eventos.EntidadEvento(EventoEntidad.VIVIR);
     }
 }
Ejemplo n.º 4
0
        private void Start()
        {
            mapa = Mapa.GetInstancia();
            game = ManagerGameplay.GetInstancia();

            for (int i = 0; i < generacion.Length; i++)
            {
                generacion[i].Start();
            }

            temporizador = new Temporizador();
            ActualizarTiempo();
        }
        public void AccionDisparar()
        {
            if (entidadprefab == null)
            {
                Debug.LogError("No contiene una entidad valida.");
                return;
            }

            if (carpeta != null)
            {
                entidadprefab.Create(carpeta, transform.position);
            }
            else if (entidad != null)
            {
                entidadprefab.Create(entidad.transform.parent, transform.position);
            }
            else if (Mapa.GetInstancia() != null)
            {
                entidadprefab.Create(Mapa.GetInstancia().transform, transform.position);
            }
        }
Ejemplo n.º 6
0
 private void Awake()
 {
     instancia = null;
     mapa      = GetComponent <BoxCollider>();
 }
Ejemplo n.º 7
0
 public void    Seleccionar()
 {
     Mapa.GetInstancia().SetSpawn(this);
 }