Пример #1
0
 protected override void DefaultStatDBConnection() //초기 스탯 할당.
 {
     meadowUnit      = unitData.Level[_level - 1].meadowUnit;
     _atk            = unitData.Level[_level - 1].Attack;
     _atkSpeed       = unitData.Level[_level - 1].AttackSpeed;
     _speed          = unitData.Level[_level - 1].MovingSpeed;
     _hp             = unitData.Level[_level - 1].Hp;
     _attackRange    = unitData.Level[_level - 1].range;
     _detectionRange = unitData.Level[_level - 1].DetectionRange;
     _playerRange    = unitData.Level[_level - 1].PlayerRange;
 }
Пример #2
0
    protected void Buff(MeadowUnit mu, bool unBuff) //버프 적용 or 해제
    {
        int num = 1;

        if (!unBuff) //유닛이 죽으면 버프 해제하기 위한 것
        {
            num = -1;
        }

        //버프를 주기 위해 "Team"이라는 태그를 이용해 게임 오브젝트 찾기
        GameObject[] Team = GameObject.FindGameObjectsWithTag("Team");
        if (Team != null)
        {
            foreach (GameObject go in Team)
            {
                CreatureCtrl cc = go.GetComponent <CreatureCtrl>();
                if (cc != null)
                {
                    switch (mu)
                    {
                    case MeadowUnit.Chicken2:     //전리품
                        break;

                    case MeadowUnit.Chicken3:
                        break;

                    case MeadowUnit.Cow2:
                        cc.BuffHP(10 * num);
                        break;

                    case MeadowUnit.Cow3:
                        cc.BuffHP(30 * num);
                        break;

                    case MeadowUnit.Duck2:     //코인
                        break;

                    case MeadowUnit.Duck3:
                        break;

                    case MeadowUnit.Horse2:
                        cc.buffSpeed(0.1f * num);
                        break;

                    case MeadowUnit.Horse3:
                        cc.buffSpeed(0.3f * num);
                        break;

                    case MeadowUnit.Sheep2:
                        cc.buffAttack(3 * num);
                        break;

                    case MeadowUnit.Goat2:
                        cc.buffAttackSpeed(0.1f * num);
                        break;

                    default:
                        break;
                    }
                }
            }
        }
    }