Exemplo n.º 1
0
 // Start is called before the first frame update
 void Start()
 {
     hp          = gameObject.GetComponent <BossHp>();
     act         = Acter.Start;
     audioSource = GetComponent <AudioSource>();
     SECharge    = false;
 }
Exemplo n.º 2
0
 // Start is called before the first frame update
 void Awake()
 {
     for (int i = 0; i < 4; i++)
     {
         sr[i] = new List <SpriteRenderer>(); sr[i].Clear();
     }
     anim           = GetComponent <Animator>();
     enemyRigidBody = GetComponent <Rigidbody2D>();
     hpObj          = GetComponent <BossHp>();
     for (int i = 0; i < seTuYellow.Count; i++)
     {
         sr[1].Add(seTuYellow[i].GetComponent <SpriteRenderer>());
     }
     for (int i = 0; i < seTuGreen.Count; i++)
     {
         sr[2].Add(seTuGreen[i].GetComponent <SpriteRenderer>());
     }
     for (int i = 0; i < seTuBlue.Count; i++)
     {
         sr[3].Add(seTuBlue[i].GetComponent <SpriteRenderer>());
     }
     colorState = 0;
     isSkill    = false;
     StartCoroutine("PubCD_Counter");
     StartCoroutine(MoveStateCounter());
     stabPosList = new List <Vector3>();
     for (int i = 0; i < SkillCD.Count; i++)
     {
         SkillCD[i] = false;
     }
     Refresh();
     ps = GetComponentInChildren <ParticleSystem>();
 }
Exemplo n.º 3
0
    // Start is called before the first frame update


    void Start()
    {
        hp          = gameObject.GetComponent <BossHp>();
        audioSource = GetComponent <AudioSource>();
        patern      = Patern.First;
        updown      = LaserUpDown.Up;
    }
Exemplo n.º 4
0
 public override void OnAwake()
 {
     anim          = gameObject.GetComponent <Animator>();
     bloodParticle = transform.Find("BloodParticle").GetComponent <ParticleSystem>();
     special       = transform.Find("Special").GetChild(0).GetComponent <ParticleSystem>();
     bossHp        = transform.Find("CanvasBoss").GetChild(0).GetComponent <BossHp>();
 }
Exemplo n.º 5
0
 // 충돌 했을 때.
 void OnTriggerEnter(Collider _Col)
 {
     if (_Col.transform.CompareTag("Boss"))
     {
         // 플레이어의 스크립트 컴포넌트를 가져온다.
         pInfo = _Col.GetComponent <BossHp>();
         StartCoroutine("StartDamage");
     }
 }
Exemplo n.º 6
0
 // Start is called before the first frame update
 void Start()
 {
     hp = gameObject.GetComponent<BossHp>();
     act = Acter.Start;
     audioSource = GetComponent<AudioSource>();
     option = GameObject.Find("Option");
     optionscript = option.GetComponent<Option>();
     Cnt2 = 0;
     SECharge = false;
 }
Exemplo n.º 7
0
    void Start()
    {
        GetBulletsPoints();

        bossHp = GameManager.singleton.bossHp;
        bossHp.gameObject.SetActive(true);
        if (GameManager.singleton.endless)
        {
            Endless.singleton.CalculateBoss(this);
        }
        bossHp.Begin(hp);
    }
Exemplo n.º 8
0
    // 충돌이 끝났을 때.
    void OnTriggerExit(Collider _Col)
    {
        if (_Col.transform.CompareTag("Boss"))
        {
            // 코루틴을 멈춘다.
            StopCoroutine("StartDamage");

            // 충돌이 끝난 후 정보를 플레이어의 정보를 게속 가지고 있을 필요가
            // 없기 때문에 null로 초기화 해준다.
            pInfo = null;
        }
    }
Exemplo n.º 9
0
    public void ScoreSetting()
    {
        GateTrophy = Character.instance.gateNum;
        MonsterHP  = Character.instance.sumMonsterHpNum;
        BossHp     = FinalBattle.instance.doomTrack - Boss.instance.BossDoomTrack;
        ItemAmount = Character.instance.characterInventory.Count;
        Clue       = Character.instance.clue;
        Basic      = FinalBattle.instance.doomTrack - TerrorLevel.instance.terrorlevel;


        num1.text = Basic.ToString();
        num2.text = BossHp.ToString();
        num3.text = GateTrophy.ToString();
        num4.text = MonsterHP.ToString();
        num5.text = Clue.ToString();
        num6.text = Score().ToString();
    }
Exemplo n.º 10
0
    public override int GetHashCode()
    {
        int hash = 1;

        if (Name.Length != 0)
        {
            hash ^= Name.GetHashCode();
        }
        if (PosX != 0F)
        {
            hash ^= PosX.GetHashCode();
        }
        if (PosY != 0F)
        {
            hash ^= PosY.GetHashCode();
        }
        if (PosZ != 0F)
        {
            hash ^= PosZ.GetHashCode();
        }
        if (RotX != 0F)
        {
            hash ^= RotX.GetHashCode();
        }
        if (RotY != 0F)
        {
            hash ^= RotY.GetHashCode();
        }
        if (RotZ != 0F)
        {
            hash ^= RotZ.GetHashCode();
        }
        if (Hp != 0)
        {
            hash ^= Hp.GetHashCode();
        }
        if (BossHp != 0)
        {
            hash ^= BossHp.GetHashCode();
        }
        if (Target != 0)
        {
            hash ^= Target.GetHashCode();
        }
        return(hash);
    }
Exemplo n.º 11
0
    // Start is called before the first frame update
    void Start()
    {
        Transform transform = this.gameObject.GetComponent <Transform>();
        Vector2   pos       = transform.position;

        pos.x         = transform.position.x;
        pos.y         = transform.position.y;
        action        = MoveAction.Normal;
        Xswitch       = false;
        Yswitch       = false;
        BattleSwitch1 = false;
        BattleSwitch2 = false;
        movpoi1       = new Vector2(20, 0);
        movpoi2       = new Vector2(20, 5);
        movpoi3       = new Vector2(-20, 5);
        movpoi4       = new Vector2(-20, -5);
        movpoi5       = new Vector2(20, -5);
        movpoi6       = new Vector2(13, 0);
        Lesson        = 1;
        hp            = gameObject.GetComponent <BossHp>();
    }
Exemplo n.º 12
0
 void Start()
 {
     hp         = gameObject.GetComponent <BossHp>();
     EffectFlag = false;
 }
Exemplo n.º 13
0
    IEnumerator BossFight()
    {
        //playerController.destroy = true;
        //Destroy(platforma);
        //ChangeButtons();
        Vector3    spawnPositionBoss = new Vector3(0f, spawnPositiony, 0f);
        GameObject bossObject        = Instantiate(boss, spawnPositionBoss, Quaternion.identity) as GameObject;
        BossHp     bossHp            = bossObject.GetComponent <BossHp>();
        Quaternion spawnRotation     = Quaternion.Euler(180, 180, 180);

        yield return(new WaitForSeconds(levelWait * 3));

        do
        {
            CheckGameOver();
            if (bossHp.hpBoss <= 120 && bossHp.hpBoss > 90)
            {
                for (int i = 0; i < 5; i++)
                {
                    spawnPositionBoss = bossObject.transform.position;
                    int        type   = UnityEngine.Random.Range(0, hazards.Length - 1);
                    GameObject hazard = hazards[type];
                    enemyInCircle         = hazard.GetComponent <EnemyInCircle>();
                    enemyInCircle.enabled = true;
                    Instantiate(hazard, spawnPositionBoss, spawnRotation);
                    yield return(new WaitForSeconds(0.3f));
                }
                bossHp.ChangeImage();
                bossHp.moved = false;
                while (!bossHp.moved)
                {
                    yield return(new WaitForSeconds(0.0000001f));
                }
                if (gameOver)
                {
                    UpdateScore(count);
                }
                yield return(new WaitForSeconds(waveWait));
            }
            else if (bossHp.hpBoss <= 90 && bossHp.hpBoss > 60)
            {
                for (int i = 0; i < 5; i++)
                {
                    spawnPositionBoss = bossObject.transform.position;
                    int        type   = UnityEngine.Random.Range(0, hazards.Length - 1);
                    GameObject hazard = hazards[type];
                    enemyInCircle          = hazard.GetComponent <EnemyInCircle>();
                    enemyInCircle.enabled  = true;
                    enemyInCircle.onPlayer = true;
                    Instantiate(hazard, spawnPositionBoss, spawnRotation);
                    yield return(new WaitForSeconds(0.3f));
                }
                bossHp.ChangeImage();
                bossHp.moved = false;
                while (!bossHp.moved) // && animation running
                {
                    yield return(new WaitForSeconds(0.0000001f));
                }
                if (gameOver)
                {
                    UpdateScore(count);
                }
                yield return(new WaitForSeconds(waveWait));
            }
            else if (bossHp.hpBoss <= 60 && bossHp.hpBoss > 30)
            {
                for (int i = 0; i < 5; i++)
                {
                    spawnPositionBoss = bossObject.transform.position;
                    int        type   = UnityEngine.Random.Range(0, hazards.Length - 1);
                    GameObject hazard = hazards[type];
                    enemyInCircle         = hazard.GetComponent <EnemyInCircle>();
                    enemyInCircle.enabled = false;
                    mover = hazard.GetComponent <Mover>();
                    mover.rotateToPlayer = true;
                    Instantiate(hazard, spawnPositionBoss, spawnRotation);
                    yield return(new WaitForSeconds(spawnWait));
                }

                bossHp.ChangeImage();
                bossHp.moved = false;
                while (!bossHp.moved) // && animation running
                {
                    yield return(new WaitForSeconds(0.0000001f));
                }
                if (gameOver)
                {
                    UpdateScore(count);
                }
                yield return(new WaitForSeconds(waveWait));
            }
            else if (bossHp.hpBoss <= 30)
            {
                for (int i = 0; i < 5; i++)
                {
                    spawnPositionBoss = bossObject.transform.position;
                    int        type   = UnityEngine.Random.Range(0, hazards.Length - 1);
                    GameObject hazard = hazards[type];
                    enemyInCircle          = hazard.GetComponent <EnemyInCircle>();
                    enemyInCircle.enabled  = true;
                    enemyInCircle.onPlayer = false;
                    mover = hazard.GetComponent <Mover>();
                    mover.rotateToPlayer = false;
                    Instantiate(hazard, spawnPositionBoss, spawnRotation);

                    yield return(new WaitForSeconds(0.3f));
                }

                for (int i = 0; i < 5; i++)
                {
                    int        type   = UnityEngine.Random.Range(0, hazards.Length - 1);
                    GameObject hazard = hazards[type];
                    enemyInCircle          = hazard.GetComponent <EnemyInCircle>();
                    enemyInCircle.enabled  = true;
                    enemyInCircle.onPlayer = true;
                    Instantiate(hazard, spawnPositionBoss, spawnRotation);
                    yield return(new WaitForSeconds(0.3f));
                }

                for (int i = 0; i < 5; i++)
                {
                    int        type   = UnityEngine.Random.Range(0, hazards.Length - 1);
                    GameObject hazard = hazards[type];
                    enemyInCircle         = hazard.GetComponent <EnemyInCircle>();
                    enemyInCircle.enabled = false;
                    mover = hazard.GetComponent <Mover>();
                    mover.rotateToPlayer = true;
                    Instantiate(hazard, spawnPositionBoss, spawnRotation);
                    yield return(new WaitForSeconds(spawnWait));
                }

                bossHp.ChangeImage();
                bossHp.moved = false;

                while (!bossHp.moved)
                {
                    yield return(new WaitForSeconds(0.0000001f));
                }
                if (gameOver)
                {
                    UpdateScore(count);
                }
                yield return(new WaitForSeconds(waveWait));
            }
        } while (!end);
        playerControllerV2.boxCollider2d.enabled = false;
        spawnRotation = Quaternion.Euler(0, 0, 270);
        PrepareGame();
        highScore = 51;
        UpdateScore(highScore);
        gameManagerScript.Save();
        for (int i = 0; i < hazards.Length - 1; i++)
        {
            GameObject hazard = hazards[i];
            spawnPositionBoss = new Vector2(UnityEngine.Random.Range(-3, 3), 0);
            GameObject enemy = Instantiate(hazard, spawnPositionBoss, spawnRotation) as GameObject;
            yield return(new WaitForSeconds(spawnWait));
        }
        bossHp.destroyBoss = true;

        SceneManager.LoadScene("End");
    }
Exemplo n.º 14
0
 void Start()
 {
     bossHp = GetComponent <BossHp>();
 }