Exemple #1
0
    private IEnumerator StartEffect()
    {
        bool  isLoop     = true;
        float fStartTime = 0.0f;

        fStartTime = Time.time;

        while (isLoop)
        {
            yield return(new WaitForFixedUpdate());

            float fRate       = 0.0f;
            float fTimePassed = 0.0f;

            fTimePassed        = Time.time - fStartTime;
            fRate              = fTimePassed / 1.5f;
            m_textDamage.color = new Color(1.0f, 0.0f, 0.0f, 1.0f - fRate);

            if (fTimePassed > 1.5f)
            {
                isLoop = false;

                DamageTextPool.GetInstance().ReleaseObject(gameObject);
            }
        }
    }
Exemple #2
0
 void Awake()
 {
     if (_instance == null)
     {
         _instance = this;
     }
 }
Exemple #3
0
 public void SetStageBase(StageInfoBase stage)
 {
     stageInfo      = stage;
     Waves          = stage.enemyWaves;
     stageLevel     = stage.monsterLevel;
     EnemyPool      = new EnemyPool(ResourceManager.Instance.EnemyPrefab);
     DamageTextPool = new DamageTextPool(ResourceManager.Instance.DamageTextPrefab);
 }
Exemple #4
0
 public static void CreateInstance()
 {
     if (_instance == null)
     {
         GameObject go = new GameObject("DamageTextPool");
         //DontDestroyOnLoad(go);
         _instance = go.AddComponent <DamageTextPool>();
     }
 }
Exemple #5
0
    private void ShowDamageText(int nDamage)
    {
        GameObject objDamageFont = null;

        objDamageFont = DamageTextPool.GetInstance().EnableObject();
        objDamageFont.transform.position = transform.position + new Vector3(0.0f, 0.5f, -0.5f);

        objDamageFont.GetComponent <DamageText>().Play(nDamage);
    }
Exemple #6
0
    private void Awake()
    {
        m_thisInstance = this;
        m_arrSkillPool = new SkillAttackPool[(int)PlayerAttack.E_SKILL_TYPE.E_MAX];

        SlimePool.Create("Prefab/Slime", "SlimePool", 50);
        DamageTextPool.Create("Prefab/DamageText", "DamageTextPool", 50);

        m_arrSkillPool[0] = SkillAttackPool.Create("Prefab/SkillAttack1", "SkillAttack1Pool", 50);
        m_arrSkillPool[1] = SkillAttackPool.Create("Prefab/SkillAttack2", "SkillAttack2Pool", 50);

        m_arrSkillPool[0].gameObject.layer = 2;
        m_arrSkillPool[1].gameObject.layer = 1;
    }
Exemple #7
0
    public void ShowDamage(string _strDamage)
    {
        Camera camera = Camera.main;

        GameObject damageText = battleManager.damageTextPool.GetObject();

        damageText.transform.SetParent(battleManager.damagetParentTransfrom, false);
        damageText.transform.localScale = Vector3.one;
        damageText.transform.position   = camera.WorldToScreenPoint(damageTextTransform.position);
        damageText.name = "Damage";

        DamageTextPool damagePool = damageText.GetComponent <DamageTextPool> ();

        damagePool.Damage(_strDamage);
        damagePool.textObjPool = battleManager.damageTextPool;
        damagePool.leftSecond  = 1f;

        battleManager.SortDamageTextLayer();
    }
Exemple #8
0
    public static DamageTextPool Create
    (
        string strPrefabName,    // "해당 'Pool'에서 관리 할 프리팹의 이름"
        string strObjectName,    // "'PoolObject'의 이름"
        int nPoolItemMaxCount    // "'Pool'에서 관리 할 오브젝트의 최고 개수"
    )
    {
        GameObject objContainer = null;

        objContainer  = new GameObject();
        m_refInstance = objContainer.AddComponent(typeof(DamageTextPool)) as DamageTextPool;

        m_refInstance.m_strPrefabName   = strPrefabName;
        m_refInstance.m_nObjectMaxCount = nPoolItemMaxCount;
        m_refInstance.gameObject.name   = strObjectName;

        m_refInstance.PreloadObject();

        return(m_refInstance);
    }
Exemple #9
0
    public override void Complate(double _dComplate = 0.0f)
    {
        //Quest
        if (SpawnManager.Instance.repairObject.GetIsFever() == true)
        {
            SpawnManager.Instance.questManager.QuestSuccessCheck(QuestType.E_QUESTTYPE_BIGSUCCESSANDCUSTOMERSUCCESS, 1);
        }

        if (SpawnManager.Instance.repairObject.bIsMissShowUp == false)
        {
            SpawnManager.Instance.questManager.QuestSuccessCheck(QuestType.E_QUESTTYPE_NOMISSCUTOMERSUCCESS, 1);
        }
        else
        {
            SpawnManager.Instance.repairObject.bIsMissShowUp = false;
        }

        if (SpawnManager.Instance.repairObject.bIsWaterUse == false)
        {
            SpawnManager.Instance.questManager.QuestSuccessCheck(QuestType.E_QUESTTYPE_NOWATERUSE, 1);
        }
        else
        {
            SpawnManager.Instance.repairObject.bIsWaterUse = false;
        }


        //Quest
        SpawnManager.Instance.questManager.QuestSuccessCheck(QuestType.E_QUESTTYPE_CUSTOMERSUCCESS, 1);

        //70%이상
        if ((weaponData.dMaxComplate * 0.7) < _dComplate)
        {
            nDay = cPlayerData.GetDay();

            playerController.GuestSuccessed();

            dGold = weaponData.dGold * Math.Pow(1.08, nDay - 1);

            if (cPlayerData.GearEquipmnet != null)
            {
                if (cPlayerData.GearEquipmnet.nIndex == (int)E_BOSS_ITEM.DODOM_FLOWER)
                {
                    int nValue = 0;

                    for (int nIndex = 0; nIndex < SpawnManager.Instance.m_BatchArbait.Length; nIndex++)
                    {
                        if (SpawnManager.Instance.array_ArbaitData [nIndex].bIsAura)
                        {
                            nValue++;
                        }
                    }
                    dGold += dGold * cPlayerData.GearEquipmnet.fBossOptionValue * nValue * 0.01f;
                }
            }

            dGold += dGold * cPlayerData.GetGoldPlusPercent() * 0.01f;

            if (SpawnManager.Instance.shopCash.isConumeBuff_Gold)
            {
                dGold *= 2;
            }

            GameObject damageText = showGoldPool.GetObject();

            damageText.transform.SetParent(goldParent, false);
            damageText.transform.localScale = Vector3.one;
            damageText.transform.position   = cameraObj.WorldToScreenPoint(goldTextPosition.position);
            damageText.name = "Gold";

            DamageTextPool damagePool = damageText.GetComponent <DamageTextPool> ();
            damagePool.Damage("+" + ScoreManager.ScoreInstance.ChangeMoney(dGold));
            damagePool.textObjPool = showGoldPool;
            damagePool.leftSecond  = 0.6f;

            if (cPlayerData.GetEpicOption() != null)
            {
                if (cPlayerData.GetEpicOption().nIndex == (int)E_EPIC_INDEX.E_EPIC_RUBBER_CHICKEN)
                {
                    cPlayerData.GetEpicOption().CheckOption();

                    cPlayerData.SetBigSuccessed();
                }
            }

            ScoreManager.ScoreInstance.GoldPlus(dGold);

            cPlayerData.SetSuccessedGuestCount(cPlayerData.GetSuccessedGuestCount() + 1);
            ScoreManager.ScoreInstance.SetSuccessedGuestCount(cPlayerData.GetSuccessedGuestCount());

            //셩공 손님이 10명 이상 이라면
            if (cPlayerData.GetSuccessedGuestCount() >= 10)
            {
                int nHonor = Mathf.RoundToInt((float)(10 + 1.3 * (nDay - 1)));

                if (SpawnManager.Instance.shopCash.isConumeBuff_Honor)
                {
                    nHonor *= 2;
                }

                ScoreManager.ScoreInstance.HonorPlus(nHonor);

                //날짜 초기화
                cPlayerData.SetSuccessedGuestCount(0);

                ScoreManager.ScoreInstance.SetSuccessedGuestCount(0);

                //날짜를 1일 추가
                SpawnManager.Instance.SetDayInitInfo(cPlayerData.GetDay() + 1);
            }
        }

        m_bIsRepair = true;
    }