Esempio n. 1
0
    void Update()
    {
        //AttackType = 1;
        if (Attack < 1)
        {
            BossAttack();
            Invoke("AttackBool", AttackTime);
        }

        if (boolAttackLeft)
        {
            AttackLeftSpike();
        }
        if (boolAttackRight)
        {
            AttackRightSpike();
        }
        AttackDown();
        ChangeSlider();
        if (bossHealth <= 0)
        {
            BossRb.simulated = true;
            Invoke("Win", 3);
            DestroyUpperSpike();
            for (int i = 0; i < 2; i++)
            {
                Gun[i].GetComponent <Gun2>().enabled = false;
            }
            for (int i = 0; i < 3; i++)
            {
                Destroy(DownSpike[i]);
                Destroy(LeftSpike[i]);
                Destroy(RightSpike[i]);
            }
            PS_Salut.GetComponent <ParticleSystem>().Play(true);
            Salut.SetActive(true);
            TextWin.SetActive(true);
        }
    }
Esempio n. 2
0
 void Start()
 {
     BossRb          = GetComponent <Rigidbody2D>();
     Player          = GameObject.FindGameObjectWithTag("Hero");
     LeftLineCamera  = GameObject.Find("LeftLineCamera");
     RightLineCamera = GameObject.Find("RightLineCamera");
     for (int i = 0; i < 3; i++)
     {
         redactRightRotate[i] = false;
         redactLeftRotate[i]  = false;
         RbSpikeDown[i]       = DownSpike[i].GetComponent <Rigidbody2D>();
     }
     BossRb.simulated = false;
     TextWin.SetActive(false);
     //  CamAnim = MainCamera.GetComponent<Animator>();
     AttackTime = 8;//Random.Range(5, 10);
     // leftAxis = Vector3.up; RightAxis=Vector3.right;
     //Random.Range(0, 3);
     //StartCoroutine(BossAttack());
     PS_Salut.GetComponent <ParticleSystem>().Stop(true);
     Salut.SetActive(false);
 }