Ejemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     thisVolcano        = gameObject.GetComponent <MiniVolcanoes>();
     lavaSpriteRenderer = lava.GetComponent <SpriteRenderer>();
     randomLavaTime     = Random.Range(minInvoke, maxInvoke);
     magmaParticle      = gameObject.GetComponentInChildren <ParticleSystem>();
     player             = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>();
     aiPath             = gameObject.GetComponent <Pathfinding.AIPath>();
     aiSetter           = gameObject.GetComponent <Pathfinding.AIDestinationSetter>();
     thirdBossRef       = gameObject.GetComponent <ThirdBossSM>();
     animController     = gameObject.GetComponentInChildren <Animator>();
     //animController.Play()
 }
Ejemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     bossSM         = GameObject.FindGameObjectWithTag("Boss").GetComponent <ThirdBossSM>();
     pillarAnimator = gameObject.GetComponent <Animator>();
 }
Ejemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     player = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>();
     BossSM = GameObject.FindGameObjectWithTag("Boss").GetComponent <ThirdBossSM>();
 }
Ejemplo n.º 4
0
    private void FixedUpdate()
    {
        if (timerText == null)
        {
            if (SceneManager.GetActiveScene().name != WorldSceneManager.INTERACTIVEMENU && SceneManager.GetActiveScene().name != WorldSceneManager.MAINMENU &&
                SceneManager.GetActiveScene().name != WorldSceneManager.SUBMITSCORESCENE && SceneManager.GetActiveScene().name != WorldSceneManager.BREAKROOM)
            {
                print(SceneManager.GetActiveScene().name);
                timerText = GameObject.FindGameObjectWithTag("TimerText").GetComponent <Text>();
            }
        }

        if (SceneManager.GetActiveScene().name == "Main")
        {
            if (firstBoss == null && GameObject.Find("Boss").GetComponent <BossScript>() != null)
            {
                print("first boss script fetched");
                firstBoss = GameObject.Find("Boss").GetComponent <BossScript>();
            }

            if (firstBoss != null)
            {
                if (firstBoss.currentStage2HP > 0)
                {
                    print(boss1Time);
                    boss1Time     += Time.deltaTime;
                    timerText.text = Mathf.RoundToInt((int)boss1Time).ToString();
                }

                if (firstBoss.pMoveScript.currentHealth <= 0 && thirdBoss.thirdPhaseHP > 0)
                {
                    boss1Time = 0;
                }
            }
        }


        //2nd boss time management

        //WaterStageManager search
        if (SceneManager.GetActiveScene().name == "Stage2Phase1")
        {
            if (waterStageManager == null)
            {
                waterStageManager = GameObject.FindGameObjectWithTag("WaterStageManager").GetComponent <WaterStageManager>();
            }

            if (waterStageManager.LeversActivated < 3)
            {
                boss2Time     += Time.deltaTime;
                timerText.text = Mathf.RoundToInt((int)boss2Time).ToString();
            }
        }

        if (SceneManager.GetActiveScene().name == "Stage2Phase2")
        {
            if (secondInhale == null)
            {
                secondInhale = GameObject.FindGameObjectWithTag("Boss").GetComponent <WaterBossAI>();
            }

            if (secondInhale != null)
            {
                if (secondInhale.inhaleScript.inhaledEnemies < 20)
                {
                    boss2Time     += Time.deltaTime;
                    timerText.text = Mathf.RoundToInt((int)boss2Time).ToString();
                }
            }
        }



        //third boss time management
        if (SceneManager.GetActiveScene().name == "ThirdBoss")
        {
            if (thirdBoss == null)
            {
                thirdBoss = GameObject.FindGameObjectWithTag("Boss").GetComponent <ThirdBossSM>();
                print(thirdBoss);
            }

            if (thirdBoss != null)
            {
                if (thirdBoss.thirdPhaseHP > 0)
                {
                    //print(boss3Time);
                    boss3Time     += Time.deltaTime;
                    timerText.text = Mathf.RoundToInt((int)boss3Time).ToString();
                }

                if (thirdBoss.playerDead == true && thirdBoss.thirdPhaseHP > 0)
                {
                    boss3Time = 0;
                }
            }
        }

        //////////////////////////////////////////////
    }