예제 #1
0
    /// <summary>
    /// 현재 활동중인 몬스터 전부를 풀로 반환시키는 매소드
    /// </summary>
    public void RemoveAllActiveMonster()
    {
        if (ActivedMonsterList.Count == 0)
        {
            return;
        }

        // 몬스터 타입에따라서
        // 풀로 반환한다.
        List <GameObject> active = ActivedMonsterList;

        //ActivedMonsterList.Clear();

        foreach (GameObject mob in active)
        {
            try
            {
                MonsterType type = mob.GetComponent <FSMManager>().monsterType;

                switch (type)
                {
                case MonsterType.RedHat:
                    MonsterPoolManager._Instance._RedHat.ItemReturnPool(mob);
                    break;

                case MonsterType.Mac:
                    MonsterPoolManager._Instance._Mac.ItemReturnPool(mob);
                    break;

                case MonsterType.Tiber:
                    MonsterPoolManager._Instance._Tiber.ItemReturnPool(mob);
                    break;
                }
            }
            catch
            {
            }
        }

        if (MissionManager.Instance.CurrentMissionType == MissionType.Annihilation)
        {
            MissionA missionA = MissionManager.Instance.CurrentMission as MissionA;

            if (missionA.currentWave < missionA.totalWave)
            {
                missionA.Invoke("MonsterCheck", 5f);
            }
            //else if(missionA.currentWave == missionA.totalWave)
            //    missionA.ClearMission();
        }


        ActivedMonsterList.Clear();
    }
예제 #2
0
    public override void EndState()
    {
        base.EndState();

        if (MissionManager.Instance.CurrentMissionType == MissionType.Annihilation)
        {
            UserInterface.Instance.GoalEffectPlay();
            MissionA a = MissionManager.Instance.CurrentMission as MissionA;
            a.Invoke("MonsterCheck", 5f);
        }
        GameStatus.Instance.RemoveActivedMonsterList(gameObject);
    }
예제 #3
0
    public override void EndState()
    {
        base.EndState();

        GameStatus.Instance.RemoveActivedMonsterList(gameObject);

        _manager.agent.speed        = 0;
        _manager.agent.angularSpeed = 0;

        if (GameStatus.currentGameState != CurrentGameState.EDITOR)
        {
            if (MissionManager.Instance.CurrentMissionType == MissionType.Annihilation)
            {
                UserInterface.Instance.GoalEffectPlay();
                MissionA a = MissionManager.Instance.CurrentMission as MissionA;
                a.Invoke("MonsterCheck", 5f);
            }
        }
    }
예제 #4
0
    // Use this for initialization
    void Start()
    {
        if (currentMission < PlayerPrefs.GetInt("Mission"))
        {
            currentMission = PlayerPrefs.GetInt("Mission");
        }


        ic = GameObject.Find("Itens");


        /*PODE REMOVER */
        filtro      = GameObject.Find("Filtro");
        MissionBack = GameObject.Find("MissionBack");
        missionI    = GameObject.Find("MissionI");
        MissionA    = GameObject.Find("missionA");

        filtro.SetActive(false);
        MissionA.SetActive(false);
        MissionBack.SetActive(false);
        missionI.SetActive(false);
        //Pode Remover//
    }
예제 #5
0
    public void CheckMissionStatus()
    {
        mc = MissionContainer.Load(path);


        //REMOVER//
        filtro.SetActive(true);

        MissionBack.SetActive(true);

        //REMOVER//

        foreach (Mission mission in mc.missions)
        {
            if (mission.name == currentMission)
            {
                currentMissionItem  = mission.item;
                currentMissionItem2 = mission.item2;

                if (mission.name == 1)
                {
                    if (ic.GetComponent <ItensController>().ferro >= mission.amount)
                    {
                        print("Missao Completa");
                        //REMOVER//

                        MissionA.SetActive(true);
                        mAccomplished = true;

                        //REMOVER//
                    }
                    else
                    {
                        missionI.SetActive(true);

                        missionI.GetComponent <TextMesh>().text = "A Missao ainda esta em andamento \n Falta Ferro + " + (mission.amount - ic.GetComponent <ItensController>().ferro);
                    }
                }

                else if (mission.name == 2)
                {
                    print(mission.name);
                    print(mission.amount);
                    print(ic.GetComponent <ItensController>().uranio);
                    if (ic.GetComponent <ItensController>().uranio >= mission.amount)
                    {
                        print("Missao Completa");
                        //REMOVER//

                        MissionA.SetActive(true);
                        mAccomplished = true;

                        //REMOVER//
                    }
                    else if (ic.GetComponent <ItensController>().uranio < mission.amount)
                    {
                        missionI.SetActive(true);

                        missionI.GetComponent <TextMesh>().text = "A Missao ainda esta em andamento \n Falta uranio + " + (mission.amount - ic.GetComponent <ItensController>().uranio);
                    }
                }
                else if (mission.name == 3)
                {
                    if (ic.GetComponent <ItensController>().prata >= mission.amount)
                    {
                        print("Missao Completa");
                        //REMOVER//

                        MissionA.SetActive(true);
                        mAccomplished = true;

                        //REMOVER//
                    }
                    else
                    {
                        missionI.SetActive(true);

                        missionI.GetComponent <TextMesh>().text = "A Missao ainda esta em andamento \n Falta prata + " + (mission.amount - ic.GetComponent <ItensController>().prata);
                    }
                }
                else if (mission.name == 4)
                {
                    if (ic.GetComponent <ItensController>().ouro >= mission.amount)
                    {
                        print("Missao Completa");
                        //REMOVER//

                        MissionA.SetActive(true);
                        mAccomplished = true;

                        //REMOVER//
                    }
                    else
                    {
                        missionI.SetActive(true);

                        missionI.GetComponent <TextMesh>().text = "A Missao ainda esta em andamento \n Falta ouro + " + (mission.amount - ic.GetComponent <ItensController>().ouro);
                    }
                }
                else if (mission.name == 5)
                {
                    if (ic.GetComponent <ItensController>().ferro >= mission.amount && ic.GetComponent <ItensController>().uranio >= mission.amount2)
                    {
                        print("Missao Completa");
                        //REMOVER//

                        MissionA.SetActive(true);
                        mAccomplished = true;

                        //REMOVER//
                    }
                    else
                    {
                        missionI.SetActive(true);

                        missionI.GetComponent <TextMesh>().text = "A Missao ainda esta em andamento \n Falta ferro + " + (mission.amount - ic.GetComponent <ItensController>().ferro) + "\n e uranio" + (mission.amount - ic.GetComponent <ItensController>().uranio);
                    }
                }
                else if (mission.name == 6)
                {
                    if (ic.GetComponent <ItensController>().ferro >= mission.amount && ic.GetComponent <ItensController>().prata >= mission.amount2)
                    {
                        print("Missao Completa");
                        //REMOVER//

                        MissionA.SetActive(true);
                        mAccomplished = true;


                        //REMOVER//
                    }
                    else
                    {
                        missionI.SetActive(true);

                        missionI.GetComponent <TextMesh>().text = "A Missao ainda esta em andamento \n Falta ferro + " + (mission.amount - ic.GetComponent <ItensController>().ferro) + "\n e prata" + (mission.amount - ic.GetComponent <ItensController>().prata);
                    }
                }
            }
        }
    }
예제 #6
0
    public void MissionAccomplished()
    {
        if (mAccomplished == true)
        {
            if (currentMissionItem == "ferro")
            {
                ic.GetComponent <ItensController>().ferro -= 1;
                currentMission += 1
                                  PlayerPrefs.SetInt("Mission", currentMission);
                mAccomplished = false;

                //REMOVER//

                MissionA.SetActive(false);
                MissionBack.SetActive(false);
                filtro.SetActive(false);

                //REMOVER//
            }
            else if (currentMissionItem == "uranio")
            {
                ic.GetComponent <ItensController>().uranio -= 1;
                currentMission += 1;
                PlayerPrefs.SetInt("Mission", currentMission);
                mAccomplished = false;

                //REMOVER//

                MissionA.SetActive(false);
                MissionBack.SetActive(false);
                filtro.SetActive(false);

                //REMOVER//
            }
            else if (currentMissionItem == "prata")
            {
                ic.GetComponent <ItensController>().prata -= 1;
                currentMission += 1;
                PlayerPrefs.SetInt("Mission", currentMission);
                mAccomplished = false;

                //REMOVER//

                MissionA.SetActive(false);
                MissionBack.SetActive(false);
                filtro.SetActive(false);

                //REMOVER//
            }
            else if (currentMissionItem == "ouro")
            {
                ic.GetComponent <ItensController>().ouro -= 1;
                currentMission += 1;
                PlayerPrefs.SetInt("Mission", currentMission);
                mAccomplished = false;

                //REMOVER//

                MissionA.SetActive(false);
                MissionBack.SetActive(false);
                filtro.SetActive(false);

                //REMOVER//
            }

            if (currentMissionItem2 != null)
            {
                if (currentMissionItem2 == "ferro")
                {
                    ic.GetComponent <ItensController>().ferro -= 1;
                    currentMission += 1;
                    PlayerPrefs.SetInt("Mission", currentMission);
                    mAccomplished = false;

                    //REMOVER//

                    MissionA.SetActive(false);
                    MissionBack.SetActive(false);
                    filtro.SetActive(false);

                    //REMOVER//
                }
                else if (currentMissionItem2 == "uranio")
                {
                    ic.GetComponent <ItensController>().uranio -= 1;
                    currentMission += 1;
                    PlayerPrefs.SetInt("Mission", currentMission);
                    mAccomplished = false;

                    //REMOVER//

                    MissionA.SetActive(false);
                    MissionBack.SetActive(false);
                    filtro.SetActive(false);

                    //REMOVER//
                }
                else if (currentMissionItem2 == "prata")
                {
                    ic.GetComponent <ItensController>().prata -= 1;
                    currentMission += 1;
                    PlayerPrefs.SetInt("Mission", currentMission);
                    mAccomplished = false;

                    //REMOVER//

                    MissionA.SetActive(false);
                    MissionBack.SetActive(false);
                    filtro.SetActive(false);

                    //REMOVER//
                }
                else if (currentMissionItem2 == "ouro")
                {
                    ic.GetComponent <ItensController>().ouro -= 1;
                    currentMission += 1;
                    PlayerPrefs.SetInt("Mission", currentMission);
                    mAccomplished = false;

                    //REMOVER//

                    MissionA.SetActive(false);
                    MissionBack.SetActive(false);
                    filtro.SetActive(false);

                    //REMOVER//
                }
            }
        }
    }