Exemplo n.º 1
0
 public void PauseOn()
 {
     Instantiate(Pause, transform.position, transform.rotation);
     pause = true;
     foreach (GameObject objs in Turrets)
     {
         objs.SetActive(false);
     }
     foreach (GameObject Enem in enemies)
     {
         Enem.SetActive(false);
     }
     foreach (GameObject bArs in Bars)
     {
         bArs.SetActive(false);
     }
     foreach (GameObject bOmb in Bombs)
     {
         bOmb.SetActive(false);
     }
     foreach (GameObject ProJ in Projectiles)
     {
         ProJ.SetActive(false);
     }
     foreach (GameObject fIre in FireShots)
     {
         fIre.SetActive(false);
     }
     foreach (GameObject iCes in Ices)
     {
         iCes.SetActive(false);
     }
 }
Exemplo n.º 2
0
    public void PauseOfF()
    {
        round_accessor.pause = false;
        foreach (GameObject objs in round_accessor.Turrets)
        {
            objs.SetActive(true);
        }
        foreach (GameObject Enem in round_accessor.enemies)
        {
            Enem.SetActive(true);
        }
        foreach (GameObject bArs in round_accessor.Bars)
        {
            bArs.SetActive(true);
        }
        foreach (GameObject bOmb in round_accessor.Bombs)
        {
            bOmb.SetActive(true);
        }
        foreach (GameObject ProJ in round_accessor.Projectiles)
        {
            ProJ.SetActive(true);
        }
        foreach (GameObject fIre in round_accessor.FireShots)
        {
            fIre.SetActive(true);
        }
        foreach (GameObject iCes in round_accessor.Ices)
        {
            iCes.SetActive(true);
        }
        GameObject PauseScreen = GameObject.Find("Pause Screen(Clone)");

        Destroy(PauseScreen);
    }
Exemplo n.º 3
0
    private void Awake()
    {
        if (match == null)
        {
            match = this;
        }
        else
        {
            Destroy(this);
        }

        //Suscribimos a eventos.
        FeedbackHUD.InformExecuteActions += CanExecuteAction;

        var test = Resources.FindObjectsOfTypeAll <Actor>();

        foreach (var item in test)
        {
            if (item.GetComponent <Player>())
            {
                player = item.GetComponent <Player>();
            }
            else
            {
                Enemy = item.GetComponent <Enem>();
            }
        }
    }
Exemplo n.º 4
0
    private void OnTriggerEnter2D(Collider2D hitinfo)
    {
        Destroy(gameObject);
        Enem enem = hitinfo.GetComponent <Enem>();

        if (enem != null)
        {
            ;
        }
        {
            enem.Damage(1);
        }
    }
Exemplo n.º 5
0
    ////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////
    #region Initialization
    public void Initialize(Enem enem)
    {
        //line_of_Sight_Behaviour = new LineOfSightOfType<RigInspectable>();

        //this.enem = enem;

        //line_of_Sight_Behaviour.Configurate(enem.rb.transform,
        //                                    ObjectFinded,
        //                                    Condition,
        //                                    layermask);

        //follow.Configure(enem.rb, enem.speed / 2, PersecutionBehavioursEnded);
    }
Exemplo n.º 6
0
 private void OnTriggerEnter2D(Collider2D coll)
 {
     if (coll.tag == "Player")
     {
         //gets every enemy in the game currently
         foreach (GameObject Enem in allEnemies)
         {
             if (Enem == null)
             {
             }
             else
             {
                 Enemy_Movement movement = Enem.GetComponent <Enemy_Movement>();
                 movement.innactive = false;
             }
         }
     }
 }
Exemplo n.º 7
0
        // Update is called once per frame
        void Update()
        {
            if (startTimer > 0 && currentEnemies == maxEnemies && enemies.Length == 0) //if we're either counting down or still waiting
            {
                roundIsOver = true;                                                    //round is still in over state
            }
            else                                                                       //otherwise
            //the round is over and we need to
            //start the next wave
            {
                roundIsOver = false;
            }

            if (roundIsOver == true)                                                                                //if the round is in over state
            {
                if (Input.GetKeyDown("space"))                                                                      //"press space to start the countdown timer
                {
                    if (startTimer > 0)                                                                             // but only if its not 0
                    {
                        InvokeRepeating("CountDown", 1, 1);
                    }
                }

                //current_enemy_amount = enemies.Length;
            }

            round                = "<color=#ff0000ff><size=30>Round: " + wave + "</size></color>";
            RoundHeight          = (Screen.height - (Screen.height - 75));
            current_enemy_amount = enemies.Length;



            if (Input.GetKeyDown("escape") && pause == false)
            {
                Instantiate(Pause, transform.position, transform.rotation);
                pause = true;
                foreach (GameObject objs in Turrets)
                {
                    objs.SetActive(false);
                }
                foreach (GameObject Enem in enemies)
                {
                    Enem.SetActive(false);
                }
                foreach (GameObject bArs in Bars)
                {
                    bArs.SetActive(false);
                }
                foreach (GameObject bOmb in Bombs)
                {
                    bOmb.SetActive(false);
                }
                foreach (GameObject ProJ in Projectiles)
                {
                    ProJ.SetActive(false);
                }
                foreach (GameObject fIre in FireShots)
                {
                    fIre.SetActive(false);
                }
                foreach (GameObject iCes in Ices)
                {
                    iCes.SetActive(false);
                }
            }
            else if (Input.GetKeyDown("escape") && pause == true)
            {
                pause = false;
                foreach (GameObject objs in Turrets)
                {
                    objs.SetActive(true);
                }
                foreach (GameObject Enem in enemies)
                {
                    Enem.SetActive(true);
                }
                foreach (GameObject bArs in Bars)
                {
                    bArs.SetActive(true);
                }
                foreach (GameObject bOmb in Bombs)
                {
                    bOmb.SetActive(true);
                }
                foreach (GameObject ProJ in Projectiles)
                {
                    ProJ.SetActive(true);
                }
                foreach (GameObject fIre in FireShots)
                {
                    fIre.SetActive(true);
                }
                foreach (GameObject iCes in Ices)
                {
                    iCes.SetActive(true);
                }
                GameObject PauseScreen = GameObject.Find("Pause Screen(Clone)");
                Destroy(PauseScreen);
            }
            if (pause == false)
            {
                enemies     = GameObject.FindGameObjectsWithTag("Enemy");
                Turrets     = GameObject.FindGameObjectsWithTag("Turret");
                Bars        = GameObject.FindGameObjectsWithTag("Bar");
                FireShots   = GameObject.FindGameObjectsWithTag("Fire");
                Projectiles = GameObject.FindGameObjectsWithTag("Projectile");
                Ices        = GameObject.FindGameObjectsWithTag("Ice");
                Bombs       = GameObject.FindGameObjectsWithTag("Bomb");
            }

            pauseY = (Screen.height / 2 - 100);
            pauseX = (Screen.width / 2 - 200);


            if (lives <= 0)
            {
                Application.LoadLevel("Forest");
            }
            if (SpeedTog.isOn == true)
            {
                Time.timeScale = 2f;
            }
            else if (SpeedTog.isOn == false)
            {
                Time.timeScale = 1f;
            }
        }