Example #1
0
    public virtual void _Init()
    {
        _nHp         = _nMaxHP;
        _state       = eBarteriaSTATE.Start;
        _Effectstate = _eEffectSTATE.NULL;
        this.GetComponent <CircleCollider2D> ().enabled       = true;
        _bodyTransform.GetComponent <SpriteRenderer> ().color = new Color(255, 255, 255);

        if (_hpgauge != null)
        {
            _hpgauge.material.SetFloat("_Progress", 1);
        }

        //transform.localScale = new Vector2 (1.5f, 1.5f);

        //for (int i = 0; i < _hpgrid.GetChildList ().Count; i++) {
        ////	_hpgrid.GetChild (i).gameObject.SetActive (true);
        //}

        //_nhpconst = _nMaxHP / 5;

        //쇼크 스킬 있을 때
        if (this.GetComponent <cSkillShock> ())
        {
            Destroy(this.GetComponent <cSkillShock> ());
        }
        //독 있을시
        else if (this.GetComponent <cSkillPoison> ())
        {
            Destroy(this.GetComponent <cSkillPoison> ());
        }
        else if (this.GetComponent <cSkill8> ())
        {
            Destroy(this.GetComponent <cSkill8> ());
        }

        if (_rigidbody != null)
        {
            this._rigidbody.constraints = RigidbodyConstraints2D.FreezeRotation;
        }

        transform.localScale = new Vector2(1.5f, 1.5f);
    }
Example #2
0
    public virtual void _virtualAnimation()
    {
        switch (_Effectstate)
        {
        case _eEffectSTATE.ASH:
            _sound.volume = 1;

            if (_nHp <= 0)
            {
                GameObject obj = cAshPoolManager._GetInst()._GetAshEffect();

                if (obj != null)
                {
                    obj.transform.localScale = this.transform.localScale;
                    obj.transform.position   = this.transform.position;

                    obj.SetActive(true);
                }

                _state = eBarteriaSTATE.Die;
            }

            break;

        case _eEffectSTATE.Poison:

            _sound.volume = 1;

            _sound.PlayOneShot(cMainGame._GetInst()._ManagerSound._Bac_Poision);
            _Effectstate = _eEffectSTATE.NULL;

            break;

        case _eEffectSTATE.Fire:

            _sound.volume = 1;

            if (_nHp <= 0)
            {
                _Effectstate = _eEffectSTATE.ASH;
                break;
            }
            _sound.PlayOneShot(cMainGame._GetInst()._ManagerSound._Bac_Fire);
            _Effectstate = _eEffectSTATE.NULL;

            break;
        }


        switch (_state)
        {
        case eBarteriaSTATE.NULL:

            //if (_hpgrid.gameObject.activeSelf == true) {
            //	_hpgrid.gameObject.SetActive (false);
            //}

            break;

        case eBarteriaSTATE.Start:

            _sound.volume = 1;

            _sound.PlayOneShot(cMainGame._GetInst()._ManagerSound._BacInPipeOut());
            //_hpgrid.gameObject.SetActive (true);

            break;

        case eBarteriaSTATE.Live:

            if (_nHp <= 0)
            {
                _SetState(eBarteriaSTATE.Die);
            }

            break;

        case eBarteriaSTATE.Die:

            //_sound.PlayOneShot (cMainGame._GetInst ()._ManagerSound._Bac_DeathRandom ());

            //	_sound.clip = cMainGame._GetInst ()._ManagerSound._Bac_DeathRandom ();
            //_sound.Play ();

            cMainGame._GetInst()._waveManager._monsterLive--;
            cMainGame._GetInst()._waveManager._killMonster++;

            cMainGame._GetInst()._BarteriaKillGoldAdd(_gold);

            GameObject obj = null;
            for (int i = 0; i < 3; i++)
            {
                switch (Random.Range(0, 3))
                {
                case 0:
                    obj = cObjectPool.SharedInstance.GetPooledObject("MonsterDamager1");


                    break;

                case 1:
                    obj = cObjectPool.SharedInstance.GetPooledObject("MonsterDamager2");


                    break;

                case 2:
                    obj = cObjectPool.SharedInstance.GetPooledObject("MonsterDamager3");


                    break;
                }

                if (obj != null)
                {
                    obj.transform.position = this.transform.position + new Vector3(Random.Range(-0.1f, 0.1f), Random.Range(-0.1f, 0.1f), 0);
                    obj.SetActive(true);
                    //obj.GetComponent<AudioSource> ().PlayOneShot (cMainGame._GetInst ()._ManagerSound._Bac_DeathRandom ());
                }
            }
            if (obj != null)
            {
                obj.GetComponent <AudioSource> ().PlayOneShot(cMainGame._GetInst()._ManagerSound._Bac_DeathRandom());
            }
            cWasteBasketManager._GetInst()._ObjectInMonster(this);

            break;
        }
    }
Example #3
0
 public void _SetState(eBarteriaSTATE state)
 {
     _state = state;
 }