Exemple #1
0
 private void Awake()
 {
     if (this.text == null)
     {
         KLog.LogError("Text is null");
     }
 }
Exemple #2
0
        public override void InitSkill(SkillModule module)
        {
            // 스킬 셋팅
            for (int i = 0; i < UserManager.useSkills.Count; i++)
            {
                //사용할 수 있는 스킬만 초기화
                switch (UserManager.useSkills[i])
                {
                case SkillKeys.PoisonShot:     // 독
                    module.AddSkill(new PoisonShot(this.gun, 5));
                    break;

                case SkillKeys.SnipeShot:     // 저격
                    module.AddSkill(new SnipeShot(this.gun, 3));
                    break;

                case SkillKeys.BombShot:     // 폭탄
                    module.AddSkill(new BombShot(this.gun, 3));
                    break;

                default:
                    KLog.LogError(string.Format("사용 불가능한 스킬. Unit: {0}, Skill: {1}", this.unitKey, UserManager.useSkills[i]));
                    break;
                }
            }
        }
Exemple #3
0
        private void Awake()
        {
            // 에러체크
            if (this.detailView == null)
            {
                KLog.LogError("QuestDetailView is null", this);
            }

            (this.detailView.transform as RectTransform).anchoredPosition3D = Vector3.zero;
        }
Exemple #4
0
        public override void OnInit()
        {
            base.OnInit();
            this.metalon = this.unit as Metalon;


            if (!this.metalon.isMini && this.centerTransform == null)
            {
                KLog.LogError("Metalon은 센터위치를 지정해 줘야함. ", this);
            }
        }
        protected virtual void Awake()
        {
            // 캐싱
            this.anim = GetComponent <Animator>();
            this.unit = GetComponentInParent <Unit>();

            // 에러체크
            if (this.anim == null)
            {
                KLog.LogError("Animator Controller는 Animator가 붙어 있어야 함", this);
            }
            if (this.unit == null)
            {
                KLog.LogError("Unit 컴포넌트 찾지못함", this);
            }
        }
Exemple #6
0
        protected override void Awake()
        {
            base.Awake();

            this.playerCtrl        = this.controller as PlayerController;
            this.unityChanAnimCtrl = this.animCtrl   as UnityChanAnimatorController;

            // 에러체크
            if (this.playerCtrl == null)
            {
                KLog.LogError("PlayerController 찾지못함", this);
            }
            if (this.gun == null)
            {
                KLog.LogError("Gun 없음)");
            }
        }
        /// <summary>
        /// 풀을 준비함.
        /// </summary>
        private void ReadyPool(string path, int count, bool autoCollecting)
        {
            // 중복처리
            if (this.poolObjectRoot.ContainsKey(path))
            {
                KLog.LogWarning(string.Format("풀링 중복: {0}", path));
                return;
            }


            // 리소스정보 불러오기
            GameObject resource = Resources.Load <GameObject>(path);

            if (resource == null)
            {
                KLog.LogError("리소스 정보를 찾지 못함. " + path);
                return;
            }
            // 리소스 정보 캐싱
            this.objectResource.Add(path, resource);


            // 생성된 오브젝트들을 담을 빈 부모 오브젝트 생성
            GameObject rootObj = new GameObject(path);

            rootObj.transform.SetParent(this.transform);

            this.poolObjectRoot.Add(path, rootObj); // 컨테이너에 등록


            // 오브젝트를 count에 맞춰 생성
            for (int i = 0; i < count; i++)
            {
                GameObject newObj = Instantiate(resource);

                PoolingObject po = newObj.AddComponent <PoolingObject>();
                po.path           = path;
                po.autoCollection = autoCollecting;


                newObj.transform.SetParent(rootObj.transform);
                newObj.gameObject.SetActive(false);
            }

            //KLog.Log(string.Format("Pooling Resource. Path: {0}, Count: {1}", path, count));
        }
Exemple #8
0
        protected override void Awake()
        {
            base.Awake();

            // 에러체크
            if (this.hone == null)
            {
                KLog.LogError("Hone is null. " + this.unitKey, this);
            }
            if (this.tail == null)
            {
                KLog.LogError("Tail is null. " + this.unitKey, this);
            }
            if (this.firePivot == null)
            {
                KLog.LogError("FirePivot is null. " + this.unitKey, this);
            }
        }
Exemple #9
0
 protected virtual void Awake()
 {
     // 에러체크
     if (this.chCtrl == null)
     {
         KLog.LogError("Character Controller없음", this);
     }
     if (this.controller == null)
     {
         KLog.LogError("Controller Base 없음", this);
     }
     if (this.animCtrl == null)
     {
         KLog.LogError("애니메이션 컨트롤러가 없음", this);
     }
     if (!this.pivots.IsVaild())
     {
         KLog.LogError("피벗정보가 비어있음", this);
     }
 }
Exemple #10
0
        /// <summary>
        /// 퀘스트 조건을 모두 달성했는지 확인함.
        /// </summary>
        public bool IsFinishProgress(string questKey)
        {
            // 퀘스트 정보를 가져온다
            QuestInfo info = QuestDatabase.GetInfo(questKey);

            // 퀘스트 진행도를 가져온다
            QuestProgressInfo progress = null;

            for (int i = 0; i < UserData.quests.Count; i++)
            {
                if (questKey == UserData.quests[i].key)
                {
                    progress = UserData.quests[i];
                    break;
                }
            }

            if (progress == null)
            {
                KLog.LogError("유효하지 않은 퀘스트키. " + questKey);
                return(false);
            }



            // 퀘스트 조건을 모두 체크해서 진행도를 채웠는지 확인
            for (int i = 0; i < info.request.Length; i++)
            {
                // 여러 조건중 하나라도 만족하지 못하면 클리어 불가능
                if (info.request[i] > progress.progress[i])
                {
                    return(false);
                }
            }

            // 모든 조건을 만족함
            return(true);
        }
Exemple #11
0
        public void UseItem(ItemInfo item)
        {
            // 포션 아이템만 사용가능
            if (item.itemKind != ItemKind.Potion)
            {
                return;
            }

            switch (item.itemKey)
            {
            case ItemKeys.HPPotion:
                this.currHP = Mathf.Clamp(this.currHP + item.intValue, 0, this.maxHP);
                break;

            case ItemKeys.MPPotion:
                this.currMP = Mathf.Clamp(this.currMP + item.intValue, 0, this.maxMP);
                break;

            default:
                KLog.LogError("알수 없는 아이템 사용. " + item.itemKey);
                break;
            }
        }
Exemple #12
0
        protected override void Awake()
        {
            base.Awake();

            // 유닛 컬러에 따라 공격 방식이 다르다.
            if (this.unitKey == UnitKeys.Mushroom_Red)
            {
                this.attackType = DefaultAttackType.Melee;
            }
            else if (this.unitKey == UnitKeys.Mushroom_Green)
            {
                this.attackType = DefaultAttackType.ParabolaBomb;
            }
            else if (this.unitKey == UnitKeys.Mushroom_Blue)
            {
                this.attackType = DefaultAttackType.CircularSector;
            }

            // 에러체크
            if (this._firePivot == null)
            {
                KLog.LogError(string.Format("FirePivot is Null. Unit: {0}", this.unitKey), this);
            }
        }
Exemple #13
0
 private void Awake()
 {
     // 에러체크
     if (this._rootLayout == null)
     {
         KLog.LogError("RootLayout is null");
     }
     if (this._statusBar == null)
     {
         KLog.LogError("UnitStatusBar is null");
     }
     if (this._crosshair == null)
     {
         KLog.LogError("Crosshair is null");
     }
     if (this._skillViewer == null)
     {
         KLog.LogError("SkillViewer is null");
     }
     if (this._itemViewer == null)
     {
         KLog.LogError("ItemViewer is null");
     }
     if (this._questQuickView == null)
     {
         KLog.LogError("QuestQuickView is null");
     }
     if (this._bossStatusBar == null)
     {
         KLog.LogError("BossStatusBar is null");
     }
     if (this._eventViewer == null)
     {
         KLog.LogError("EventViewer is null");
     }
 }