Пример #1
0
    public void KillEnemy(bool killed)
    {
        if (enemyType == EnemyTypes.DUMMY)
        {
            GameObject aux = Instantiate(destroyedDummy, transform.position, transform.rotation);
            Destroy(aux, 2.2f);
            if (dummyCount == 0)
            {
                GameObject.Find("RecargarHint").GetComponent <Animator>().SetInteger("AxesLeft", 1);
            }
            if (dummyCount > 0)
            {
                TimeLineManager.PlayTutorial(1);
                dummyCount--;
            }

            /*else if (dummyCount == 1)
             * {
             *  TimeLineManager.PlayTutorial(1);
             *  MobSpawning.mobSp.pUpCanvas.SetActive(true);
             *  dummyCount--;
             *  GameObject.Find("PowerUpCanvas").GetComponent<GraphicRaycaster>().enabled = true;
             *  GameObject.Find("GameCanvas").GetComponent<GraphicRaycaster>().enabled = false;
             * }*/
            else
            {
                TimeLineManager.PlayTutorial(2);
                gameObject.SetActive(false);
                Camera.main.GetComponent <CameraScript>().StartLvlVoid(1, 12f);
            }
            hp = maxHP;
            //HPBarImage.fillAmount = HPBarImage2.fillAmount = hp / maxHP;
            return;
        }
        enemiesAlive--;
        if (enemiesAlive <= 0 && MobSpawning.enemiesRem <= 0)
        {
            MobSpawning.mobSp.StartWaveRemote();
        }
        //Debug.Log(enemiesAlive + "alive - " + MobSpawning.enemiesRem + "remaining");
        if (killed == false)
        {
            CameraShaker.Instance.ShakeOnce(2f, 5f, .1f, .5f);
            //ThrowingController.currentHealth -= 20;
            //GameObject.Find("GameCanvas").GetComponent<ThrowingController>().ActualizeHealth();
            GameManager.currentHealth -= 20;
            GameObject.Find("GameCanvas").GetComponent <GameManager> ().ActualizeHealth();
        }
        else
        {
            int pointsEarned = 250 + (int)ComboTextLogic.combo * 10;
            MobSpawning.score += pointsEarned;
            PowerUpsCanvasController.INSTANCE.ActualizeMana(pointsEarned);
            waveNum.text = MobSpawning.score.ToString();
            DATA.instance.score_enemiesKilledTotal++;
        }
        gameObject.SetActive(false);
    }
Пример #2
0
 public void destroyDummy()
 {
     spawnAuxDummy();
     if (amountDummy == 0)
     {
         animRecharge.SetInteger("AxesLeft", 1);
     }
     if (amountDummy > 0)
     {
         TimeLineManager.PlayTutorial(1);
         amountDummy--;
     }
     else
     {
         TimeLineManager.PlayTutorial(2);
         gameObject.SetActive(false);
         Camera.main.GetComponent <CameraScript> ().StartLvlVoid(1, 12f);
     }
     gameObject.SetActive(false);
 }